Release #149
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_dispatch: | |
| inputs: | |
| version: | |
| description: 'Explicit CalVer (e.g. 2026.05.13-2). Empty = auto-compute today.' | |
| required: false | |
| type: string | |
| default: '' | |
| dry_run: | |
| description: 'Dry-run preview only (no publish or push)' | |
| required: false | |
| type: boolean | |
| default: false | |
| publish-only: | |
| description: 'Publish an already prepared version through GitHub OIDC; requires version.' | |
| required: false | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: read | |
| id-token: write | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Configure git identity | |
| run: | | |
| git config user.name "senpi-release-bot" | |
| git config user.email "[email protected]" | |
| - name: Setup Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org/' | |
| package-manager-cache: false | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1 | |
| with: | |
| bun-version: '1.4.0' | |
| - name: Assert bun 1.4 toolchain | |
| run: bash scripts/assert-bun-toolchain.sh | |
| - name: Install dependencies | |
| run: npm install --ignore-scripts --no-audit --no-fund | |
| - name: Build all workspaces (so husky pre-commit type check resolves) | |
| run: npm run build | |
| - name: Reset auto-generated and npm-install drift files (not part of release diff) | |
| run: git checkout -- packages/ai/src/models.generated.ts packages/ai/src/image-models.generated.ts package-lock.json | |
| - name: Run release | |
| if: inputs.publish-only != true | |
| env: | |
| GH_TOKEN: ${{ secrets.UPSTREAM_AUTOMATION_TOKEN }} | |
| SENPI_SKIP_PM_VERIFY: '1' | |
| run: | | |
| test -n "$GH_TOKEN" || { | |
| echo "::error::UPSTREAM_AUTOMATION_TOKEN is required to push release commits and tags through branch protection." | |
| exit 1 | |
| } | |
| git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
| ARGS=() | |
| if [ -n "${{ inputs.version }}" ]; then | |
| ARGS+=(--version "${{ inputs.version }}") | |
| fi | |
| if [ "${{ inputs.dry_run }}" = "true" ]; then | |
| ARGS+=(--dry-run) | |
| fi | |
| npm run release -- "${ARGS[@]}" | |
| - name: Publish prepared version | |
| if: inputs.publish-only == true | |
| env: | |
| EXPECTED_VERSION: ${{ inputs.version }} | |
| DRY_RUN: ${{ inputs.dry_run }} | |
| run: | | |
| test -n "$EXPECTED_VERSION" || { | |
| echo "publish-only requires an explicit version" >&2 | |
| exit 1 | |
| } | |
| ACTUAL_VERSION="$(node -p 'require("./packages/coding-agent/package.json").version')" | |
| test "$ACTUAL_VERSION" = "$EXPECTED_VERSION" || { | |
| echo "expected $EXPECTED_VERSION, found $ACTUAL_VERSION" >&2 | |
| exit 1 | |
| } | |
| PUBLISH_ARGS=() | |
| if [ "$DRY_RUN" = "true" ]; then | |
| PUBLISH_ARGS+=(--dry-run) | |
| fi | |
| node scripts/publish.mjs "${PUBLISH_ARGS[@]}" | |
| - name: Workflow summary | |
| if: always() | |
| shell: bash | |
| run: | | |
| { | |
| echo "## Release" | |
| echo | |
| echo "| Field | Value |" | |
| echo "| --- | --- |" | |
| echo "| Job status | ${{ job.status }} |" | |
| echo "| Mode | ${{ inputs.publish-only && 'publish-only' || 'release' }} |" | |
| echo "| Dry run | ${{ inputs.dry_run }} |" | |
| echo "| Version | ${{ inputs.version || 'auto' }} |" | |
| echo "| Commit | ${{ github.sha }} |" | |
| } >> "$GITHUB_STEP_SUMMARY" |