Release #1124
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| workflow_run: | |
| workflows: [CI] | |
| types: [completed] | |
| branches: [master] | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| # Serialize release runs (workflow_run events from back-to-back CI | |
| # completions must not race semantic-release's tag/version writes); | |
| # never cancel an in-progress publish. | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| # Runs only after the CI workflow completes successfully on master. | |
| if: github.event.workflow_run.conclusion == 'success' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| # semantic-release requires a branch checkout, so we stay on master and | |
| # instead guard that master still points at the CI-tested commit. When a | |
| # newer push has moved master, this run skips — that push's own CI run | |
| # releases it. Guarantees the published SHA is always a CI-passed SHA. | |
| - name: Verify master still points at the tested commit | |
| id: guard | |
| run: | | |
| TESTED="${{ github.event.workflow_run.head_sha }}" | |
| HEAD_SHA="$(git rev-parse HEAD)" | |
| if [ "$HEAD_SHA" = "$TESTED" ]; then | |
| echo "should_release=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "master ($HEAD_SHA) moved past tested commit ($TESTED); skipping — the newer push's CI will release" | |
| echo "should_release=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| if: steps.guard.outputs.should_release == 'true' | |
| run: pnpm install | |
| - name: Build | |
| if: steps.guard.outputs.should_release == 'true' | |
| run: pnpm run build | |
| - name: Verify build | |
| if: steps.guard.outputs.should_release == 'true' | |
| run: | | |
| if [ ! -d "dist" ]; then | |
| echo "Build failed: dist directory not found" | |
| exit 1 | |
| fi | |
| - name: Refresh test-count badge | |
| if: steps.guard.outputs.should_release == 'true' | |
| run: node scripts/update-test-badge.mjs | |
| - name: Semantic Release | |
| if: steps.guard.outputs.should_release == 'true' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: pnpm exec semantic-release | |
| - name: Trigger docs rebuild | |
| if: success() && steps.guard.outputs.should_release == 'true' | |
| run: | | |
| curl -X POST \ | |
| -H "Accept: application/vnd.github.v3+json" \ | |
| -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
| https://api.github.com/repos/framersai/agentos-live-docs/dispatches \ | |
| -d '{"event_type":"docs-rebuild"}' || true |