|
1 | | -name: Build |
| 1 | +name: Build and Release |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: [ master, main ] |
| 6 | + tags: |
| 7 | + - 'v*' |
6 | 8 | pull_request: |
7 | 9 | branches: [ master, main ] |
8 | 10 |
|
9 | 11 | jobs: |
10 | 12 | build-windows: |
11 | 13 | runs-on: windows-latest |
12 | | - |
13 | 14 | env: |
14 | 15 | VULKAN_SDK: C:\VulkanSDK\1.3.290.0 |
15 | | - |
16 | 16 | steps: |
17 | 17 | - uses: actions/checkout@v4 |
18 | | - with: |
19 | | - submodules: recursive |
20 | 18 |
|
21 | 19 | - name: Cache Vulkan SDK |
22 | 20 | id: cache-vulkan |
|
34 | 32 |
|
35 | 33 | - name: Clone dependencies |
36 | 34 | 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 |
40 | 39 |
|
41 | 40 | - name: Configure CMake |
42 | 41 | run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release |
|
53 | 52 | cmd /c compile_shaders.bat |
54 | 53 | } |
55 | 54 | 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