Simplify release matrix

This commit is contained in:
José Valim
2024-12-28 09:21:00 +01:00
parent c1c2cf8a65
commit af4cb1d6a6
+8 -22
View File
@@ -59,26 +59,19 @@ jobs:
fail-fast: true
matrix:
include:
- otp: 25
otp_version: "25.3"
run_job: ${{ startsWith(github.ref_name, 'v1.18') }}
- otp: 26
otp_version: "26.0"
run_job: true
- otp: 27
otp_version: "27.0"
build_docs: build_docs
run_job: true
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
if: matrix.run_job
with:
fetch-depth: 50
- name: "Build Release"
uses: ./.github/workflows/release_pre_built
if: matrix.run_job
with:
otp_version: ${{ matrix.otp_version }}
otp: ${{ matrix.otp }}
@@ -87,39 +80,37 @@ jobs:
- name: "Attest docs provenance"
uses: actions/attest-build-provenance@v2
id: attest-docs-provenance
if: matrix.run_job && matrix.build_docs
if: matrix.build_docs
with:
subject-path: "Docs.zip"
- name: "Copy docs provenance"
if: matrix.run_job && matrix.build_docs
if: matrix.build_docs
run: cp "$ATTESTATION" Docs.zip.sigstore
env:
ATTESTATION: "${{ steps.attest-docs-provenance.outputs.bundle-path }}"
- name: Create Docs Hashes
if: matrix.run_job && matrix.build_docs
if: matrix.build_docs
run: |
shasum -a 1 Docs.zip > Docs.zip.sha1sum
shasum -a 256 Docs.zip > Docs.zip.sha256sum
- name: "Upload linux release artifacts"
uses: actions/upload-artifact@v4
if: matrix.run_job
with:
name: build-linux-elixir-otp-${{ matrix.otp }}
path: elixir-otp-${{ matrix.otp }}.zip
- name: "Upload windows release artifacts"
uses: actions/upload-artifact@v4
if: matrix.run_job
with:
name: build-windows-elixir-otp-${{ matrix.otp }}
path: elixir-otp-${{ matrix.otp }}.exe
- name: "Upload doc artifacts"
uses: actions/upload-artifact@v4
if: matrix.run_job && matrix.build_docs
if: matrix.build_docs
with:
name: Docs
path: Docs.zip*
@@ -129,7 +120,7 @@ jobs:
strategy:
fail-fast: true
matrix:
otp: [25, 26, 27]
otp: [26, 27]
flavor: [windows, linux]
env:
@@ -139,15 +130,13 @@ jobs:
steps:
- name: "Download build"
id: download
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: build-${{ matrix.flavor }}-elixir-otp-${{ matrix.otp }}
- name: "Sign files with Trusted Signing"
uses: azure/trusted-signing-action@v0.5.0
if: github.repository == 'elixir-lang/elixir' && matrix.flavor == 'windows' && steps.download.outcome == 'success'
if: github.repository == 'elixir-lang/elixir' && matrix.flavor == 'windows'
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
@@ -164,19 +153,17 @@ jobs:
- name: "Attest release provenance"
id: attest-provenance
uses: actions/attest-build-provenance@v2
if: steps.download.outcome == 'success'
with:
subject-path: ${{ env.RELEASE_FILE }}
- name: "Copy release .zip provenance"
if: steps.download.outcome == 'success'
shell: bash
run: cp "$ATTESTATION" "${RELEASE_FILE}.sigstore"
env:
ATTESTATION: "${{ steps.attest-provenance.outputs.bundle-path }}"
- name: Create Release Hashes
if: matrix.flavor == 'windows' && steps.download.outcome == 'success'
if: matrix.flavor == 'windows'
shell: pwsh
run: |
$sha1 = Get-FileHash "$env:RELEASE_FILE" -Algorithm SHA1
@@ -186,7 +173,7 @@ jobs:
$sha256.Hash.ToLower() + " " + $env:RELEASE_FILE | Out-File "$env:RELEASE_FILE.sha256sum"
- name: Create Release Hashes
if: matrix.flavor == 'linux' && steps.download.outcome == 'success'
if: matrix.flavor == 'linux'
shell: bash
run: |
shasum -a 1 "$RELEASE_FILE" > "${RELEASE_FILE}.sha1sum"
@@ -194,7 +181,6 @@ jobs:
- name: "Upload linux release artifacts"
uses: actions/upload-artifact@v4
if: steps.download.outcome == 'success'
with:
name: sign-${{ matrix.flavor }}-elixir-otp-${{ matrix.otp }}
path: ${{ env.RELEASE_FILE }}*