-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add distribution builds for Windows
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
echo "::group::Install dependencies" | ||
apt-get update | ||
apt-get install -y --no-install-recommends gcc gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 | ||
echo "::endgroup::" | ||
|
||
echo "::group::Install Rust" | ||
|
||
rust_version="$(cat "ci/rust-versions/stable.txt")" | ||
|
||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ | ||
sh -s -- -y --default-toolchain "$rust_version" --profile minimal \ | ||
-t x86_64-pc-windows-gnu \ | ||
-t i686-pc-windows-gnu | ||
|
||
# shellcheck disable=SC1090 | ||
. "$HOME/.cargo/env" | ||
|
||
echo "::endgroup::" | ||
|
||
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 | ||
export CARGO_PROFILE_RELEASE_CODEGEN_PANIC=abort | ||
export CARGO_PROFILE_RELEASE_STRIP=debuginfo | ||
|
||
echo "::group::Fetch Rust dependencies" | ||
cargo fetch --locked | ||
mkdir output | ||
echo "::endgroup::" | ||
|
||
echo "::group::Build x86_64" | ||
cargo build -p rsjsonnet --target x86_64-pc-windows-gnu --release --frozen | ||
mkdir output/rsjsonnet-linux-x86_64 | ||
cp -t output/rsjsonnet-linux-x86_64 target/x86_64-pc-windows-gnu/release/rsjsonnet.exe | ||
echo "::endgroup::" | ||
|
||
echo "::group::Build i686" | ||
cargo build -p rsjsonnet --target i686-pc-windows-gnu --release --frozen | ||
mkdir output/rsjsonnet-linux-i686 | ||
cp -t output/rsjsonnet-linux-i686 target/i686-pc-windows-gnu/release/rsjsonnet.exe | ||
echo "::endgroup::" |