Merge pull request #3 from Tracktor/fix/update-biome #3
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: 🚀 Release & Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: 🛎️ Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: 🐰 Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| - name: 📦 Install dependencies | |
| run: bun install | |
| - name: 🧑 Configure Git identity | |
| run: | | |
| git config --local user.name "github-actions[bot]" | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: 🏷️ Bump version & generate changelog | |
| id: bump | |
| run: | | |
| PREV_VERSION=$(jq -r .version package.json) | |
| bun run release | |
| NEW_VERSION=$(jq -r .version package.json) | |
| echo "prev_version=$PREV_VERSION" >> $GITHUB_OUTPUT | |
| echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT | |
| - name: 🚀 Push changes and tags | |
| if: steps.bump.outputs.prev_version != steps.bump.outputs.new_version | |
| run: | | |
| git push origin HEAD:${{ github.ref }} | |
| git push --tags | |
| - name: 🔐 Setup npm token | |
| if: steps.bump.outputs.prev_version != steps.bump.outputs.new_version | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc | |
| npm whoami | |
| - name: 📤 Publish to npm | |
| if: steps.bump.outputs.prev_version != steps.bump.outputs.new_version | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: npm publish --access public |