From d3919a311fe6328181ad4fc11dba4bbcab89d34a Mon Sep 17 00:00:00 2001 From: nibon7 Date: Thu, 29 Jun 2023 12:43:09 +0800 Subject: [PATCH] Refactor cargo-build-nu (#9554) # Description This PR refactors `cargo-build-nu` cc @hustcer # User-Facing Changes # Tests + Formatting # After Submitting --- .github/workflows/release-pkg.nu | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-pkg.nu b/.github/workflows/release-pkg.nu index 2044f644a8..61c9d4369b 100755 --- a/.github/workflows/release-pkg.nu +++ b/.github/workflows/release-pkg.nu @@ -99,12 +99,7 @@ if $os in [$USE_UBUNTU, 'macos-latest'] { # Build for Windows without static-link-openssl feature # ---------------------------------------------------------------------------- if $os in ['windows-latest'] { - # let-env CARGO_BUILD_TARGET = $target - if ($flags | str trim | is-empty) { - cargo build --release --all --target $target - } else { - cargo build --release --all --target $target $flags - } + cargo-build-nu $flags } # ---------------------------------------------------------------------------- @@ -194,11 +189,13 @@ if $os in [$USE_UBUNTU, 'macos-latest'] { } def 'cargo-build-nu' [ options: string ] { - if ($options | str trim | is-empty) { - cargo build --release --all --target $target --features=static-link-openssl + let features = if $os == 'windows-latest' { + '' } else { - cargo build --release --all --target $target --features=static-link-openssl $options + '--features=static-link-openssl' } + + cargo build --release --all --target $target $features $options } # Print a horizontal line marker