|
| 1 | +name: Release a hotfix |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + pr-number: |
| 6 | + description: "Which PR should be released?" |
| 7 | + required: true |
| 8 | + confirm: |
| 9 | + description: "Confirm that the PR is up to date with the last published release, with the specific additional changes that should be released as part of this hotfix and the relevant package patch versions bumped" |
| 10 | + type: boolean |
| 11 | + required: true |
| 12 | + prerelease: |
| 13 | + description: "Publish to the hotfix tag on NPM for testing?" |
| 14 | + type: boolean |
| 15 | + required: true |
| 16 | +jobs: |
| 17 | + hotfix-release: |
| 18 | + name: Create Draft PR |
| 19 | + if: ${{ inputs.confirm == true }} |
| 20 | + runs-on: ubuntu-latest |
| 21 | + steps: |
| 22 | + - name: Checkout Repo |
| 23 | + uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + fetch-depth: 0 |
| 26 | + |
| 27 | + - name: Check user for team affiliation |
| 28 | + uses: tspascoal/get-user-teams-membership@v2 |
| 29 | + id: teamAffiliation |
| 30 | + with: |
| 31 | + GITHUB_TOKEN: ${{ secrets.READ_ONLY_ORG_GITHUB_TOKEN }} |
| 32 | + username: ${{ github.actor }} |
| 33 | + team: wrangler |
| 34 | + |
| 35 | + - name: Stop workflow if user is not a wrangler team member |
| 36 | + if: ${{ steps.teamAffiliation.outputs.isTeamMember == false }} |
| 37 | + run: | |
| 38 | + echo "You must be on the "wrangler" team to trigger this job." |
| 39 | + exit 1 |
| 40 | +
|
| 41 | + - name: "Checkout PR" |
| 42 | + run: gh pr checkout ${{ inputs.pr-number }} |
| 43 | + env: |
| 44 | + GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} |
| 45 | + |
| 46 | + - name: Install Dependencies |
| 47 | + uses: ./.github/actions/install-dependencies |
| 48 | + with: |
| 49 | + turbo-api: ${{ secrets.TURBO_API }} |
| 50 | + turbo-team: ${{ secrets.TURBO_TEAM }} |
| 51 | + turbo-token: ${{ secrets.TURBO_TOKEN }} |
| 52 | + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} |
| 53 | + |
| 54 | + - name: Build all packages |
| 55 | + run: pnpm run build |
| 56 | + env: |
| 57 | + CI_OS: ${{ runner.os }} |
| 58 | + |
| 59 | + - name: Publish packages (prerelease) |
| 60 | + if: ${{ inputs.prerelease == true }} |
| 61 | + run: pnpm publish -r --tag hotfix --filter wrangler --filter miniflare --filter create-cloudflare --dry-run |
| 62 | + |
| 63 | + - name: Publish packages |
| 64 | + if: ${{ inputs.prerelease == false }} |
| 65 | + run: pnpm publish -r --filter wrangler --filter miniflare --filter create-cloudflare --dry-run |
0 commit comments