Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -58,26 +63,25 @@ 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
matrix:
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
Expand All @@ -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 }}
Expand All @@ -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:
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -172,17 +178,15 @@ 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 }}
path: ${{ env.RELEASE_FILE }}*

sbom:
name: Generate SBoM

needs: [build, sign]

runs-on: ubuntu-24.04

permissions:
Expand Down Expand Up @@ -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

Expand All @@ -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 }}
Expand All @@ -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 }}"
Expand Down Expand Up @@ -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 }}
Expand Down