Skip to content

Commit

Permalink
fix release builds on main
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Mar 21, 2024
1 parent e1c62d7 commit 75e3af3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,18 @@ jobs:

# Enable Link Time Optimization (LTO) for our release builds. This increases link time but drastically reduces
# binary size.
CARGO_PROFILE_RELEASE_LTO: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') && 'true' || 'false' }}
CARGO_PROFILE_RELEASE_LTO: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && 'true' || 'false' }}

# Use a single code gen unit, this effectively disables parallel linking but ensures that everything is linked
# together in a single unit which reduces the file-size at the cost of link time.
# Default for a release build is 16
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') && 1 || 16 }}
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && 1 || 16 }}

# Strip the binaries. This reduces the filesize of the final release.
CARGO_PROFILE_RELEASE_STRIP: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') && 'symbols' || 'false' }}
CARGO_PROFILE_RELEASE_STRIP: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && 'symbols' || 'false' }}

# Optimize the binary for size. This reduces the filesize at the cost of a slower binary.
CARGO_PROFILE_OPT_LEVEL: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') && 's' || '0' }}
CARGO_PROFILE_OPT_LEVEL: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && 's' || '0' }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
Expand Down

0 comments on commit 75e3af3

Please sign in to comment.