From 667e9c1c834b7001a01f8b2962cb3b8c72128d29 Mon Sep 17 00:00:00 2001 From: Eksperimental Date: Sat, 29 Nov 2025 22:25:09 -0500 Subject: [PATCH] CI: Minor improvements to release.yml --- .github/workflows/release.yml | 39 +++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc4ed50a39..59c1aa8035 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,16 +1,19 @@ # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: 2021 The Elixir Team -name: Release +name: Releases on: push: branches: - main - v*.* + tags: - v* + workflow_dispatch: + env: ELIXIR_OPTS: "--warnings-as-errors" LANG: C.UTF-8 @@ -20,11 +23,15 @@ permissions: jobs: create_draft_release: + name: Create draft release runs-on: ubuntu-24.04 + permissions: contents: write + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: - name: Create draft release if: github.ref_type != 'branch' @@ -38,8 +45,6 @@ jobs: - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 if: github.ref_type == 'branch' - with: - fetch-depth: 50 - name: Update ${{ github.ref_name }}-latest if: github.ref_type == 'branch' @@ -58,7 +63,8 @@ jobs: git push origin $ref_name --force build: - name: "Build Elixir" + name: Ubuntu 24.04, OTP ${{ matrix.otp_version }}${{ matrix.build_docs && ' (build docs)' || '' }} + runs-on: ubuntu-24.04 strategy: fail-fast: true @@ -66,18 +72,16 @@ jobs: include: - otp: 26 otp_version: "26.0" + - otp: 27 otp_version: "27.0" + - otp: 28 otp_version: "28.0" build_docs: build_docs - runs-on: ubuntu-24.04 - steps: - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 - with: - fetch-depth: 50 - name: "Build Release" uses: ./.github/workflows/release_pre_built @@ -92,13 +96,13 @@ jobs: shasum -a 1 Docs.zip > Docs.zip.sha1sum shasum -a 256 Docs.zip > Docs.zip.sha256sum - - name: "Upload linux release artifacts" + - name: "Upload Linux release artifacts" uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: build-linux-elixir-otp-${{ matrix.otp }} path: elixir-otp-${{ matrix.otp }}.zip - - name: "Upload windows release artifacts" + - name: "Upload Windows release artifacts" uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: build-windows-elixir-otp-${{ matrix.otp }} @@ -112,6 +116,7 @@ jobs: path: Docs.zip* sign: + name: Sign files, ${{ matrix.flavor == 'windows' && 'Windows' || matrix.flavor == 'linux' && 'Linux' || matrix.flavor }}, OTP ${{ matrix.otp }} needs: [build] environment: release strategy: @@ -142,6 +147,7 @@ jobs: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + - name: "Sign files with Trusted Signing" uses: azure/trusted-signing-action@fc390cf8ed0f14e248a542af1d838388a47c7a7c # v0.5.10 if: ${{ matrix.flavor == 'windows' && vars.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }} @@ -172,7 +178,7 @@ jobs: shasum -a 1 "$RELEASE_FILE" > "${RELEASE_FILE}.sha1sum" shasum -a 256 "$RELEASE_FILE" > "${RELEASE_FILE}.sha256sum" - - name: "Upload linux release artifacts" + - name: "Upload Linux release artifacts" uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: sign-${{ matrix.flavor }}-elixir-otp-${{ matrix.otp }} @@ -180,9 +186,7 @@ jobs: sbom: name: Generate SBoM - needs: [build, sign] - runs-on: ubuntu-24.04 permissions: @@ -261,6 +265,7 @@ jobs: path: "attestations/*.sigstore" upload-release: + name: Upload release needs: [create_draft_release, build, sign, sbom] runs-on: ubuntu-24.04 @@ -273,7 +278,7 @@ jobs: pattern: "{sign-*-elixir-otp-*,Docs,SBoM,Attestations}" merge-multiple: true - - name: Upload Pre-built + - name: Upload Pre-build shell: bash env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -300,15 +305,18 @@ jobs: bom.* upload-builds-hex-pm: - needs: [build, sign] + name: Upload builds to hex.pm runs-on: ubuntu-24.04 + needs: [build, sign] concurrency: builds-hex-pm environment: release + env: AWS_ACCESS_KEY_ID: ${{ secrets.HEX_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.HEX_AWS_SECRET_ACCESS_KEY }} AWS_REGION: ${{ vars.HEX_AWS_REGION }} AWS_S3_BUCKET: ${{ vars.HEX_AWS_S3_BUCKET }} + steps: - name: "Check if variables are set up" if: "${{ ! vars.HEX_AWS_REGION }}" @@ -424,6 +432,7 @@ jobs: for key in $(cat purge_keys.txt); do purge "${key}" done + env: FASTLY_REPO_SERVICE_ID: ${{ secrets.HEX_FASTLY_REPO_SERVICE_ID }} FASTLY_BUILDS_SERVICE_ID: ${{ secrets.HEX_FASTLY_BUILDS_SERVICE_ID }}