mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 20:48:43 +00:00
Use cargo-auditable
for release build (#878)
to make the pre-built artifacts auditable by `cargo-audit` and other tools. * Add new env `JUST_USE_AUDITABLE` to enable use of `cargo-auditable` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
ac414df5be
commit
18bc81f46f
2 changed files with 19 additions and 10 deletions
2
.github/workflows/release-build.yml
vendored
2
.github/workflows/release-build.yml
vendored
|
@ -37,12 +37,14 @@ jobs:
|
||||||
GLIBC_VERSION: ${{ matrix.g }}
|
GLIBC_VERSION: ${{ matrix.g }}
|
||||||
JUST_USE_CARGO_ZIGBUILD: ${{ matrix.c }}
|
JUST_USE_CARGO_ZIGBUILD: ${{ matrix.c }}
|
||||||
JUST_FOR_RELEASE: true
|
JUST_FOR_RELEASE: true
|
||||||
|
JUST_USE_AUDITABLE: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/just-setup
|
- uses: ./.github/actions/just-setup
|
||||||
with:
|
with:
|
||||||
cache-suffix: release-${{ matrix.t }}
|
cache-suffix: release-${{ matrix.t }}
|
||||||
|
tools: cargo-auditable
|
||||||
|
|
||||||
- run: just toolchain rust-src
|
- run: just toolchain rust-src
|
||||||
- run: just ci-install-deps
|
- run: just ci-install-deps
|
||||||
|
|
27
justfile
27
justfile
|
@ -8,9 +8,13 @@ extra-features := env_var_or_default("JUST_EXTRA_FEATURES", "")
|
||||||
default-features := env_var_or_default("JUST_DEFAULT_FEATURES", "")
|
default-features := env_var_or_default("JUST_DEFAULT_FEATURES", "")
|
||||||
override-features := env_var_or_default("JUST_OVERRIDE_FEATURES", "")
|
override-features := env_var_or_default("JUST_OVERRIDE_FEATURES", "")
|
||||||
glibc-version := env_var_or_default("GLIBC_VERSION", "")
|
glibc-version := env_var_or_default("GLIBC_VERSION", "")
|
||||||
|
use-auditable := env_var_or_default("JUST_USE_AUDITABLE", "")
|
||||||
|
|
||||||
export BINSTALL_LOG_LEVEL := if env_var_or_default("RUNNER_DEBUG", "0") == "1" { "debug" } else { "info" }
|
export BINSTALL_LOG_LEVEL := if env_var_or_default("RUNNER_DEBUG", "0") == "1" { "debug" } else { "info" }
|
||||||
|
|
||||||
|
cargo := if use-cargo-zigbuild != "" { "cargo-zigbuild" } else if use-cross != "" { "cross" } else { "cargo" }
|
||||||
|
export CARGO := cargo
|
||||||
|
|
||||||
# target information
|
# target information
|
||||||
target-host := `rustc -vV | grep host: | cut -d ' ' -f 2`
|
target-host := `rustc -vV | grep host: | cut -d ' ' -f 2`
|
||||||
target := env_var_or_default("CARGO_BUILD_TARGET", target-host)
|
target := env_var_or_default("CARGO_BUILD_TARGET", target-host)
|
||||||
|
@ -35,7 +39,11 @@ output-folder := "target" / target / output-profile-folder
|
||||||
output-path := output-folder / output-filename
|
output-path := output-folder / output-filename
|
||||||
|
|
||||||
# which tool to use for compiling
|
# which tool to use for compiling
|
||||||
cargo-bin := if use-cargo-zigbuild != "" { "cargo-zigbuild" } else if use-cross != "" { "cross" } else { "cargo" }
|
cargo-bin := if use-auditable != "" {
|
||||||
|
"cargo-auditable auditable"
|
||||||
|
} else {
|
||||||
|
cargo
|
||||||
|
}
|
||||||
|
|
||||||
# cargo compile options
|
# cargo compile options
|
||||||
cargo-profile := if for-release != "" { "release" } else { "dev" }
|
cargo-profile := if for-release != "" { "release" } else { "dev" }
|
||||||
|
@ -159,13 +167,13 @@ toolchain components="":
|
||||||
{{ if ci != "" { "rustup default stable" } else { "rustup override set stable" } }}
|
{{ if ci != "" { "rustup default stable" } else { "rustup override set stable" } }}
|
||||||
{{ if target != "" { "rustup target add " + target } else { "" } }}
|
{{ if target != "" { "rustup target add " + target } else { "" } }}
|
||||||
|
|
||||||
|
print-env:
|
||||||
|
echo "env RUSTFLAGS='$RUSTFLAGS', CARGO='$CARGO'"
|
||||||
|
|
||||||
build:
|
build: print-env
|
||||||
echo "env RUSTFLAGS=$RUSTFLAGS"
|
|
||||||
{{cargo-bin}} build {{cargo-build-args}}
|
{{cargo-bin}} build {{cargo-build-args}}
|
||||||
|
|
||||||
check:
|
check: print-env
|
||||||
echo "env RUSTFLAGS=$RUSTFLAGS"
|
|
||||||
{{cargo-bin}} check {{cargo-build-args}}
|
{{cargo-bin}} check {{cargo-build-args}}
|
||||||
|
|
||||||
get-output file outdir=".":
|
get-output file outdir=".":
|
||||||
|
@ -197,19 +205,18 @@ e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3")
|
||||||
|
|
||||||
e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall
|
e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall
|
||||||
|
|
||||||
unit-tests:
|
unit-tests: print-env
|
||||||
{{cargo-bin}} test {{cargo-build-args}}
|
{{cargo-bin}} test {{cargo-build-args}}
|
||||||
|
|
||||||
test: unit-tests build e2e-tests
|
test: unit-tests build e2e-tests
|
||||||
|
|
||||||
clippy:
|
clippy: print-env
|
||||||
{{cargo-bin}} clippy --no-deps -- -D clippy::all
|
{{cargo-bin}} clippy --no-deps -- -D clippy::all
|
||||||
|
|
||||||
fmt:
|
fmt: print-env
|
||||||
cargo fmt --all -- --check
|
cargo fmt --all -- --check
|
||||||
|
|
||||||
fmt-check:
|
fmt-check: fmt
|
||||||
cargo fmt --all -- --check
|
|
||||||
|
|
||||||
lint: clippy fmt-check
|
lint: clippy fmt-check
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue