ci(build): actions/checkout v3 -> v4 #54
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 Commit | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- src/** | |
- Cargo.toml | |
- Cargo.lock | |
- .github/workflows/build.yml | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
release: | |
name: Build Commit - ${{ matrix.platform.release_for }} | |
strategy: | |
matrix: | |
platform: | |
- release_for: FreeBSD-x86_64 | |
os: ubuntu-20.04 | |
target: x86_64-unknown-freebsd | |
bin: red_oxide | |
name: red_oxide-FreeBSD-x86_64 | |
command: build | |
- release_for: Linux-x86_64-gnu | |
os: ubuntu-20.04 | |
target: x86_64-unknown-linux-gnu | |
bin: red_oxide | |
name: red_oxide-Linux-x86_64-gnu | |
command: build | |
- release_for: Linux-x86_64-musl | |
os: ubuntu-20.04 | |
target: x86_64-unknown-linux-musl | |
bin: red_oxide | |
name: red_oxide-Linux-x86_64-musl | |
command: build | |
- release_for: Linux-i686 | |
os: ubuntu-20.04 | |
target: i686-unknown-linux-gnu | |
bin: red_oxide | |
name: red_oxide-Linux-i686 | |
command: build | |
- release_for: Linux-aarch64 | |
os: ubuntu-20.04 | |
target: aarch64-unknown-linux-gnu | |
bin: red_oxide | |
name: red_oxide-Linux-aarch64 | |
command: build | |
- release_for: Linux-armv7 | |
os: ubuntu-20.04 | |
target: armv7-unknown-linux-gnueabihf | |
bin: red_oxide | |
name: red_oxide-Linux-armv7 | |
command: build | |
- release_for: Windows-x86_64 | |
os: windows-latest | |
target: x86_64-pc-windows-msvc | |
bin: red_oxide.exe | |
name: red_oxide-Windows-x86_64.exe | |
command: build | |
- release_for: Windows-i686 | |
os: windows-latest | |
target: i686-pc-windows-msvc | |
bin: red_oxide.exe | |
name: red_oxide-Windows-i686.exe | |
command: build | |
- release_for: macOS-x86_64 | |
os: macOS-latest | |
target: x86_64-apple-darwin | |
bin: red_oxide | |
name: red_oxide-Darwin-x86_64 | |
command: build | |
- release_for: macOS-aarch64 | |
os: macOS-latest | |
target: aarch64-apple-darwin | |
bin: red_oxide | |
name: red_oxide-Darwin-aarch64 | |
command: build | |
runs-on: ${{ matrix.platform.os }} | |
steps: | |
- name: Checkout Source code | |
uses: actions/checkout@v4 | |
- name: Cache cargo & target directories | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.platform.release_for }} | |
- name: Install musl-tools on Linux | |
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools | |
if: contains(matrix.platform.name, 'musl') | |
- name: Build binary | |
uses: houseabsolute/actions-rust-cross@v0 | |
with: | |
command: ${{ matrix.platform.command }} | |
target: ${{ matrix.platform.target }} | |
args: "--locked --release" | |
strip: true | |
- name: Upload Action Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.platform.name }} | |
path: target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} |