Rust Cross Compile Binary Release #20
Workflow file for this run
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
name: Rust Cross Compile Binary Release | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
build-linux: | |
name: Build and Release for Linux | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- i686-unknown-linux-gnu | |
- aarch64-unknown-linux-gnu | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install cross | |
run: | | |
sudo apt-get install -y qemu-user | |
cargo install cross | |
- name: Build | |
run: | | |
rustup target add ${{ matrix.target }} | |
cross build --target ${{ matrix.target }} --release | |
mkdir -p ./artifacts | |
mv ./target/${{ matrix.target }}/release/stimmgabel ./artifacts/stimmgabel-${{ matrix.target }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: stimmgabel-${{ matrix.target }} | |
path: ./artifacts/stimmgabel-${{ matrix.target }} | |
build-windows: | |
name: Build and Release for Windows | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
target: | |
- x86_64-pc-windows-gnu | |
- aarch64-pc-windows-msvc | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
run: | | |
choco install rustup.install | |
rustup install stable | |
rustup update stable | |
rustup default stable | |
rustup target add ${{ matrix.target }} | |
- name: Build | |
run: | | |
cargo build --target ${{ matrix.target }} --release | |
mkdir .\artifacts | |
move .\target\${{ matrix.target }}\release\stimmgabel.exe .\artifacts\stimmgabel-${{ matrix.target }}.exe | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: stimmgabel-${{ matrix.target }}.exe | |
path: .\artifacts\stimmgabel-${{ matrix.target }}.exe | |
build-macos: | |
name: Build and Release for MacOS | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
target: | |
- aarch64-apple-darwin | |
- x86_64-apple-darwin | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
rustup target add ${{ matrix.target }} | |
cargo build --target ${{ matrix.target }} --release | |
mkdir -p ./artifacts | |
mv ./target/${{ matrix.target }}/release/stimmgabel ./artifacts/stimmgabel-${{ matrix.target }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: stimmgabel-${{ matrix.target }} | |
path: ./artifacts/stimmgabel-${{ matrix.target }} | |
release: | |
name: Release | |
needs: [build-linux, build-macos, build-windows] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./artifacts/ | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "artifacts/*" |