lowfi/.github/workflows/build.yml
2024-10-02 00:48:57 +02:00

82 lines
2.1 KiB
YAML

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: lowfi
name: lowfi-linux-x86_64
command: build
- release_for: Linux aarch64
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
bin: lowfi
name: lowfi-linux-aarch64
command: build
- release_for: Windows x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
bin: lowfi.exe
name: lowfi-windows-x86_64.exe
command: build
- release_for: MacOS x86_64
os: macos-latest
target: x86_64-apple-darwin
bin: lowfi
name: lowfi-darwin-x86_64
command: build
- release_for: MacOS aarch64
os: macos-latest
target: aarch64-apple-darwin
bin: lowfi
name: lowfi-darwin-aarch64
command: build
runs-on: ${{ matrix.os }}
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "true"
- name: Install dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt install -y libasound2-dev
echo "OPENSSL_DIR=$(openssl version -d)" >> $GITHUB_ENV
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: ${{ matrix.command }}
target: ${{ matrix.target }}
args: "--locked --release"
- name: Rename binary
run: |
cd ./target/${{ matrix.target }}/release
mv ${{ matrix.bin }} ${{ matrix.name }}
- name: Upload binary to release
shell: bash
run: |
gh release upload ${{github.event.release.tag_name}} \
./target/${{ matrix.target }}/release/${{ matrix.name }} \