Skip to content

Commit e0ae20a

Browse files
ci: switch to musl target for linux to produce fully static binaries
1 parent 577d91c commit e0ae20a

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,32 @@ jobs:
1616
matrix:
1717
include:
1818
- os: ubuntu-latest
19+
target: x86_64-unknown-linux-musl
1920
asset_name: fbqueue-linux-x64.tar.gz
2021
example_dir: linux
2122
- os: windows-latest
23+
target: x86_64-pc-windows-msvc
2224
asset_name: fbqueue-windows-x64.zip
2325
example_dir: windows
2426

2527
steps:
2628
- uses: actions/checkout@v4
2729

2830
- name: Install Rust
29-
run: rustup update stable
31+
run: rustup update stable && rustup target add ${{ matrix.target }}
32+
33+
- name: Install MUSL (Linux only)
34+
if: runner.os == 'Linux'
35+
run: sudo apt-get install -y musl-tools
3036

3137
- name: Build
32-
run: cargo build --release
38+
run: cargo build --release --target ${{ matrix.target }}
3339

3440
- name: Package (Linux)
3541
if: runner.os == 'Linux'
3642
run: |
3743
mkdir dist
38-
cp target/release/fbqueue .
44+
cp target/${{ matrix.target }}/release/fbqueue .
3945
tar -czvf dist/${{ matrix.asset_name }} \
4046
fbqueue \
4147
README.md \
@@ -47,7 +53,7 @@ jobs:
4753
shell: pwsh
4854
run: |
4955
New-Item -ItemType Directory -Path dist
50-
Copy-Item "target\release\fbqueue.exe" .
56+
Copy-Item "target\${{ matrix.target }}\release\fbqueue.exe" .
5157
Compress-Archive -Path "fbqueue.exe", "README.md", "MANUAL.md", "examples\windows" -DestinationPath "dist\${{ matrix.asset_name }}"
5258
5359
- name: Upload Release Asset

0 commit comments

Comments
 (0)