Compress binary

This commit is contained in:
Adrian Woźniak 2021-07-29 11:40:30 +02:00
parent 41571459d6
commit 01aa49f761
No known key found for this signature in database
GPG Key ID: DE43476F72AD3F6C
5 changed files with 13 additions and 1 deletions

View File

@ -1,2 +1,7 @@
[build] [build]
target = "x86_64-unknown-linux-musl" target = "x86_64-unknown-linux-musl"
[profile.release]
lto = true
panic = "abort"
codegen-units = 1

View File

@ -23,8 +23,10 @@ jobs:
run: rustup target install x86_64-unknown-linux-musl run: rustup target install x86_64-unknown-linux-musl
- name: Run tests - name: Run tests
run: cargo test --verbose run: cargo test --verbose
- name: Install binary compressor
run: apt-get update && apt-get install upx-ucl
- name: Build - name: Build
run: cargo build --release --verbose --target=x86_64-unknown-linux-musl run: cargo build --release --verbose --target=x86_64-unknown-linux-musl && strip ./target/x86_64-unknown-linux-musl/release/amdfand && upx --best --lzma target/x86_64-unknown-linux-musl/release/amdfand
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v2.2.4
with: with:

5
build.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env zsh
cargo build --release
strip target/x86_64-unknown-linux-musl/release/amdfand
upx --best --lzma target/x86_64-unknown-linux-musl/release/amdfand