-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
f08c987
commit e25e3ad
Showing
1 changed file
with
77 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Release Build | ||
on: | ||
release: | ||
types: [created] | ||
jobs: | ||
release: | ||
name: Release - ${{ matrix.release_for }} | ||
permissions: | ||
contents: write | ||
strategy: | ||
matrix: | ||
include: | ||
- release_for: Linux-x86_64 | ||
os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
bin: dec2bin | ||
name: dec2bin-Linux-x86_64.tar.gz | ||
command: build | ||
- release_for: Linux-aarch64 | ||
os: ubuntu-latest | ||
target: aarch64-unknown-linux-gnu | ||
bin: dec2bin | ||
name: dec2bin-Linux-aarch64.tar.gz | ||
command: build | ||
- release_for: Windows-x86_64 | ||
os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
bin: dec2bin.exe | ||
name: dec2bin-Windows-x86_64.zip | ||
command: build | ||
- release_for: macOS-x86_64 | ||
os: macOS-latest | ||
target: x86_64-apple-darwin | ||
bin: dec2bin | ||
name: dec2bin-macOS-x86_64.tar.gz | ||
command: build | ||
- release_for: macOS-aarch64 | ||
os: macOS-latest | ||
target: aarch64-apple-darwin | ||
bin: dec2bin | ||
name: dec2bin-macOS-aarch64.tar.gz | ||
command: build | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- name: Build binary | ||
uses: houseabsolute/actions-rust-cross@v0 | ||
with: | ||
command: ${{ matrix.command }} | ||
target: ${{ matrix.target }} | ||
args: "--locked --release" | ||
- name: Package as archive | ||
shell: bash | ||
run: | | ||
cd ./target/${{ matrix.target }}/release | ||
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then | ||
7z a ${{ matrix.name }} ${{ matrix.bin }} | ||
else | ||
tar czvf ${{ matrix.name }} ${{ matrix.bin }} | ||
fi | ||
cd - | ||
- name: Generate SHA-256 checksum file | ||
run: | | ||
cd ./target/${{ matrix.target }}/release | ||
shasum -a 256 ${{ matrix.name }} > ${{ matrix.name }}.sha256 | ||
cd - | ||
- name: Upload assets to release | ||
shell: bash | ||
run: | | ||
gh release upload ${{github.event.release.tag_name}} \ | ||
./target/${{ matrix.target }}/release/${{ matrix.name }} \ | ||
./target/${{ matrix.target }}/release/${{ matrix.name }}.sha256 |