Files
Jinjing 2bc12b03ff Fix RC publish by merging into single workflow (#56)
The separate publish-rc.yml workflow failed because npm OIDC provenance
auth includes the workflow file path in token claims. Only publish.yml was
authorized. Consolidate both workflows into publish.yml with RC detection.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 10:25:53 -08:00

68 lines
1.6 KiB
YAML

name: Release
on:
push:
tags:
- "v*"
jobs:
release:
name: Build + Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write # npm provenance
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Detect release type
id: meta
run: |
TAG="${GITHUB_REF_NAME}"
if [[ "$TAG" == *"-rc."* ]]; then
echo "prerelease=true" >> "$GITHUB_OUTPUT"
echo "npm_tag=rc" >> "$GITHUB_OUTPUT"
else
echo "prerelease=false" >> "$GITHUB_OUTPUT"
echo "npm_tag=latest" >> "$GITHUB_OUTPUT"
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: package.json
registry-url: "https://registry.npmjs.org"
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Lint
run: bun run lint
- name: Test
run: bun run test
- name: Build release binaries
run: bun run build:release
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
files: |
release/agent-slack-*
release/checksums-sha256.txt
generate_release_notes: true
prerelease: ${{ steps.meta.outputs.prerelease == 'true' }}
- name: Build for npm
run: bun run build:npm
- name: Publish to npm
run: npm publish --provenance --access public --tag ${{ steps.meta.outputs.npm_tag }}