Skip to content

Commit 3473a52

Browse files
committed
chore: Adds Github workflow for building executables
1 parent 7928931 commit 3473a52

File tree

2 files changed

+59
-33
lines changed

2 files changed

+59
-33
lines changed

.github/workflows/build.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build and Upload Executables
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
build:
12+
name: Build for ${{ matrix.target }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
include:
17+
- target: x86_64-unknown-linux-musl
18+
os: ubuntu-latest
19+
artifact_suffix: ""
20+
- target: aarch64-unknown-linux-musl
21+
os: ubuntu-latest
22+
artifact_suffix: ""
23+
- target: aarch64-apple-darwin
24+
os: macos-latest
25+
artifact_suffix: ""
26+
- target: x86_64-pc-windows-msvc
27+
os: windows-latest
28+
artifact_suffix: ".exe"
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
- name: Install Rust toolchain
35+
uses: dtolnay/rust-toolchain@stable
36+
with:
37+
targets: ${{ matrix.target }}
38+
39+
- name: Install dependencies for Linux builds
40+
if: matrix.os == 'ubuntu-latest'
41+
run: |
42+
sudo apt-get update -y
43+
sudo apt-get install -y musl-tools
44+
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-musl" ]; then
45+
sudo apt-get install -y gcc-aarch64-linux-gnu
46+
fi
47+
48+
- name: Build executable
49+
run: cargo build --release --target ${{ matrix.target }}
50+
working-directory: ./faucet
51+
env:
52+
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER: musl-gcc
53+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-gnu-gcc
54+
55+
- name: Upload executable
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: faucet-${{ matrix.target }}
59+
path: faucet/target/${{ matrix.target }}/release/faucet${{ matrix.artifact_suffix }}

cross.sh

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)