to handle musl systems #10
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: build Linux binaries | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo build | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/bin | |
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install cross | |
run: | | |
if ! [ -x "$(command -v cross)" ]; then | |
cargo install cross | |
fi | |
- name: Build x86_64-unknown-linux-gnu | |
run: cross build --target x86_64-unknown-linux-gnu --release | |
- name: Build aarch64-unknown-linux-gnu | |
run: cross build --target aarch64-unknown-linux-gnu --release | |
- name: Build aarch64-unknown-linux-musl | |
run: cross build --target aarch64-unknown-linux-musl --release | |
- name: Build armv7-unknown-linux-gnueabihf | |
run: cross build --target armv7-unknown-linux-gnueabihf --release | |
- name: Rename binaries | |
run: | | |
mkdir -p cicada-bins | |
for arch in $(ls target); do | |
if [[ -e "target/${arch}/release/cicada" ]]; then | |
cp target/${arch}/release/cicada cicada-bins/cicada-${arch} | |
fi | |
done | |
- name: Upload release binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cicada-builds | |
path: cicada-bins/ |