Release #4
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: Exact SemVer to publish (for example, 1.2.3 or 1.2.3-beta.1) | |
| required: true | |
| type: string | |
| permissions: {} | |
| concurrency: | |
| group: npm-release | |
| cancel-in-progress: false | |
| jobs: | |
| prepare: | |
| name: Prepare verified release | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out the dispatch revision without credentials | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.sha }} | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Create the pinned local release branch | |
| run: git checkout -B main "$GITHUB_SHA" | |
| - name: Set up pinned pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Configure the release commit author | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Prepare and verify the exact release | |
| env: | |
| RELEASE_VERSION: ${{ inputs.version }} | |
| run: node scripts/release-workflow.mjs prepare "$RELEASE_VERSION" | |
| - name: Upload the verified release | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: npm-release-${{ inputs.version }} | |
| path: | | |
| .cache/diffsplain-release.tgz | |
| .cache/diffsplain-release.json | |
| .cache/diffsplain-release-plan.json | |
| .cache/diffsplain-release.bundle | |
| include-hidden-files: true | |
| if-no-files-found: error | |
| retention-days: 90 | |
| release: | |
| needs: prepare | |
| name: Publish verified release | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| environment: npm-publish | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Check out the dispatch revision with release credentials | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.sha }} | |
| fetch-depth: 0 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| - name: Download the verified release | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: npm-release-${{ inputs.version }} | |
| path: .cache | |
| - name: Confirm the trusted publishing client | |
| run: COREPACK_ENABLE_PROJECT_SPEC=0 corepack npm@11.5.1 --version | |
| - name: Push and publish the verified release | |
| env: | |
| RELEASE_VERSION: ${{ inputs.version }} | |
| run: node scripts/release-workflow.mjs finalize "$RELEASE_VERSION" |