Skip to content

Release

Release #31

Workflow file for this run

name: Release
# Runs only after CI succeeds on main, so a red main never publishes.
# Changesets opens or updates a version PR. Merging that PR triggers CI again,
# after which Changesets publishes the versioned package to npm.
on:
workflow_run:
workflows: [CI]
branches: [main]
types: [completed]
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup toolchain (mise)
uses: jdx/mise-action@v4
with:
cache: true
- name: Configure npm registry
run: |
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm install --frozen-lockfile
- run: pnpm build
- uses: changesets/action@v2.1.1
with:
version-script: pnpm run version-packages
publish-script: pnpm release
commit-message: "maint: version packages"
pr-title: "maint: version packages"
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}