chore: add possibility to ignore premake5 from path

This commit is contained in:
Jan 2025-01-13 01:13:08 +01:00
parent 32c0ecb04d
commit 419481b4da
No known key found for this signature in database
GPG Key ID: 44B581F78FF5C57C
4 changed files with 26 additions and 15 deletions

View File

@ -30,7 +30,7 @@ jobs:
- name: Premake generate
working-directory: ${{ github.workspace }}
env:
OAT_CI_NO_PROMPT: 1
PREMAKE_NO_PROMPT: 1
run: ./generate.sh
- name: Build
@ -61,7 +61,7 @@ jobs:
- name: Premake generate
working-directory: ${{ github.workspace }}
env:
OAT_CI_NO_PROMPT: 1
PREMAKE_NO_PROMPT: 1
run: ./generate.bat
- name: Build

View File

@ -27,7 +27,7 @@ jobs:
- name: Premake generate
working-directory: ${{ github.workspace }}
env:
OAT_CI_NO_PROMPT: 1
PREMAKE_NO_PROMPT: 1
run: ./generate.sh
- name: Build
@ -55,22 +55,22 @@ jobs:
- name: Premake generate
working-directory: ${{ github.workspace }}
env:
OAT_CI_NO_PROMPT: 1
PREMAKE_NO_PROMPT: 1
run: ./generate.bat
- name: Build
working-directory: ${{ github.workspace }}
run: msbuild /m /p:Configuration=Release /p:Platform=Win32 build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: oat-windows
path: |
${{ github.workspace }}/build/bin/Release_x86
release:
needs:
needs:
- build-release-linux
- build-release-windows
runs-on: ubuntu-latest
@ -93,4 +93,4 @@ jobs:
allowUpdates: true
draft: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitDraftDuringUpdate: true

View File

@ -3,6 +3,10 @@
set PREMAKE_URL="https://github.com/premake/premake-core/releases/download/v5.0.0-beta4/premake-5.0.0-beta4-windows.zip"
set PREMAKE_HASH="12d741d3b70445b025c03e26148e2d129801041fa5ddde61b4ac888a76017395"
REM The following variables can be set:
REM PREMAKE_NO_GLOBAL - Ignore premake5 executable from path
REM PREMAKE_NO_PROMPT - Download premake5 without prompting
goto start
:downloadpremake
@ -45,10 +49,13 @@ exit /B 0
cd %~dp0
:start
where /q "premake5.exe"
IF %ERRORLEVEL% EQU 0 (
set PREMAKE_BIN="premake5.exe"
goto runpremake
IF /i "%PREMAKE_NO_GLOBAL%" EQU "" (
where /q "premake5.exe"
IF %ERRORLEVEL% EQU 0 (
set PREMAKE_BIN="premake5.exe"
goto runpremake
)
)
IF EXIST build/premake5.exe (
@ -56,7 +63,7 @@ IF EXIST build/premake5.exe (
goto runpremake
)
if "%OAT_CI_NO_PROMPT%" NEQ "" (
if "%PREMAKE_NO_PROMPT%" NEQ "" (
call:downloadpremake
set PREMAKE_BIN="build/premake5.exe"
goto runpremake

View File

@ -3,6 +3,10 @@
PREMAKE_URL='https://github.com/premake/premake-core/releases/download/v5.0.0-beta4/premake-5.0.0-beta4-linux.tar.gz'
PREMAKE_HASH='4356ab7cdec6085183d68fb240089376eacdc2fb751ffbd8063d797ae43abeb3'
# The following variables can be set:
# PREMAKE_NO_GLOBAL - Ignore premake5 executable from path
# PREMAKE_NO_PROMPT - Download premake5 without prompting
function install_premake {
if [[ ! -x "$(command -v wget)" ]]; then
echo "Failed: Installation requires wget" >&2
@ -51,13 +55,13 @@ if [[ ! -d ".git" ]]; then
fi
PREMAKE_BIN=''
if [[ -x "$(command -v premake5)" ]]; then
if [[ -z "$PREMAKE_NO_GLOBAL" ]] && [[ -x "$(command -v premake5)" ]]; then
PREMAKE_BIN='premake5'
elif [[ -x "$(command -v build/premake5)" ]]; then
PREMAKE_BIN='build/premake5'
else
echo "Could not find premake5. You can either install it yourself or this script download it for you."
if [[ ! -z "$OAT_CI_NO_PROMPT" ]] || [[ "$(read -e -p 'Do you wish to download it automatically? [y/N]> '; echo $REPLY)" == [Yy]* ]]; then
if [[ ! -z "$PREMAKE_NO_PROMPT" ]] || [[ "$(read -e -p 'Do you wish to download it automatically? [y/N]> '; echo $REPLY)" == [Yy]* ]]; then
echo "Installing premake"
install_premake
PREMAKE_BIN='build/premake5'