mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-22 15:23:01 +01:00
Add macOS to GitHub actions
This commit is contained in:
87
scripts/upload-build
Executable file
87
scripts/upload-build
Executable file
@@ -0,0 +1,87 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
if [[ "$#" -ne 4 && "$#" -ne 5 ]]; then
|
||||
echo 'Upload an OpenRCT2 build to openrct2.org.'
|
||||
echo ''
|
||||
echo 'Usage: upload-build <path> <flavour> <version> <sha1> [<branch>]'
|
||||
echo 'Flavours: windows-portable-x86, windows-portable-x64'
|
||||
echo ' windows-installer-x86, windows-installer-x64'
|
||||
echo ' windows-symbols-x86, windows-symbols-x64'
|
||||
echo ' macos'
|
||||
echo ' linux-i686, linux-x86_64'
|
||||
echo ' android-arm, android-x86'
|
||||
echo ''
|
||||
echo 'Environment variable ''OPENRCT2_ORG_TOKEN'' must be set.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
path=$1
|
||||
flavour=$2
|
||||
version=$3
|
||||
sha1=$4
|
||||
branch=$5
|
||||
|
||||
case "$flavour" in
|
||||
windows-portable-x86)
|
||||
flavour=windows
|
||||
flavourid=1
|
||||
;;
|
||||
windows-portable-x64)
|
||||
flavour=windows
|
||||
flavourid=6
|
||||
;;
|
||||
windows-installer-x86)
|
||||
flavour=windows
|
||||
flavourid=2
|
||||
;;
|
||||
windows-installer-x64)
|
||||
flavour=windows
|
||||
flavourid=7
|
||||
;;
|
||||
windows-symbols-x86)
|
||||
flavour=windows
|
||||
flavourid=5
|
||||
;;
|
||||
windows-symbols-x64)
|
||||
flavour=windows
|
||||
flavourid=10
|
||||
;;
|
||||
macos)
|
||||
flavourid=3
|
||||
;;
|
||||
linux-i686)
|
||||
flavourid=4
|
||||
;;
|
||||
linux-x86_64)
|
||||
flavourid=9
|
||||
;;
|
||||
android-arm)
|
||||
flavourid=11
|
||||
;;
|
||||
android-x86)
|
||||
flavourid=12
|
||||
;;
|
||||
*)
|
||||
echo -e $"\033[0;31mUnknown flavour: $flavour"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
if [ "$branch" != "" ]; then
|
||||
versionextra=-$branch-${sha1:0:7}
|
||||
fi
|
||||
filename=OpenRCT2-$version$versionextra-$flavour.zip
|
||||
|
||||
echo -e "\033[0;36mUploading to openrct2.org as '$filename'..."
|
||||
if [ "$OPENRCT2_ORG_TOKEN" == "" ]; then
|
||||
echo -e "\033[0;31mOPENRCT2_ORG_TOKEN not set"
|
||||
exit 1
|
||||
fi
|
||||
curl -m 300 --connect-timeout 5 -o - -v \
|
||||
--form "key=$OPENRCT2_ORG_TOKEN" \
|
||||
--form "fileName=$filename" \
|
||||
--form "version=$version" \
|
||||
--form "gitHash=$sha1" \
|
||||
--form "gitBranch=$branch" \
|
||||
--form "flavourId=$flavourid" \
|
||||
--form "file=@$path" \
|
||||
"https://openrct2.org/altapi/?command=push-build"
|
||||
Reference in New Issue
Block a user