testing new ci script for matrix build and test

This commit is contained in:
Shawn Hartsell
2024-04-22 18:00:37 -05:00
parent b47191d0e7
commit 4ab3e731a1
2 changed files with 25 additions and 5 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "No GOOS specified as first arg, using the current system GOOS"
GOOS_BUILD=$(go env GOOS)
else
GOOS_BUILD=$1
fi
if [ -z "$2" ]; then
echo "No GOARCH specified as second arg, using the current system GOOS"
GOARCH_BUILD=$(go env GOARCH)
else
GOARCH_BUILD=$1
fi
echo "Building for $GOOS_BUILD $GOARCH_BUILD"
# build the exutable and include GOOS and GOARCH in the name
GOOS=$GOOS_BUILD GOARCH=$GOARCH_BUILD go build -o bin/actions-sync-"$GOOS_BUILD"-"$GOARCH_BUILD" main.go