This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user