forked from pact-foundation/pact-core-mock-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease-win.sh
More file actions
40 lines (31 loc) · 1.17 KB
/
Copy pathrelease-win.sh
File metadata and controls
40 lines (31 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -e
set -x
RUST_DIR="$(cd -- "$(dirname "${BASH_SOURCE[0]}")/.." && pwd )"
source "$RUST_DIR/scripts/gzip-and-sum.sh"
ARTIFACTS_DIR=${ARTIFACTS_DIR:-"$RUST_DIR/release_artifacts"}
mkdir -p "$ARTIFACTS_DIR"
export CARGO_TARGET_DIR=${CARO_TARGET_DIR:-"$RUST_DIR/target"}
# All flags passed to this script are passed to cargo.
cargo_flags=( "$@" )
# Build the x86_64 windows release
build_x86_64() {
cargo build --target x86_64-pc-windows-msvc "${cargo_flags[@]}"
# If --release in cargo flags, then gzip and sum the release artifacts
if [[ "${cargo_flags[*]}" =~ "--release" ]]; then
gzip_and_sum \
"$CARGO_TARGET_DIR/x86_64-pc-windows-msvc/release/pact-mock-server.exe" \
"$ARTIFACTS_DIR/pact-mock-server-windows-x86_64.exe.gz"
fi
}
# Build the aarch64 windows release
build_aarch64() {
cargo build --target aarch64-pc-windows-msvc "${cargo_flags[@]}"
if [[ "${cargo_flags[*]}" =~ "--release" ]]; then
gzip_and_sum \
"$CARGO_TARGET_DIR/aarch64-pc-windows-msvc/release/pact-mock-server.exe" \
"$ARTIFACTS_DIR/pact-mock-server-windows-aarch64.exe.gz"
fi
}
build_x86_64
build_aarch64