mirror of
https://github.com/stablyai/agent-slack.git
synced 2026-09-19 01:06:54 +08:00
2bc12b03ff
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>
68 lines
1.6 KiB
YAML
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 }}
|