Skip to content

Commit 9b195ff

Browse files
committed
optim linux compiling
1 parent 2ed6d07 commit 9b195ff

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Release Build
22

33
on:
44
push:
5+
branches:
6+
- main
57
tags:
68
- "v*"
79

@@ -34,18 +36,30 @@ jobs:
3436
workspaces: src-tauri
3537
cache-on-failure: true
3638

39+
- name: Setup swap space
40+
uses: actionhippie/swap-space@v1
41+
with:
42+
size: 8G
43+
3744
- name: Install system dependencies
3845
run: |
3946
sudo apt-get update
4047
sudo apt-get install -y \
4148
libfuse2 libgtk-3-dev libwebkit2gtk-4.1-dev \
4249
libayatana-appindicator3-dev librsvg2-dev patchelf \
43-
xdg-utils libglib2.0-bin desktop-file-utils
50+
xdg-utils libglib2.0-bin desktop-file-utils \
51+
mold
4452
4553
- name: Build binary
4654
env:
47-
CARGO_BUILD_JOBS: "2"
48-
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "4"
55+
# Limit parallel jobs to reduce memory pressure
56+
CARGO_BUILD_JOBS: "1"
57+
# Reduce codegen units to lower memory usage
58+
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "1"
59+
# Use mold linker for faster linking
60+
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=mold"
61+
# Disable incremental compilation for release (saves memory)
62+
CARGO_INCREMENTAL: "0"
4963
run: nix build .#packages.${{ matrix.system }}.korppi-bin --accept-flake-config
5064

5165
- name: Upload binary

0 commit comments

Comments
 (0)