Skip to content
Merged
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
65 changes: 47 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,19 @@ jobs:
if: github.ref_type == 'branch'
run: |
ref_name=${{ github.ref_name }}-latest

if ! gh release view $ref_name; then
gh release create \
--latest=false \
--title $ref_name \
--notes "Automated release for latest ${{ github.ref_name }}." \
$ref_name
fi

git tag $ref_name --force
git push origin $ref_name --force
gh release create \
$ref_name \
—-latest=false \
--title $ref_name \
--notes "Automated release for latest ${{ github.ref_name }}." \
|| true

release_pre_built:
build:
needs: create_draft_release
strategy:
fail-fast: true
Expand All @@ -70,23 +73,49 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 50

- uses: ./.github/workflows/release_pre_built
with:
otp_version: ${{ matrix.otp_version }}
otp: ${{ matrix.otp }}
build_docs: ${{ matrix.build_docs }}

- uses: actions/attest-build-provenance@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
subject-path: 'elixir-otp-${{ matrix.otp }}.*'

- uses: actions/attest-build-provenance@v1
if: ${{ matrix.build_docs }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
subject-path: 'Docs.*'

- uses: actions/upload-artifact@v4
with:
name: elixir-otp-${{ matrix.otp }}
path: elixir-otp-${{ matrix.otp }}*

- uses: actions/upload-artifact@v4
if: ${{ matrix.build_docs }}
with:
name: Docs
path: Docs.zip*

upload:
needs: build
runs-on: windows-2022

steps:
- uses: actions/download-artifact@v4

- run: |
mv elixir-otp-*/* .
mv Docs/* .
shell: bash

- name: "Sign files with Trusted Signing"
if: github.repository == 'elixir-lang/elixir'
uses: azure/[email protected]
Expand All @@ -104,6 +133,7 @@ jobs:
timestamp-digest: SHA256

- name: Upload Pre-built
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -113,14 +143,13 @@ jobs:
tag="${{ github.ref_name }}"
fi

gh release upload --clobber "$tag" \
elixir-otp-${{ matrix.otp }}.zip \
elixir-otp-${{ matrix.otp }}.zip.sha{1,256}sum \
elixir-otp-${{ matrix.otp }}.exe \
elixir-otp-${{ matrix.otp }}.exe.sha{1,256}sum

if [ "${{ matrix.build_docs }}" == "build_docs" ]; then
gh release upload --clobber "$tag" \
Docs.zip \
Docs.zip.sha{1,256}sum
fi
gh release upload \
--repo ${{ github.repository }} \
--clobber \
"$tag" \
elixir-otp-*.zip \
elixir-otp-*.zip.sha{1,256}sum \
elixir-otp-*.exe \
elixir-otp-*.exe.sha{1,256}sum \
Docs.zip \
Docs.zip.sha{1,256}sum
Loading