lowfi/.github/workflows/build.yml

74 lines
1.9 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: 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 librust-alsa-sys-dev librust-curl+openssl-sys-dev
- 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 }} \