Skip to content

Commit

Permalink
chore: Build release optimized for size instead of speed
Browse files Browse the repository at this point in the history
  • Loading branch information
quodlibetor committed Aug 2, 2024
1 parent 6103b45 commit be570d7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,7 @@ jobs:
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
- name: Build release binary
run: ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }}

- name: Strip release binary (linux and macos)
if: matrix.build == 'linux' || matrix.build == 'macos' || matrix.build == 'arm-macos'
run: |
strip "target/${{ matrix.target }}/release/fwd"
strip "target/${{ matrix.target }}/release/fwd-browse"
run: ${{ env.CARGO }} build --verbose --profile small ${{ env.TARGET_FLAGS }}

- name: Build archive
shell: bash
Expand Down
17 changes: 16 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ name = "fwd-browse"
test = false
bench = false

[profile.small]
inherits = "release"
strip = "debuginfo"
opt-level = "s"
lto = true

[dependencies]
anyhow = "1.0"
bollard = "0.17.0"
Expand All @@ -26,7 +32,16 @@ log = { version = "0.4", features = ["std"] }
open = "3"
rand = "0.8.5"
thiserror = "1.0"
tokio = { version = "1", features = ["io-std", "io-util", "macros", "net", "process", "rt", "rt-multi-thread", "fs"] }
tokio = { version = "1", features = [
"io-std",
"io-util",
"macros",
"net",
"process",
"rt",
"rt-multi-thread",
"fs",
] }
tokio-stream = "0.1"
toml = "0.5"
tui = "0.19"
Expand Down

0 comments on commit be570d7

Please sign in to comment.