Skip to content

Merge pull request #3 from Tracktor/fix/update-biome #3

Merge pull request #3 from Tracktor/fix/update-biome

Merge pull request #3 from Tracktor/fix/update-biome #3

Workflow file for this run

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