name: Build Release Candidate on: workflow_call: inputs: candidate_tag: description: "Immutable internal tag (build/vX.Y.Z 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 }} release_channel: ${{ steps.identity.outputs.channel }} rc_number: ${{ steps.identity.outputs.rc_number }} windows_signing: ${{ steps.identity.outputs.windows_signing }} linux_image_tag: ${{ steps.linux-image.outputs.image_tag }} armhf_image_tag: ${{ steps.armhf-image.outputs.image_tag }} 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 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 "channel=$(jq -r .channel <<<"$IDENTITY")" echo "rc_number=$(jq -r .rc_number <<<"$IDENTITY")" echo "windows_signing=$(jq -r .windows_signing <<<"$IDENTITY")" } >> "$GITHUB_OUTPUT" - id: linux-image name: Resolve Linux CI image generation env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: .github/scripts/resolve-linux-ci-image-tag.py - id: armhf-image name: Resolve armhf CI image generation env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} RESOLVE_ARMHF: true run: .github/scripts/resolve-linux-ci-image-tag.py 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" release_channel: ${{ needs.prepare.outputs.release_channel }} rc_number: ${{ needs.prepare.outputs.rc_number }} 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" release_channel: ${{ needs.prepare.outputs.release_channel }} rc_number: ${{ needs.prepare.outputs.rc_number }} 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_tag: ${{ needs.prepare.outputs.linux_image_tag }} save_ccache: true build_packages: true release_channel: ${{ needs.prepare.outputs.release_channel }} rc_number: ${{ needs.prepare.outputs.rc_number }} linux-arm: needs: prepare uses: ./.github/workflows/build-linux.yml with: version: ${{ needs.prepare.outputs.version }} hamlib_branch: "4.7.2" arch: aarch64 image_tag: ${{ needs.prepare.outputs.linux_image_tag }} save_ccache: true build_packages: true release_channel: ${{ needs.prepare.outputs.release_channel }} rc_number: ${{ needs.prepare.outputs.rc_number }} # Cross-compile on x86_64, then run target tests, packaging, and AppImage # validation in the paired ARMv7 runtime image under QEMU. linux-armhf: needs: prepare uses: ./.github/workflows/build-linux.yml with: version: ${{ needs.prepare.outputs.version }} hamlib_branch: "4.7.2" arch: armhf image_tag: ${{ needs.prepare.outputs.armhf_image_tag }} allow_stale_image: true save_ccache: true build_packages: true release_channel: ${{ needs.prepare.outputs.release_channel }} rc_number: ${{ needs.prepare.outputs.rc_number }} windows: needs: prepare uses: ./.github/workflows/build-windows.yml with: version: ${{ needs.prepare.outputs.version }} hamlib_branch: "4.7.2" release_channel: ${{ needs.prepare.outputs.release_channel }} rc_number: ${{ needs.prepare.outputs.rc_number }} 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 - 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" \ '{schema: 1, version: $version, tag: $tag, commit: $commit, repository: $repository, workflow_run: $run_id, 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