Skip to content

Add releases for main & maintenance branches #13829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 16, 2024
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
46 changes: 37 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Release

on:
push:
branches:
- main
- v*.*
tags:
- v*

Expand All @@ -22,13 +25,33 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Create draft release
if: github.ref_type != 'branch'
run: |
gh release create \
--repo ${{ github.repository }} \
--title ${{ github.ref_name }} \
--notes '' \
--draft \
${{ github.ref_name }}

- uses: actions/checkout@v4
if: github.ref_type == 'branch'
with:
fetch-depth: 50

- name: Update ${{ github.ref_name }}-latest
if: github.ref_type == 'branch'
run: |
ref_name=${{ github.ref_name }}-latest
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't ignore this step, right? The prebuilt step requires the release to be presented.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this particular gh release create will succeed only ever once per branch so I thought it's OK to ignore errors. I could make it more explicit or at least add a comment though.


release_pre_built:
needs: create_draft_release
strategy:
Expand Down Expand Up @@ -65,6 +88,7 @@ jobs:
subject-path: 'Docs.*'

- name: "Sign files with Trusted Signing"
if: github.repository == 'elixir-lang/elixir'
uses: azure/[email protected]
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
Expand All @@ -83,16 +107,20 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload --clobber "${{ github.ref_name }}" \
if [ "${{ github.ref_type }}" == "branch" ]; then
tag=${{ github.ref_name }}-latest
else
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
- name: Upload Docs to GitHub
if: ${{ matrix.build_docs }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload --clobber "${{ github.ref_name }}" \
Docs.zip \
Docs.zip.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
Loading