| 1 |
name: binaries |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- main |
| 7 |
|
| 8 |
permissions: {} |
| 9 |
|
| 10 |
jobs: |
| 11 |
binaries: |
| 12 |
strategy: |
| 13 |
fail-fast: false |
| 14 |
|
| 15 |
matrix: |
| 16 |
build: [linux-x86_64-musl, linux-x86_64-gnu, linux-aarch64-musl, linux-aarch64-gnu, macos-x86_64, macos-aarch64, win-x86_64] |
| 17 |
include: |
| 18 |
- build: linux-x86_64-musl |
| 19 |
os: ubuntu-24.04 |
| 20 |
target: x86_64-unknown-linux-musl |
| 21 |
- build: linux-x86_64-gnu |
| 22 |
os: ubuntu-24.04 |
| 23 |
target: x86_64-unknown-linux-gnu |
| 24 |
- build: linux-aarch64-musl |
| 25 |
os: ubuntu-24.04-arm |
| 26 |
target: aarch64-unknown-linux-musl |
| 27 |
- build: linux-aarch64-gnu |
| 28 |
os: ubuntu-24.04-arm |
| 29 |
target: aarch64-unknown-linux-gnu |
| 30 |
- build: macos-x86_64 |
| 31 |
os: macos-15 |
| 32 |
target: x86_64-apple-darwin |
| 33 |
- build: macos-aarch64 |
| 34 |
os: macos-15 |
| 35 |
target: aarch64-apple-darwin |
| 36 |
- build: win-x86_64 |
| 37 |
os: windows-2022 |
| 38 |
target: x86_64-pc-windows-msvc |
| 39 |
- build: win-aarch64 |
| 40 |
os: windows-11-arm |
| 41 |
target: aarch64-pc-windows-msvc |
| 42 |
runs-on: ${{ matrix.os }} |
| 43 |
timeout-minutes: 20 # NOTE (aseipp): tests aren't run but sometimes builds take a while |
| 44 |
|
| 45 |
name: Build binary artifacts |
| 46 |
steps: |
| 47 |
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 48 |
with: |
| 49 |
persist-credentials: false |
| 50 |
- name: Install packages (Ubuntu) |
| 51 |
if: startsWith(matrix.os, 'ubuntu') |
| 52 |
run: | |
| 53 |
sudo apt-get update |
| 54 |
sudo apt-get install -y --no-install-recommends xz-utils liblz4-tool musl-tools |
| 55 |
- name: Install Rust |
| 56 |
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 |
| 57 |
with: |
| 58 |
toolchain: stable |
| 59 |
target: ${{ matrix.target }} |
| 60 |
- name: Build release binary |
| 61 |
shell: bash |
| 62 |
run: cargo build --target ${{ matrix.target }} --verbose --release |
| 63 |
|
| 64 |
- name: Set up artifact directory |
| 65 |
shell: bash |
| 66 |
run: | |
| 67 |
outdir="target/${{ matrix.target }}/release" |
| 68 |
BIN=$outdir/jj |
| 69 |
[[ "${{ matrix.os }}" == windows* ]] && BIN+=".exe" |
| 70 |
|
| 71 |
mkdir -p target/out |
| 72 |
cp $BIN target/out |
| 73 |
|
| 74 |
- name: Publish binary artifact |
| 75 |
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a |
| 76 |
with: |
| 77 |
name: jj-${{ matrix.target }} |
| 78 |
path: target/out |