Skip to content

Release

Release #4

Workflow file for this run

name: Release
permissions:
contents: write # to create release (changesets/action)
issues: write # to post issue comments (changesets/action)
pull-requests: write # to create pull request (changesets/action)
id-token: write # to use OpenID Connect token for provenance (changesets/action)
on:
workflow_run:
workflows: ["Test"]
branches: [main]
types: [completed]
jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'cloudflare' }}
timeout-minutes: 5
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v4
with:
node-version: 24 # includes npm 11.5.1 or later, needed for trusted publishing
cache: "npm"
- run: npm ci
- run: npm run build
- id: changesets
uses: changesets/action@v1
with:
# Note that these commands are NOT interpreted by a shell, they are apparently only
# split on whitespace and then passed directly to execvp(). Hence the need to indirect
# through a shell script, ugh. :(
version: ./.github/changeset-version.sh
publish: npx changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
prerelease:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'cloudflare' }}
timeout-minutes: 5
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v4
with:
node-version: 24 # includes npm 11.5.1 or later, needed for trusted publishing
cache: "npm"
- run: npm ci
- name: Modify package.json version
run: npx tsx .github/version-script.ts
- run: npm run build
- run: npm publish --tag beta