Skip to content

Commit 56246ba

Browse files
authored
Linux & Windows build artifact workflows (#618)
* Added workflows to generate Windows and Linux release-build artifacts. * Updated the Linux and Windows workflows to not trigger when updating a draft PR. * Updated `MakeReleaseBuild.sh` and `.bat` to support the `--no-open` argument, which skips opening the build output in the file explorer, useful for headless build pipelines.
1 parent 3b02436 commit 56246ba

6 files changed

Lines changed: 80 additions & 5 deletions

File tree

.github/workflows/linux.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ env:
1919

2020
jobs:
2121
build:
22+
name: Linux Clang Build
2223
runs-on: ubuntu-latest
24+
if: github.event.pull_request.draft == false
2325

2426
steps:
2527
- uses: actions/checkout@v5
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Linux Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
name: Generate Linux x64 Release Artifact
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v5
13+
14+
- name: Install Dependencies
15+
run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev
16+
17+
- name: Make Release Build
18+
run: bash Scripts/Linux/MakeReleaseBuild.sh --no-open
19+
20+
- name: Get Version
21+
id: version
22+
run: echo "VERSION=$(cat VERSION.txt)" >> $GITHUB_OUTPUT
23+
24+
- name: Upload Release Artifact
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: Overload-${{ steps.version.outputs.VERSION }}-linux_x64
28+
path: Releases/Overload-${{ steps.version.outputs.VERSION }}-linux_x64.tar.gz
29+
retention-days: 90

.github/workflows/windows.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Windows MSBuild
1+
name: Windows MSVC
22

33
on:
44
pull_request:
@@ -18,7 +18,9 @@ env:
1818

1919
jobs:
2020
build:
21+
name: Windows MSVC Build
2122
runs-on: windows-latest
23+
if: github.event.pull_request.draft == false
2224

2325
steps:
2426
- uses: actions/checkout@v5
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Windows Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
name: Generate Windows x64 Release Artifact
9+
runs-on: windows-latest
10+
11+
steps:
12+
- uses: actions/checkout@v5
13+
14+
- name: Add MSBuild to PATH
15+
uses: microsoft/setup-msbuild@v2
16+
17+
- name: Make Release Build
18+
run: .\Scripts\Windows\MakeReleaseBuild.bat --no-open
19+
20+
- name: Get Version
21+
id: version
22+
run: |
23+
$version = Get-Content VERSION.txt
24+
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
25+
26+
- name: Upload Release Artifact
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: Overload-${{ steps.version.outputs.VERSION }}-win32_x64
30+
path: Releases/Overload-${{ steps.version.outputs.VERSION }}-win32_x64.zip
31+
retention-days: 90

Scripts/Linux/MakeReleaseBuild.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#!/bin/bash
22

33
SCRIPT_DIR="$(dirname "$0")"
4+
NO_OPEN=false
5+
6+
# Parse arguments
7+
for arg in "$@"; do
8+
if [ "$arg" = "--no-open" ]; then
9+
NO_OPEN=true
10+
fi
11+
done
412

513
# Build Debug
614
"$SCRIPT_DIR/BuildAll.sh" debug
@@ -52,7 +60,7 @@ fi
5260

5361
popd > /dev/null
5462

55-
# Open the output folder in the file manager (if available)
56-
if command -v xdg-open &> /dev/null; then
63+
# Open the output folder in the file manager (if available and not disabled)
64+
if [ "$NO_OPEN" = false ] && command -v xdg-open &> /dev/null; then
5765
xdg-open "$SCRIPT_DIR/../../Releases"
5866
fi

Scripts/Windows/MakeReleaseBuild.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
pushd "%~dp0"
22

3+
set NO_OPEN=false
4+
if "%1"=="--no-open" set NO_OPEN=true
5+
36
call .\BuildAll.bat Debug
47
if %ERRORLEVEL% neq 0 (
58
echo Debug build failed. Exiting.
@@ -46,8 +49,8 @@ if exist ..\Releases\Overload-%version%-%platform% (
4649
echo Temporary build deleted.
4750
)
4851

49-
:: Open the output folder in the file explorer
50-
explorer ..\Releases
52+
:: Open the output folder in the file explorer (if not disabled)
53+
if "%NO_OPEN%"=="false" explorer ..\Releases
5154

5255
:: Return to the original directory
5356
popd

0 commit comments

Comments
 (0)