Skip to content

Commit 667e9c1

Browse files
committed
CI: Minor improvements to release.yml
1 parent e2c4c07 commit 667e9c1

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# SPDX-FileCopyrightText: 2021 The Elixir Team
33

4-
name: Release
4+
name: Releases
55

66
on:
77
push:
88
branches:
99
- main
1010
- v*.*
11+
1112
tags:
1213
- v*
1314

15+
workflow_dispatch:
16+
1417
env:
1518
ELIXIR_OPTS: "--warnings-as-errors"
1619
LANG: C.UTF-8
@@ -20,11 +23,15 @@ permissions:
2023

2124
jobs:
2225
create_draft_release:
26+
name: Create draft release
2327
runs-on: ubuntu-24.04
28+
2429
permissions:
2530
contents: write
31+
2632
env:
2733
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
2835
steps:
2936
- name: Create draft release
3037
if: github.ref_type != 'branch'
@@ -38,8 +45,6 @@ jobs:
3845
3946
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
4047
if: github.ref_type == 'branch'
41-
with:
42-
fetch-depth: 50
4348

4449
- name: Update ${{ github.ref_name }}-latest
4550
if: github.ref_type == 'branch'
@@ -58,26 +63,25 @@ jobs:
5863
git push origin $ref_name --force
5964
6065
build:
61-
name: "Build Elixir"
66+
name: Ubuntu 24.04, OTP ${{ matrix.otp_version }}${{ matrix.build_docs && ' (build docs)' || '' }}
67+
runs-on: ubuntu-24.04
6268

6369
strategy:
6470
fail-fast: true
6571
matrix:
6672
include:
6773
- otp: 26
6874
otp_version: "26.0"
75+
6976
- otp: 27
7077
otp_version: "27.0"
78+
7179
- otp: 28
7280
otp_version: "28.0"
7381
build_docs: build_docs
7482

75-
runs-on: ubuntu-24.04
76-
7783
steps:
7884
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
79-
with:
80-
fetch-depth: 50
8185

8286
- name: "Build Release"
8387
uses: ./.github/workflows/release_pre_built
@@ -92,13 +96,13 @@ jobs:
9296
shasum -a 1 Docs.zip > Docs.zip.sha1sum
9397
shasum -a 256 Docs.zip > Docs.zip.sha256sum
9498
95-
- name: "Upload linux release artifacts"
99+
- name: "Upload Linux release artifacts"
96100
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
97101
with:
98102
name: build-linux-elixir-otp-${{ matrix.otp }}
99103
path: elixir-otp-${{ matrix.otp }}.zip
100104

101-
- name: "Upload windows release artifacts"
105+
- name: "Upload Windows release artifacts"
102106
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
103107
with:
104108
name: build-windows-elixir-otp-${{ matrix.otp }}
@@ -112,6 +116,7 @@ jobs:
112116
path: Docs.zip*
113117

114118
sign:
119+
name: Sign files, ${{ matrix.flavor == 'windows' && 'Windows' || matrix.flavor == 'linux' && 'Linux' || matrix.flavor }}, OTP ${{ matrix.otp }}
115120
needs: [build]
116121
environment: release
117122
strategy:
@@ -142,6 +147,7 @@ jobs:
142147
client-id: ${{ secrets.AZURE_CLIENT_ID }}
143148
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
144149
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
150+
145151
- name: "Sign files with Trusted Signing"
146152
uses: azure/trusted-signing-action@fc390cf8ed0f14e248a542af1d838388a47c7a7c # v0.5.10
147153
if: ${{ matrix.flavor == 'windows' && vars.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
@@ -172,17 +178,15 @@ jobs:
172178
shasum -a 1 "$RELEASE_FILE" > "${RELEASE_FILE}.sha1sum"
173179
shasum -a 256 "$RELEASE_FILE" > "${RELEASE_FILE}.sha256sum"
174180
175-
- name: "Upload linux release artifacts"
181+
- name: "Upload Linux release artifacts"
176182
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
177183
with:
178184
name: sign-${{ matrix.flavor }}-elixir-otp-${{ matrix.otp }}
179185
path: ${{ env.RELEASE_FILE }}*
180186

181187
sbom:
182188
name: Generate SBoM
183-
184189
needs: [build, sign]
185-
186190
runs-on: ubuntu-24.04
187191

188192
permissions:
@@ -261,6 +265,7 @@ jobs:
261265
path: "attestations/*.sigstore"
262266

263267
upload-release:
268+
name: Upload release
264269
needs: [create_draft_release, build, sign, sbom]
265270
runs-on: ubuntu-24.04
266271

@@ -273,7 +278,7 @@ jobs:
273278
pattern: "{sign-*-elixir-otp-*,Docs,SBoM,Attestations}"
274279
merge-multiple: true
275280

276-
- name: Upload Pre-built
281+
- name: Upload Pre-build
277282
shell: bash
278283
env:
279284
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -300,15 +305,18 @@ jobs:
300305
bom.*
301306
302307
upload-builds-hex-pm:
303-
needs: [build, sign]
308+
name: Upload builds to hex.pm
304309
runs-on: ubuntu-24.04
310+
needs: [build, sign]
305311
concurrency: builds-hex-pm
306312
environment: release
313+
307314
env:
308315
AWS_ACCESS_KEY_ID: ${{ secrets.HEX_AWS_ACCESS_KEY_ID }}
309316
AWS_SECRET_ACCESS_KEY: ${{ secrets.HEX_AWS_SECRET_ACCESS_KEY }}
310317
AWS_REGION: ${{ vars.HEX_AWS_REGION }}
311318
AWS_S3_BUCKET: ${{ vars.HEX_AWS_S3_BUCKET }}
319+
312320
steps:
313321
- name: "Check if variables are set up"
314322
if: "${{ ! vars.HEX_AWS_REGION }}"
@@ -424,6 +432,7 @@ jobs:
424432
for key in $(cat purge_keys.txt); do
425433
purge "${key}"
426434
done
435+
427436
env:
428437
FASTLY_REPO_SERVICE_ID: ${{ secrets.HEX_FASTLY_REPO_SERVICE_ID }}
429438
FASTLY_BUILDS_SERVICE_ID: ${{ secrets.HEX_FASTLY_BUILDS_SERVICE_ID }}

0 commit comments

Comments
 (0)