Skip to content

Release

Release #37

Workflow file for this run

name: Release
on:
workflow_run:
workflows: ["Prepare Release"]
types:
- completed
jobs:
publish:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_commit.id }}
fetch-depth: 0
- name: Checkout latest tag
run: |
set -eo pipefail
git fetch --force --tags
LATEST_TAG=$(git for-each-ref --sort=-creatordate --format '%(refname:short)' refs/tags | head -n 1)
if [ -z "$LATEST_TAG" ]; then
echo "No tags available to release."
exit 1
fi
git checkout "$LATEST_TAG"
echo "RELEASE_TAG=$LATEST_TAG" >> "$GITHUB_ENV"
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24.x
cache: pnpm
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build package
run: pnpm run build
- name: Publish package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm run release:publish