name: Release on: push: tags: - 'v*' # One release at a time per ref. Cancel-in-progress=false so a re-pushed # tag doesn't kill an in-flight release; instead the second run queues. concurrency: group: release-${{ github.ref }} cancel-in-progress: false permissions: contents: write jobs: release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: pnpm/action-setup@v4 with: version: 10 - uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: 'pnpm' - name: Verify tag matches package.json version run: | TAG_VERSION="${GITHUB_REF_NAME#v}" PKG_VERSION="$(node -p "require('./package.json').version")" if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then echo "::error::Tag $GITHUB_REF_NAME (=> $TAG_VERSION) does not match package.json version $PKG_VERSION" exit 1 fi - run: pnpm install --frozen-lockfile - run: pnpm lint - run: pnpm typecheck - run: pnpm test - run: pnpm build - run: pnpm pack - name: Build release notes run: | PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || true) if [ -n "$PREV_TAG" ]; then COMMITS=$(git log --pretty=format:'- %h %s' "${PREV_TAG}..HEAD") else COMMITS=$(git log --pretty=format:'- %h %s' HEAD) fi cat > release-notes.md <