Skip to content

Commit 74a4d49

Browse files
authored
Merge pull request #113 from TECHNICANGEL/update-cicd-releases-14180229479032141125
Update CI/CD for Multi-Platform Releases
2 parents d624843 + 346df0f commit 74a4d49

File tree

1 file changed

+44
-8
lines changed

1 file changed

+44
-8
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
name: Build
1+
name: Build and Release
22

33
on:
44
push:
55
branches: [ master, main ]
6+
tags:
7+
- 'v*'
68
pull_request:
79
branches: [ master, main ]
810

911
jobs:
1012
build-windows:
1113
runs-on: windows-latest
12-
1314
env:
1415
VULKAN_SDK: C:\VulkanSDK\1.3.290.0
15-
1616
steps:
1717
- uses: actions/checkout@v4
18-
with:
19-
submodules: recursive
2018

2119
- name: Cache Vulkan SDK
2220
id: cache-vulkan
@@ -34,9 +32,10 @@ jobs:
3432

3533
- name: Clone dependencies
3634
run: |
37-
git clone --depth 1 https://github.com/glfw/glfw.git external/glfw
38-
git clone --depth 1 https://github.com/g-truc/glm.git external/glm
39-
git clone --depth 1 https://github.com/ocornut/imgui.git external/imgui
35+
if (!(Test-Path "external/glfw")) { git clone --depth 1 https://github.com/glfw/glfw.git external/glfw }
36+
if (!(Test-Path "external/glm")) { git clone --depth 1 https://github.com/g-truc/glm.git external/glm }
37+
if (!(Test-Path "external/imgui")) { git clone --depth 1 https://github.com/ocornut/imgui.git external/imgui }
38+
shell: pwsh
4039

4140
- name: Configure CMake
4241
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
@@ -53,3 +52,40 @@ jobs:
5352
cmd /c compile_shaders.bat
5453
}
5554
shell: pwsh
55+
56+
- name: Package
57+
run: |
58+
mkdir release
59+
copy build\Release\RacingEngine.exe release\
60+
mkdir release\shaders\compiled
61+
copy shaders\compiled\*.spv release\shaders\compiled\
62+
if (Test-Path "assets") {
63+
xcopy /E /I assets release\assets
64+
}
65+
Compress-Archive -Path release\* -DestinationPath RacingEngine-Windows.zip
66+
shell: pwsh
67+
68+
- name: Upload Artifact
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: windows-bin
72+
path: RacingEngine-Windows.zip
73+
74+
release:
75+
needs: [build-windows]
76+
if: startsWith(github.ref, 'refs/tags/')
77+
runs-on: ubuntu-latest
78+
permissions:
79+
contents: write
80+
steps:
81+
- name: Download all artifacts
82+
uses: actions/download-artifact@v4
83+
84+
- name: List artifacts
85+
run: ls -R
86+
87+
- name: Create Release
88+
uses: softprops/action-gh-release@v2
89+
with:
90+
files: |
91+
windows-bin/RacingEngine-Windows.zip

0 commit comments

Comments
 (0)