Skip to content

Commit c087763

Browse files
committed
init GitHub Actions workflow for building binaries across multiple targets
1 parent dadd288 commit c087763

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/build-binaries.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
name: Build Binaries
22

3+
on:
4+
push:
5+
branches: [ gh-actions ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.target }}
12+
strategy:
13+
matrix:
14+
target:
15+
- x86_64-unknown-linux-gnu
16+
- aarch64-apple-darwin
17+
- x86_64-pc-windows-msvc
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Install Rust toolchain
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: stable
24+
target: ${{ matrix.target }}
25+
override: true
26+
- name: Install build dependencies
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y build-essential pkg-config libssl-dev
30+
if: matrix.target == 'x86_64-unknown-linux-gnu'
31+
- name: Build for ${{ matrix.target }}
32+
run: cargo build --release --target ${{ matrix.target }}
33+
- name: Upload artifacts
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: binaries-${{ matrix.target }}
37+
path: target/${{ matrix.target }}/release/
38+
39+
name: Build Binaries
40+
341
on:
442
push:
543
branches:

0 commit comments

Comments
 (0)