|
| 1 | +name: Release Binaries All |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: read # Default everything to read-only |
| 5 | + |
| 6 | +on: |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + release-version: |
| 10 | + description: 'Release Version' |
| 11 | + required: true |
| 12 | + type: string |
| 13 | + upload: |
| 14 | + description: 'Upload binaries to the release page' |
| 15 | + required: true |
| 16 | + default: false |
| 17 | + type: boolean |
| 18 | + |
| 19 | + workflow_call: |
| 20 | + inputs: |
| 21 | + release-version: |
| 22 | + description: 'Release Version' |
| 23 | + required: true |
| 24 | + type: string |
| 25 | + upload: |
| 26 | + description: 'Upload binaries to the release page' |
| 27 | + required: true |
| 28 | + default: false |
| 29 | + type: boolean |
| 30 | + |
| 31 | + pull_request: |
| 32 | + types: |
| 33 | + - opened |
| 34 | + - synchronize |
| 35 | + - reopened |
| 36 | + # When a PR is closed, we still start this workflow, but then skip |
| 37 | + # all the jobs, which makes it effectively a no-op. The reason to |
| 38 | + # do this is that it allows us to take advantage of concurrency groups |
| 39 | + # to cancel in progress CI jobs whenever the PR is closed. |
| 40 | + - closed |
| 41 | + paths: |
| 42 | + - '.github/workflows/release-binaries-all.yml' |
| 43 | + - '.github/workflows/release-binaries.yml' |
| 44 | + - '.github/workflows/release-binaries-setup-stage/*' |
| 45 | + - '.github/workflows/release-binaries-save-stage/*' |
| 46 | + |
| 47 | +concurrency: |
| 48 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || 'dispatch' }} |
| 49 | + cancel-in-progress: True |
| 50 | + |
| 51 | +jobs: |
| 52 | + setup-variables: |
| 53 | + if: >- |
| 54 | + (github.event_name != 'pull_request' || github.event.action != 'closed') |
| 55 | + runs-on: ubuntu-22.04 |
| 56 | + outputs: |
| 57 | + release-version: ${{ steps.vars.outputs.release-version }} |
| 58 | + upload: ${{ steps.vars.outputs.upload }} |
| 59 | + steps: |
| 60 | + - shell: bash |
| 61 | + id: vars |
| 62 | + run: | |
| 63 | + upload="${{ inputs.upload }}" |
| 64 | + release_version="${{ inputs.release-version }}" |
| 65 | + if [ "${{ github.event_name }}" = "pull_request" ]; then |
| 66 | + upload="false" |
| 67 | + release_version="" |
| 68 | + fi |
| 69 | + echo "release-version=$release_version" >> "$GITHUB_OUTPUT" |
| 70 | + echo "upload=$upload" >> "$GITHUB_OUTPUT" |
| 71 | +
|
| 72 | + release-binaries-all: |
| 73 | + name: Build Release Binaries |
| 74 | + needs: |
| 75 | + - setup-variables |
| 76 | + permissions: |
| 77 | + contents: write # For release uploads |
| 78 | + id-token: write # For artifact attestations |
| 79 | + attestations: write # For artifact attestations |
| 80 | + strategy: |
| 81 | + fail-fast: false |
| 82 | + matrix: |
| 83 | + runs-on: |
| 84 | + - ubuntu-22.04 |
| 85 | + - windows-2022 |
| 86 | + - macos-13 |
| 87 | + - macos-14 |
| 88 | + |
| 89 | + uses: ./.github/workflows/release-binaries.yml |
| 90 | + with: |
| 91 | + release-version: "${{ needs.setup-variables.outputs.release-version }}" |
| 92 | + upload: ${{ needs.setup-variables.outputs.upload == 'true'}} |
| 93 | + runs-on: "${{ matrix.runs-on }}" |
| 94 | + |
0 commit comments