Merge pull request #1346 from Luni-4/reduce-binaries
Add profile release
This commit is contained in:
commit
387b2d0991
2 changed files with 21 additions and 27 deletions
38
.github/workflows/build.yml
vendored
38
.github/workflows/build.yml
vendored
|
|
@ -16,17 +16,13 @@ jobs:
|
||||||
export DEBIAN_FRONTED=noninteractive
|
export DEBIAN_FRONTED=noninteractive
|
||||||
sudo apt-get -qq update
|
sudo apt-get -qq update
|
||||||
sudo apt-get install -y libxkbcommon-dev
|
sudo apt-get install -y libxkbcommon-dev
|
||||||
- name: Enable Link Time Optimizations
|
|
||||||
run: |
|
|
||||||
echo "[profile.release]" >> Cargo.toml
|
|
||||||
echo "lto = true" >> Cargo.toml
|
|
||||||
- name: Build todos binary
|
- name: Build todos binary
|
||||||
run: cargo build --verbose --release --package todos
|
run: cargo build --verbose --profile release-opt --package todos
|
||||||
- name: Archive todos binary
|
- name: Archive todos binary
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: todos-x86_64-unknown-linux-gnu
|
name: todos-x86_64-unknown-linux-gnu
|
||||||
path: target/release/todos
|
path: target/release-opt/todos
|
||||||
- name: Pack todos .deb package
|
- name: Pack todos .deb package
|
||||||
run: cargo deb --no-build --package todos
|
run: cargo deb --no-build --package todos
|
||||||
- name: Rename todos .deb package
|
- name: Rename todos .deb package
|
||||||
|
|
@ -42,10 +38,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: hecrj/setup-rust-action@v1
|
- uses: hecrj/setup-rust-action@v1
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Enable Link Time Optimizations
|
|
||||||
run: |
|
|
||||||
echo "[profile.release]" >> Cargo.toml
|
|
||||||
echo "lto = true" >> Cargo.toml
|
|
||||||
- name: Enable static CRT linkage
|
- name: Enable static CRT linkage
|
||||||
run: |
|
run: |
|
||||||
mkdir .cargo
|
mkdir .cargo
|
||||||
|
|
@ -55,33 +47,29 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
sed -i '1 i\#![windows_subsystem = \"windows\"]' examples/todos/src/main.rs
|
sed -i '1 i\#![windows_subsystem = \"windows\"]' examples/todos/src/main.rs
|
||||||
- name: Build todos binary
|
- name: Build todos binary
|
||||||
run: cargo build --verbose --release --package todos
|
run: cargo build --verbose --profile release-opt --package todos
|
||||||
- name: Archive todos binary
|
- name: Archive todos binary
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: todos-x86_64-pc-windows-msvc
|
name: todos-x86_64-pc-windows-msvc
|
||||||
path: target/release/todos.exe
|
path: target/release-opt/todos.exe
|
||||||
|
|
||||||
todos_macos:
|
todos_macos:
|
||||||
runs-on: macOS-latest
|
runs-on: macOS-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: hecrj/setup-rust-action@v1
|
- uses: hecrj/setup-rust-action@v1
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Enable Link Time Optimizations
|
|
||||||
run: |
|
|
||||||
echo "[profile.release]" >> Cargo.toml
|
|
||||||
echo "lto = true" >> Cargo.toml
|
|
||||||
- name: Build todos binary
|
- name: Build todos binary
|
||||||
env:
|
env:
|
||||||
MACOSX_DEPLOYMENT_TARGET: 10.14
|
MACOSX_DEPLOYMENT_TARGET: 10.14
|
||||||
run: cargo build --verbose --release --package todos
|
run: cargo build --verbose --profile release-opt --package todos
|
||||||
- name: Open binary via double-click
|
- name: Open binary via double-click
|
||||||
run: chmod +x target/release/todos
|
run: chmod +x target/release-opt/todos
|
||||||
- name: Archive todos binary
|
- name: Archive todos binary
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: todos-x86_64-apple-darwin
|
name: todos-x86_64-apple-darwin
|
||||||
path: target/release/todos
|
path: target/release-opt/todos
|
||||||
|
|
||||||
todos_raspberry:
|
todos_raspberry:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -90,21 +78,17 @@ jobs:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Install cross
|
- name: Install cross
|
||||||
run: cargo install cross
|
run: cargo install cross
|
||||||
- name: Enable Link Time Optimizations
|
|
||||||
run: |
|
|
||||||
echo "[profile.release]" >> Cargo.toml
|
|
||||||
echo "lto = true" >> Cargo.toml
|
|
||||||
- name: Build todos binary for Raspberry Pi 3/4 (64 bits)
|
- name: Build todos binary for Raspberry Pi 3/4 (64 bits)
|
||||||
run: cross build --verbose --release --package todos --target aarch64-unknown-linux-gnu
|
run: cross build --verbose --profile release-opt --package todos --target aarch64-unknown-linux-gnu
|
||||||
- name: Archive todos binary
|
- name: Archive todos binary
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: todos-aarch64-unknown-linux-gnu
|
name: todos-aarch64-unknown-linux-gnu
|
||||||
path: target/aarch64-unknown-linux-gnu/release/todos
|
path: target/aarch64-unknown-linux-gnu/release-opt/todos
|
||||||
- name: Build todos binary for Raspberry Pi 2/3/4 (32 bits)
|
- name: Build todos binary for Raspberry Pi 2/3/4 (32 bits)
|
||||||
run: cross build --verbose --release --package todos --target armv7-unknown-linux-gnueabihf
|
run: cross build --verbose --profile release-opt --package todos --target armv7-unknown-linux-gnueabihf
|
||||||
- name: Archive todos binary
|
- name: Archive todos binary
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: todos-armv7-unknown-linux-gnueabihf
|
name: todos-armv7-unknown-linux-gnueabihf
|
||||||
path: target/armv7-unknown-linux-gnueabihf/release/todos
|
path: target/armv7-unknown-linux-gnueabihf/release-opt/todos
|
||||||
|
|
|
||||||
10
Cargo.toml
10
Cargo.toml
|
|
@ -121,3 +121,13 @@ iced_wgpu = { version = "0.5", path = "wgpu", features = ["webgl"], optional = t
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
features = ["image", "svg", "canvas", "qr_code", "pure"]
|
features = ["image", "svg", "canvas", "qr_code", "pure"]
|
||||||
|
|
||||||
|
[profile.release-opt]
|
||||||
|
inherits = "release"
|
||||||
|
codegen-units = 1
|
||||||
|
debug = false
|
||||||
|
lto = true
|
||||||
|
incremental = false
|
||||||
|
opt-level = 3
|
||||||
|
overflow-checks = false
|
||||||
|
strip = "debuginfo"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue