From a8844843a6751ae77697a731abffc50402cf008e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 26 Jan 2021 23:30:47 +0100 Subject: ci: Also build/publish 32-bit wheels (#26) Closes #25 --- ci/set-target.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 ci/set-target.sh (limited to 'ci/set-target.sh') diff --git a/ci/set-target.sh b/ci/set-target.sh new file mode 100755 index 0000000..f0dfbf0 --- /dev/null +++ b/ci/set-target.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 OS ARCHITECTURE" >&2 + exit 1 +fi + +os=$1 +architecture=$2 + +output() { + echo "Setting ACTIONS_RUST_TARGET=$1" + echo "ACTIONS_RUST_TARGET=$1" >> "$GITHUB_ENV" + exit 0 +} + +if [ "$architecture" = "x64" ]; then + if [ "$os" = "ubuntu-latest" ]; then + output "x86_64-unknown-linux-gnu" + elif [ "$os" = "macos-latest" ]; then + output "x86_64-apple-darwin" + elif [ "$os" = "windows-latest" ]; then + output "x86_64-pc-windows-msvc" + else + echo "Unknown 64-bit OS: $os" + exit 1 + fi +elif [ "$architecture" = "x86" ]; then + if [ "$os" = "ubuntu-latest" ]; then + output "i686-unknown-linux-gnu" + elif [ "$os" = "windows-latest" ]; then + output "i686-pc-windows-msvc" + else + echo "Unknown 32-bit OS: $os" + exit 1 + fi +else + echo "Bad architecture: $architecture" + exit 1 +fi -- cgit v1.2.3