summaryrefslogtreecommitdiff
path: root/.github/workflows/release.yml
blob: b98a5ac7aa199500c98b3e9f7cf33cebd08839c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Build Release Candidate

on:
  workflow_call:
    inputs:
      candidate_tag:
        description: "Immutable internal tag (build/vX.Y.Z, build/vX.Y.Z-betaN, or build/vX.Y.Z-rcN)"
        required: true
        type: string
      expected_sha:
        description: "Full commit SHA selected by the release tag helper"
        required: true
        type: string

permissions:
  contents: read
  packages: read

concurrency:
  group: release-candidate-${{ inputs.candidate_tag }}
  cancel-in-progress: false

jobs:
  prepare:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    outputs:
      version: ${{ steps.identity.outputs.version }}
      windows_signing: ${{ steps.identity.outputs.windows_signing }}
      image_tag: ${{ steps.linux-images.outputs.image_tag }}
      x86_64_digest: ${{ steps.linux-images.outputs.x86_64_digest }}
      aarch64_digest: ${{ steps.linux-images.outputs.aarch64_digest }}
      armhf_digest: ${{ steps.linux-images.outputs.armhf_digest }}
      armhf_cross_digest: ${{ steps.linux-images.outputs.armhf_cross_digest }}
    env:
      CANDIDATE_TAG: ${{ inputs.candidate_tag }}
      EXPECTED_SHA: ${{ inputs.expected_sha }}
    steps:
      - uses: actions/checkout@v7
        with:
          fetch-depth: 0
          ref: ${{ env.CANDIDATE_TAG }}
      - name: Verify immutable candidate identity
        id: identity
        run: |
          set -euo pipefail
          if [[ ! "$CANDIDATE_TAG" =~ ^build/v(.+)$ ]]; then
            echo "::error::Expected build/vX.Y.Z, build/vX.Y.Z-betaN, or build/vX.Y.Z-rcN, got $CANDIDATE_TAG"
            exit 1
          fi
          ACTUAL_SHA=$(git rev-parse HEAD)
          if [ "$ACTUAL_SHA" != "$EXPECTED_SHA" ]; then
            echo "::error::Candidate tag resolves to $ACTUAL_SHA, expected $EXPECTED_SHA"
            exit 1
          fi
          VERSION="${CANDIDATE_TAG#build/v}"
          IDENTITY=$(python3 .github/scripts/release-policy.py validate-source "$VERSION")
          {
            echo "version=$(jq -r .version <<<"$IDENTITY")"
            echo "windows_signing=$(jq -r .windows_signing <<<"$IDENTITY")"
          } >> "$GITHUB_OUTPUT"
      - name: Validate prepared Linux images
        id: linux-images
        run: |
          python3 .github/scripts/release-linux-images.py validate release-linux-images.json \
            --check-remote --github-output "$GITHUB_OUTPUT"

  macos:
    needs: prepare
    uses: ./.github/workflows/build-macos.yml
    with:
      version: ${{ needs.prepare.outputs.version }}
      hamlib_branch: "4.7.2"
      arch: arm64
      runner: macos-15
      deployment_target: "11.0"
      signing_mode: validation

  macos-intel:
    needs: prepare
    uses: ./.github/workflows/build-macos.yml
    with:
      version: ${{ needs.prepare.outputs.version }}
      hamlib_branch: "4.7.2"
      arch: x86_64
      runner: macos-15-intel
      deployment_target: "10.13"
      signing_mode: validation

  linux:
    needs: prepare
    uses: ./.github/workflows/build-linux.yml
    with:
      version: ${{ needs.prepare.outputs.version }}
      hamlib_branch: "4.7.2"
      arch: x86_64
      image_digest: ${{ needs.prepare.outputs.x86_64_digest }}
      image_source: public-release
      image_tag: ${{ needs.prepare.outputs.image_tag }}
      save_ccache: true
      build_packages: true

  linux-arm:
    needs: prepare
    uses: ./.github/workflows/build-linux.yml
    with:
      version: ${{ needs.prepare.outputs.version }}
      hamlib_branch: "4.7.2"
      arch: aarch64
      image_digest: ${{ needs.prepare.outputs.aarch64_digest }}
      image_source: public-release
      image_tag: ${{ needs.prepare.outputs.image_tag }}
      save_ccache: true
      build_packages: true

  # Cross-compile on x86_64, then run target tests, packaging, and AppImage
  # validation in the paired ARMv7 runtime image on an ARM runner.
  linux-armhf:
    needs: prepare
    uses: ./.github/workflows/build-linux.yml
    with:
      version: ${{ needs.prepare.outputs.version }}
      hamlib_branch: "4.7.2"
      arch: armhf
      image_source: public-release
      image_tag: ${{ needs.prepare.outputs.image_tag }}
      image_digest: ${{ needs.prepare.outputs.armhf_digest }}
      armhf_cross_image_digest: ${{ needs.prepare.outputs.armhf_cross_digest }}
      save_ccache: true
      build_packages: true

  windows:
    needs: prepare
    uses: ./.github/workflows/build-windows.yml
    with:
      version: ${{ needs.prepare.outputs.version }}
      hamlib_branch: "4.7.2"

  candidate-ready:
    needs: [prepare, macos, macos-intel, linux, linux-arm, linux-armhf, windows]
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v7
      - uses: actions/download-artifact@v8
        with:
          path: artifacts
      # build-linux.yml hands this tree between its ARMHF jobs; it is no asset.
      - name: Drop the ARMHF build tree
        run: rm -rf artifacts/armhf-build-tree
      - name: Verify all candidate artifacts
        run: python3 .github/scripts/release-policy.py verify-assets "${{ needs.prepare.outputs.version }}" artifacts
      - name: Verify candidate packaging reports
        run: |
          python3 .github/scripts/release-policy.py verify-signing-reports \
            "${{ needs.prepare.outputs.version }}" artifacts \
            --commit "${{ inputs.expected_sha }}" --tag "${{ inputs.candidate_tag }}" \
            --macos-mode validation --windows-mode unsigned
      - name: Record candidate provenance
        env:
          VERSION: ${{ needs.prepare.outputs.version }}
          CANDIDATE_TAG: ${{ inputs.candidate_tag }}
          CANDIDATE_SHA: ${{ inputs.expected_sha }}
          WINDOWS_RELEASE_MODE: ${{ needs.prepare.outputs.windows_signing }}
        run: |
          jq -n \
            --arg version "$VERSION" \
            --arg tag "$CANDIDATE_TAG" \
            --arg commit "$CANDIDATE_SHA" \
            --arg repository "$GITHUB_REPOSITORY" \
            --arg run_id "$GITHUB_RUN_ID" \
            --arg windows_release_mode "$WINDOWS_RELEASE_MODE" \
            --argjson linux_images "$(python3 .github/scripts/release-linux-images.py provenance release-linux-images.json)" \
            '{schema: 1, version: $version, tag: $tag, commit: $commit, repository: $repository, workflow_run: $run_id, linux_images: $linux_images, windows_release_signing: $windows_release_mode, candidate_signing: {windows: "unsigned", macos: "validation"}}' \
            > artifacts/candidate-provenance.json
      - name: Upload complete candidate
        uses: actions/upload-artifact@v7
        with:
          name: release-candidate-${{ needs.prepare.outputs.version }}
          path: artifacts
          if-no-files-found: error
          retention-days: 30