Skip to content

Commit 1a50c35

Browse files
authored
Improved build pipeline & scripts (#620)
* Simplified `gen_proj` * Full premake5 argument passthrough * Build matrix (debug/config) * Now automatically trigger release builds on version tag
1 parent afe7a0f commit 1a50c35

File tree

14 files changed

+65
-66
lines changed

14 files changed

+65
-66
lines changed

.github/workflows/linux.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linux Clang
1+
name: Linux
22

33
on:
44
workflow_dispatch:
@@ -12,17 +12,15 @@ env:
1212
# Path to the solution file relative to the root of the project.
1313
SOLUTION_FILE_PATH: ./
1414

15-
# Configuration type to build.
16-
# You can convert this to a build matrix if you need coverage of multiple configuration types.
17-
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
18-
BUILD_CONFIGURATION: release
19-
BUILD_PLATFORM: x64
20-
2115
jobs:
2216
build:
23-
name: Linux Clang Build
17+
name: Clang ${{ matrix.configuration }} x64
2418
runs-on: ubuntu-latest
2519
if: github.event.pull_request.draft == false
20+
21+
strategy:
22+
matrix:
23+
configuration: [Debug, Release]
2624

2725
steps:
2826
- uses: actions/checkout@v5
@@ -32,10 +30,10 @@ jobs:
3230

3331
- name: Generate premake5 solution
3432
working-directory: ${{env.SOLUTION_FILE_PATH}}
35-
run: ./gen_proj_linux.sh
33+
run: ./gen_proj.sh
3634

3735
- name: Build
3836
working-directory: ${{env.GITHUB_WORKSPACE}}
39-
# Add additional options to the MSBuild command line here (like platform or verbosity level).
40-
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
41-
run: make -j$(nproc) config=${{env.BUILD_CONFIGURATION}}_${{env.BUILD_PLATFORM}}
37+
run: |
38+
CONFIG_LOWER=$(echo "${{ matrix.configuration }}" | tr '[:upper:]' '[:lower:]')
39+
make -j$(nproc) config=${CONFIG_LOWER}_x64

.github/workflows/linux_release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Linux Release
22

33
on:
44
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*'
58

69
jobs:
710
build:

.github/workflows/windows.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Windows MSVC
1+
name: Windows
22

33
on:
44
workflow_dispatch:
@@ -12,29 +12,26 @@ env:
1212
# Path to the solution file relative to the root of the project.
1313
SOLUTION_FILE_PATH: .\
1414

15-
# Configuration type to build.
16-
# You can convert this to a build matrix if you need coverage of multiple configuration types.
17-
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
18-
BUILD_CONFIGURATION: Release
19-
2015
jobs:
2116
build:
22-
name: Windows MSVC Build
17+
name: MSVC ${{ matrix.configuration }} x64
2318
runs-on: windows-latest
2419
if: github.event.pull_request.draft == false
20+
21+
strategy:
22+
matrix:
23+
configuration: [Debug, Release]
2524

2625
steps:
2726
- uses: actions/checkout@v5
2827

29-
- name: Generate premake5 solution
30-
working-directory: ${{env.SOLUTION_FILE_PATH}}
31-
run: .\gen_proj_win32.bat
32-
3328
- name: Add MSBuild to PATH
3429
uses: microsoft/setup-msbuild@v2
3530

31+
- name: Generate premake5 solution
32+
working-directory: ${{env.SOLUTION_FILE_PATH}}
33+
run: .\gen_proj.bat
34+
3635
- name: Build
3736
working-directory: ${{env.GITHUB_WORKSPACE}}
38-
# Add additional options to the MSBuild command line here (like platform or verbosity level).
39-
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
40-
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
37+
run: msbuild /m /p:Configuration=${{ matrix.configuration }} ${{env.SOLUTION_FILE_PATH}} /p:Platform=x64

.github/workflows/windows_release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Windows Release
22

33
on:
44
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*'
58

69
jobs:
710
build:

Dependencies/premake5/bin/premake5.exe

100644100755
16.5 KB
Binary file not shown.

README.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,32 +68,25 @@ In a rush? [Get the latest release](https://github.com/Overload-Technologies/Ove
6868
```powershell
6969
git clone https://github.com/Overload-Technologies/Overload
7070
cd Overload
71-
.\gen_proj_win32.bat # generate project files for Visual Studio 2022
72-
73-
# (Optional) open the solution in Visual Studio
74-
.\Overload.sln
71+
.\gen_proj.bat vs2022 # generate project files for Visual Studio 2022
72+
.\Overload.sln # Open the solution in Visual Studio
7573
```
7674

75+
> [!note]
76+
> Officially supported actions for `gen_proj.bat` are: `vs2022` (default), `gmake`, `codelite`.<br/>
77+
> Refer to [premake's website](https://premake.github.io/docs/Using-Premake) for more information.
78+
7779
### Linux (Clang)
7880
```bash
7981
git clone https://github.com/Overload-Technologies/Overload
8082
cd Overload
81-
./gen_proj_linux.sh # generate Makefiles
82-
83-
# (Optional) build the project
84-
make
83+
./gen_proj.sh gmake # generate project files for Makefile
84+
make -j$(nproc) # build the project using all available CPU cores
8585
```
8686

87-
### Other Platforms & IDEs
88-
`gen_proj` scripts can be invoked with an argument to specify the the action to perform.
89-
```bash
90-
# Generating Makefile on Windows
91-
.\gen_proj_win32.bat gmake
92-
93-
# Generating CodeLite project on Linux
94-
./gen_proj_linux.sh codelite
95-
```
96-
*Please refer to [Premake5's documentation](https://premake.github.io/docs/Using-Premake) to find supported IDEs.*
87+
> [!note]
88+
> Officially supported actions for `gen_proj.sh` are: `gmake` (default), `codelite`.<br/>
89+
> Refer to [premake's website](https://premake.github.io/docs/Using-Premake) for more information.
9790
9891
# Architecture
9992
Overload is divided into 11 modules: 9 libraries (SDK), and 2 executables (Applications).
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ CONFIGURATION="${1:-debug}"
66
# Convert to lowercase for make
77
CONFIG_LOWER=$(echo "$CONFIGURATION" | tr '[:upper:]' '[:lower:]')
88

9-
# Generate the projects
9+
# Generate project files
1010
pushd "$(dirname "$0")" > /dev/null
11-
./GenerateProjects.sh gmake
11+
./GenerateProjects.sh
1212
popd > /dev/null
1313

1414
# Build the solution

Scripts/Linux/GenerateProjects.sh

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

3-
# Get the action parameter (default to gmake)
4-
ACTION="${1:-gmake}"
3+
WORKSPACE_ROOT="$(dirname "$0")/../.."
54

6-
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7-
PREMAKE_PATH="$SCRIPT_DIR/../../Dependencies/premake5/bin/premake5"
5+
# If no argument is provided, default to gmake
6+
if [ $# -eq 0 ]; then
7+
echo "No action specified. Defaulting to 'gmake'."
8+
set -- gmake
9+
fi
810

9-
pushd "$SCRIPT_DIR/../.." > /dev/null
10-
"$PREMAKE_PATH" "$ACTION"
11+
pushd "$WORKSPACE_ROOT" > /dev/null
12+
"./Dependencies/premake5/bin/premake5" "$@"
1113
popd > /dev/null

Scripts/Linux/MakeReleaseBuild.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ for arg in "$@"; do
1111
done
1212

1313
# Build Debug
14-
"$SCRIPT_DIR/BuildAll.sh" debug
14+
"$SCRIPT_DIR/Build.sh" debug
1515
if [ $? -ne 0 ]; then
1616
echo "Debug build failed. Exiting."
1717
exit $?
1818
fi
1919

2020
# Build Release
21-
"$SCRIPT_DIR/BuildAll.sh" release
21+
"$SCRIPT_DIR/Build.sh" release
2222
if [ $? -ne 0 ]; then
2323
echo "Release build failed. Exiting."
2424
exit $?
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set "CONFIGURATION=%~1"
66

77
:: Generate the projects
88
pushd "%~dp0"
9-
call GenerateProjects vs2022 %CONFIGURATION%
9+
call .\GenerateProjects.bat vs2022 %CONFIGURATION%
1010
popd
1111

1212
:: Initialize variables

0 commit comments

Comments
 (0)