Skip to content

chore: Reduce binary sizes in desktop releases #19727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/release_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:

env:
PACKAGE_FILE: ${{ needs.create-nightly-release.outputs.package_prefix }}-${{ matrix.build_name }}.${{ startsWith(matrix.build_name, 'win') && 'zip' || 'tar.gz' }}
CARGO_BUILD_DIR: target/${{ matrix.target }}/release
CARGO_BUILD_DIR: target/${{ matrix.target }}/release-small

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -127,7 +127,7 @@ jobs:
if: runner.os == 'Windows'

- name: Cargo build
run: cargo build --locked --package ruffle_desktop --release ${{matrix.DESKTOP_FEATURES && '--features' }} ${{matrix.DESKTOP_FEATURES}} ${{ matrix.target && '--target' }} ${{ matrix.target }}
run: cargo build --locked --package ruffle_desktop --profile release-small ${{matrix.DESKTOP_FEATURES && '--features' }} ${{matrix.DESKTOP_FEATURES}} ${{ matrix.target && '--target' }} ${{ matrix.target }}
env:
RUSTFLAGS: ${{ matrix.RUSTFLAGS }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.MACOSX_DEPLOYMENT_TARGET }}
Expand All @@ -144,7 +144,7 @@ jobs:
wix build ruffle.wxs -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -arch ${{ matrix.MSI_ARCH }} -o ../../../../package/setup.msi -pdbtype none
env:
RUFFLE_VERSION: "0.1.0"
CARGO_BUILD_DIR: ../../../../target/${{ matrix.target }}/release
CARGO_BUILD_DIR: ../../../../target/${{ matrix.target }}/release-small
if: runner.os == 'Windows'

- name: Package Windows
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:

- name: Build Safari Web Extension stub binary
if: runner.os == 'macOS'
run: cargo build --locked --package ruffle_web_safari --release ${{ matrix.target && '--target' }} ${{ matrix.target }}
run: cargo build --locked --package ruffle_web_safari --profile release-small ${{ matrix.target && '--target' }} ${{ matrix.target }}
env:
RUSTFLAGS: ${{ matrix.RUSTFLAGS }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.MACOSX_DEPLOYMENT_TARGET }}
Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ panic = "unwind"
[profile.release]
panic = "abort"

[profile.release-small]
inherits = "release"
strip = true
lto = true

[profile.dev.package.h263-rs]
opt-level = 3

Expand Down
Loading