ci: move linux + windows rive_native builds to self-hosted; fetch prebuilt premake on windows (#12640) 1548d0bb39
* ci: move linux + windows rive_native builds to self-hosted

* ci: restore linux apt deps, revert windows to hosted (warpbuild VS license expired)

* ci: add clang and build tools to linux apt deps

* build: fetch prebuilt premake on windows instead of bootstrapping

* ci: try warpbuild for windows rive_native build

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
diff --git a/.rive_head b/.rive_head
index bb9b9b1..6d1d024 100644
--- a/.rive_head
+++ b/.rive_head
@@ -1 +1 @@
-1ff3ef872f76f9aa9872cc2caaf57b7b6c0ee55e
+1548d0bb39cb39ca992e89167adfd97e5146946e
diff --git a/build/build_rive.sh b/build/build_rive.sh
index c0c3e38..6478cef 100755
--- a/build/build_rive.sh
+++ b/build/build_rive.sh
@@ -227,19 +227,29 @@
 # sure we rebuild if this script runs for a different tag.
 RIVE_PREMAKE_TAG="${RIVE_PREMAKE_TAG:-v5.0.0-beta7}"
 PREMAKE_INSTALL_DIR="$SCRIPT_DIR/dependencies/premake-core/bin/${RIVE_PREMAKE_TAG}_release"
-if [ ! -f "$PREMAKE_INSTALL_DIR/premake5" ]; then
-    echo Building Premake...
-    rm -fr premake-core # Wipe out a prior checkout if it exists without a premake5 binary.
-    git clone --depth 1 --branch $RIVE_PREMAKE_TAG https://github.com/premake/premake-core.git
-    pushd premake-core > /dev/null
-    case "$HOST_MACHINE" in
-        mac_arm64) make -f Bootstrap.mak osx PLATFORM=ARM ;;
-        mac_x64) make -f Bootstrap.mak osx ;;
-        windows) ./Bootstrap.bat ;;
-        *) make -f Bootstrap.mak linux ;;
-    esac
-    cp -r bin/release $PREMAKE_INSTALL_DIR
-    popd > /dev/null
+if [ ! -f "$PREMAKE_INSTALL_DIR/premake5" ] && [ ! -f "$PREMAKE_INSTALL_DIR/premake5.exe" ]; then
+    if [[ $HOST_MACHINE == "windows" ]]; then
+        echo Downloading prebuilt Premake...
+        PREMAKE_VERSION="${RIVE_PREMAKE_TAG#v}"
+        PREMAKE_ZIP="premake-${PREMAKE_VERSION}-windows.zip"
+        mkdir -p "$PREMAKE_INSTALL_DIR"
+        curl -fL -o "$PREMAKE_ZIP" \
+            "https://github.com/premake/premake-core/releases/download/${RIVE_PREMAKE_TAG}/${PREMAKE_ZIP}"
+        unzip -o "$PREMAKE_ZIP" -d "$PREMAKE_INSTALL_DIR"
+        rm "$PREMAKE_ZIP"
+    else
+        echo Building Premake...
+        rm -fr premake-core # Wipe out a prior checkout if it exists without a premake5 binary.
+        git clone --depth 1 --branch $RIVE_PREMAKE_TAG https://github.com/premake/premake-core.git
+        pushd premake-core > /dev/null
+        case "$HOST_MACHINE" in
+            mac_arm64) make -f Bootstrap.mak osx PLATFORM=ARM ;;
+            mac_x64) make -f Bootstrap.mak osx ;;
+            *) make -f Bootstrap.mak linux ;;
+        esac
+        cp -r bin/release $PREMAKE_INSTALL_DIR
+        popd > /dev/null
+    fi
 fi
 export PATH="$PREMAKE_INSTALL_DIR:$PATH"