v1.1.0 #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to GitHub Packages | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@labbs' | |
| - name: Extract version from tag | |
| id: version | |
| run: | | |
| # Remove 'v' prefix from tag (v1.0.0-beta2 -> 1.0.0-beta2) | |
| VERSION=${GITHUB_REF_NAME#v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Publishing version: $VERSION" | |
| - name: Update package versions | |
| run: | | |
| VERSION=${{ steps.version.outputs.version }} | |
| # Update core package version | |
| cd packages/core | |
| npm pkg set version="$VERSION" | |
| cd ../react | |
| # Update react package version | |
| npm pkg set version="$VERSION" | |
| # Update dependency on core to use exact version | |
| npm pkg set dependencies.@labbs/openblock-core="$VERSION" | |
| - run: pnpm install --no-frozen-lockfile | |
| - name: Build packages | |
| run: | | |
| pnpm --filter @labbs/openblock-core build | |
| pnpm --filter @labbs/openblock-react build | |
| - name: Publish @labbs/openblock-core | |
| run: pnpm --filter @labbs/openblock-core publish --access public --no-git-checks | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish @labbs/openblock-react | |
| run: pnpm --filter @labbs/openblock-react publish --access public --no-git-checks | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |