From 6157436dcd912bce5ff07d9c85702410eafab95e Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 11 Oct 2021 17:16:30 -0700 Subject: [PATCH] Use `cargo build` instead of `cargo rustc` (#993) --- .github/workflows/build.yaml | 2 +- bin/package | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9625ef2..183f436 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -42,7 +42,7 @@ jobs: runs-on: ${{matrix.os}} env: - RUSTFLAGS: "-D warnings" + RUSTFLAGS: --deny warnings --codegen=target-feature=+crt-static steps: - uses: actions/checkout@v2 diff --git a/bin/package b/bin/package index c7549bd..80037f8 100755 --- a/bin/package +++ b/bin/package @@ -14,17 +14,12 @@ echo "Packaging $bin $version for $target..." test -f Cargo.lock || cargo generate-lockfile echo "Building $bin..." +cargo build --bin $bin --target $target --release +executable=target/$target/release/$bin -case $os in - ubuntu-latest | macos-latest) - cargo rustc --bin $bin --target $target --release - executable=target/$target/release/$bin - ;; - windows-2016) - cargo rustc --bin $bin --target $target --release -- -C target-feature="+crt-static" - executable=target/$target/release/$bin.exe - ;; -esac +if [[ $os == windows-2016 ]]; then + executable=$executable.exe +fi echo "Copying release files..." mkdir dist