From b648bf9dbe35268a115cb9bdd9cd38eee7ce469d Mon Sep 17 00:00:00 2001 From: Stanislav Pastushenko Date: Wed, 10 Dec 2025 21:54:11 +0100 Subject: [PATCH] guitea build --- .gitea/workflows/build.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 788ffab..4ac9119 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -38,6 +38,21 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Cache Cargo Dependencies + uses: actions/cache@v3 + with: + # Path to cache: The 'target' directory contains all compiled libraries + path: | + ~/.cargo/bin/ + ~/.cargo/registry/ + target/ + # Key: Changes if OS, Rust toolchain, or dependencies change + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.target }} + # Restore Keys: Use for finding a cache from a slightly older lock file + restore-keys: | + ${{ runner.os }}-cargo-${{ matrix.target }}- + ${{ runner.os }}-cargo- + - name: Setup cross-compilation tools if: matrix.setup_cmd != '' run: ${{ matrix.setup_cmd }} @@ -47,10 +62,14 @@ jobs: - name: Build release binary run: | + # Define the flag to tell the linker to disable debug section compression + RUSTFLAGS="-C link-arg=-Wl,--compress-debug-sections=none" + if [ "${{ matrix.platform }}" = "macos" ]; then cargo zigbuild --release --target ${{ matrix.target }} else - cargo build --release --target ${{ matrix.target }} + # Prepend RUSTFLAGS to the cargo build command + ${RUSTFLAGS} cargo build --release --target ${{ matrix.target }} fi - name: Prepare artifact