cloudflare/kumo
Publicmirrored fromhttps://github.com/cloudflare/kumoAvailable
.github/workflows/release.yml
54lines · modecode
| 1 | name: Release |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - main |
| 7 | |
| 8 | concurrency: |
| 9 | group: ${{ github.workflow }} |
| 10 | cancel-in-progress: false |
| 11 | |
| 12 | jobs: |
| 13 | release: |
| 14 | permissions: |
| 15 | id-token: write |
| 16 | contents: write |
| 17 | pull-requests: write |
| 18 | |
| 19 | if: ${{ github.repository_owner == 'cloudflare' }} |
| 20 | runs-on: ubuntu-latest |
| 21 | timeout-minutes: 20 |
| 22 | steps: |
| 23 | - name: Checkout |
| 24 | uses: actions/checkout@v4 |
| 25 | with: |
| 26 | fetch-depth: 0 |
| 27 | |
| 28 | - name: Install Dependencies |
| 29 | uses: ./.github/actions/install-dependencies |
| 30 | |
| 31 | - name: Build @cloudflare/kumo |
| 32 | run: pnpm --filter @cloudflare/kumo build |
| 33 | |
| 34 | # changesets/action either: |
| 35 | # 1. Creates/updates a "Version Packages" PR (when changesets exist) |
| 36 | # 2. Publishes to npm via `pnpm run release` (when Version Packages PR merges) |
| 37 | # Note: `pnpm run release` runs `pnpm build:all && changeset publish`, |
| 38 | # which rebuilds kumo (redundant but harmless). If this becomes slow, |
| 39 | # consider a publish-only script. |
| 40 | - name: Create Version PR or Publish to npm |
| 41 | id: changesets |
| 42 | uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1 |
| 43 | with: |
| 44 | version: pnpm run version |
| 45 | publish: pnpm run release |
| 46 | env: |
| 47 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 48 | NPM_CONFIG_PROVENANCE: true |
| 49 | |
| 50 | # Publish pkg-pr-new preview for Version Packages PR |
| 51 | # (GITHUB_TOKEN PRs don't trigger workflows, so we do it here) |
| 52 | - name: Publish package preview |
| 53 | if: ${{ steps.changesets.outputs.pullRequestNumber }} |
| 54 | run: pnpm dlx pkg-pr-new publish --pnpm --compact --no-template ./packages/kumo |
| 55 | |