π· Enable ARM builds and release on tag push #17
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: CI | |
on: | |
push: | |
branches: [ main ] | |
tags: [ 'v*' ] | |
pull_request: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ${{ matrix.runs-on }} | |
strategy: | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-musl | |
runs-on: ubuntu-24.04 | |
- target: aarch64-unknown-linux-musl | |
runs-on: ubuntu-24.04-arm | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- run: sudo apt-get install -y musl-tools | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo build --release --target ${{ matrix.target }} | |
env: | |
RUSTFLAGS: "-C target-feature=+crt-static" | |
- name: Rename binary with target architecture | |
run: | | |
mkdir -p dist | |
cp target/${{ matrix.target }}/release/acolyte dist/acolyte-${{ matrix.target }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: acolyte-${{ matrix.target }} | |
path: dist/acolyte-${{ matrix.target }} | |
lint-pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: akx/pre-commit-uv-action@v0.1.0 | |
lint-rust: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- run: cargo fmt --all -- --check | |
- run: cargo clippy --no-deps | |
test-rust: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo test | |
release: | |
needs: [ build, lint-pre-commit, lint-rust, test-rust ] | |
# if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download binaries | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: acolyte-* | |
path: dist | |
merge-multiple: true | |
- name: Prepare binaries for release | |
run: | | |
chmod +x dist/* | |
ls -la dist/ |