-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
gregnuj
committed
May 16, 2023
1 parent
8e882b7
commit 3f19574
Showing
3 changed files
with
123 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]' # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5 | ||
- 'v[0-9]+.[0-9]+.[0-9]+-classic' | ||
|
||
jobs: | ||
release: | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create release for ${{github.ref_name}} | ||
run: gh release create ${{github.ref_name}} --prerelease --generate-notes --repo ${{github.repository}} | ||
|
||
artifacts: | ||
if: startsWith(github.ref, 'refs/tags/') | ||
needs: release | ||
runs-on: ubuntu-latest | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
strategy: | ||
matrix: | ||
build_type: ['build-release-arm64', 'build-release-amd64'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set version tag | ||
run: echo "VERSION=$(echo ${{github.ref_name}} | sed 's/^v//')" >> $GITHUB_ENV | ||
- name: Create build directory | ||
run: mkdir -p build/release | ||
- name: Build ${{matrix.build_type}} | ||
run: make ${{matrix.build_type}} | ||
- name: Upload the artifacts to release | ||
run: gh release upload ${{github.ref_name}} ./build/release/* | ||
|
||
calculate-checksums: | ||
needs: artifacts | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create build directory | ||
run: mkdir -p build/release | ||
- name: Download artifacts | ||
run: gh release download ${{github.ref_name}} --pattern '*.tar.gz' --dir build/release --repo ${{github.repository}} | ||
- name: Create checksums | ||
run: | | ||
cd build/release | ||
sha256sum *.tar.gz > checksum.txt | ||
- name: Display checksums | ||
run: cat build/release/checksum.txt | ||
- name: Upload the checksum to release | ||
run: gh release upload ${{github.ref_name}} build/release/checksum.txt --repo ${{github.repository}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters