|
1 | | -name: CI/CD Pipeline |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
| 4 | + pull_request: |
4 | 5 | push: |
5 | 6 | branches: [main, develop] |
6 | | - tags: ['v*'] |
7 | | - pull_request: |
8 | | - branches: [main] |
9 | 7 |
|
10 | 8 | env: |
11 | 9 | BUILD_TYPE: Release |
| 10 | + EMBREE_VERSION: 4.4.0 |
| 11 | + TBB_VERSION: 2021.11.0 |
12 | 12 |
|
13 | 13 | jobs: |
14 | | - # ========================================================================== |
15 | | - # Version Extraction |
16 | | - # ========================================================================== |
17 | | - version: |
18 | | - name: Extract Version |
19 | | - runs-on: ubuntu-latest |
20 | | - outputs: |
21 | | - version: ${{ steps.version.outputs.version }} |
22 | | - version_full: ${{ steps.version.outputs.version_full }} |
23 | | - steps: |
24 | | - - uses: actions/checkout@v4 |
25 | | - with: |
26 | | - fetch-depth: 0 |
27 | | - |
28 | | - - name: Get version from VERSION file |
29 | | - id: version |
30 | | - run: | |
31 | | - VERSION=$(cat VERSION | tr -d '\n\r') |
32 | | - echo "version=$VERSION" >> $GITHUB_OUTPUT |
33 | | - |
34 | | - if [[ "${{ github.ref }}" == refs/tags/v* ]]; then |
35 | | - TAG_VERSION="${GITHUB_REF#refs/tags/v}" |
36 | | - echo "version_full=$TAG_VERSION" >> $GITHUB_OUTPUT |
37 | | - elif [[ "${{ github.ref }}" == refs/heads/* ]]; then |
38 | | - BRANCH="${GITHUB_REF#refs/heads/}" |
39 | | - SHORT_SHA="${GITHUB_SHA::7}" |
40 | | - echo "version_full=$VERSION-$BRANCH-$SHORT_SHA" >> $GITHUB_OUTPUT |
41 | | - else |
42 | | - echo "version_full=$VERSION-dev" >> $GITHUB_OUTPUT |
43 | | - fi |
44 | | -
|
45 | | - # ========================================================================== |
46 | | - # Build Jobs |
47 | | - # ========================================================================== |
48 | 14 | build: |
49 | 15 | name: Build (${{ matrix.os }}) |
50 | | - needs: version |
51 | 16 | runs-on: ${{ matrix.os }} |
52 | 17 | strategy: |
53 | 18 | fail-fast: false |
54 | 19 | matrix: |
55 | | - include: |
56 | | - - os: ubuntu-22.04 |
57 | | - artifact_name: vibeymaptools-linux |
58 | | - archive_ext: .tar.gz |
59 | | - - os: windows-2022 |
60 | | - artifact_name: vibeymaptools-windows |
61 | | - archive_ext: .zip |
62 | | - - os: macos-14 |
63 | | - artifact_name: vibeymaptools-macos |
64 | | - archive_ext: .tar.gz |
| 20 | + os: [ubuntu-22.04, macos-14, windows-2022] |
65 | 21 |
|
66 | 22 | steps: |
67 | 23 | - uses: actions/checkout@v4 |
68 | 24 | with: |
69 | 25 | submodules: recursive |
70 | 26 | fetch-depth: 0 |
71 | 27 |
|
72 | | - # ---- Linux Setup ---- |
73 | | - - name: 'Linux: Install dependencies' |
| 28 | + - name: Linux dependencies |
74 | 29 | if: startsWith(matrix.os, 'ubuntu-') |
75 | 30 | run: | |
76 | 31 | sudo apt update |
77 | | - sudo apt install -y qt6-base-dev libgl1-mesa-dev libtbb-dev libembree-dev |
| 32 | + sudo apt install -y qt6-base-dev libgl1-mesa-dev |
78 | 33 |
|
79 | | - # ---- macOS Setup ---- |
80 | | - - name: 'macOS: Install Qt6' |
| 34 | + - name: Linux Embree and TBB |
| 35 | + if: startsWith(matrix.os, 'ubuntu-') |
| 36 | + run: | |
| 37 | + mkdir -p deps/embree |
| 38 | + curl -L "https://github.com/RenderKit/embree/releases/download/v${{ env.EMBREE_VERSION }}/embree-${{ env.EMBREE_VERSION }}.x86_64.linux.tar.gz" -o deps/embree.tgz |
| 39 | + tar xf deps/embree.tgz -C deps/embree |
| 40 | + curl -L "https://github.com/uxlfoundation/oneTBB/releases/download/v${{ env.TBB_VERSION }}/oneapi-tbb-${{ env.TBB_VERSION }}-lin.tgz" -o deps/tbb.tgz |
| 41 | + tar xf deps/tbb.tgz -C deps |
| 42 | + echo "CMAKE_PREFIX_PATH=${PWD}/deps/embree;${PWD}/deps/oneapi-tbb-${{ env.TBB_VERSION }}" >> $GITHUB_ENV |
| 43 | +
|
| 44 | + - name: macOS Qt |
81 | 45 | if: startsWith(matrix.os, 'macos-') |
82 | 46 | uses: jurplel/install-qt-action@v4 |
83 | 47 | with: |
84 | | - version: 6.4.3 |
| 48 | + version: 6.7.0 |
85 | 49 |
|
86 | | - - name: 'macOS: Install dependencies' |
| 50 | + - name: macOS dependencies |
87 | 51 | if: startsWith(matrix.os, 'macos-') |
88 | 52 | run: | |
89 | | - brew install tbb embree |
| 53 | + brew update |
| 54 | + brew install embree tbb |
| 55 | + PREFIXES="$(brew --prefix embree);$(brew --prefix tbb)" |
| 56 | + if [ -n "${Qt6_DIR}" ]; then |
| 57 | + PREFIXES="${PREFIXES};${Qt6_DIR}" |
| 58 | + fi |
| 59 | + echo "CMAKE_PREFIX_PATH=${PREFIXES}" >> $GITHUB_ENV |
90 | 60 |
|
91 | | - # ---- Windows Setup ---- |
92 | | - - name: 'Windows: Setup MSVC' |
| 61 | + - name: Windows MSVC |
93 | 62 | if: startsWith(matrix.os, 'windows-') |
94 | 63 | uses: ilammy/msvc-dev-cmd@v1 |
95 | 64 |
|
96 | | - - name: 'Windows: Install Qt6' |
| 65 | + - name: Windows Qt |
97 | 66 | if: startsWith(matrix.os, 'windows-') |
98 | 67 | uses: jurplel/install-qt-action@v4 |
99 | 68 | with: |
100 | 69 | version: 6.7.0 |
101 | 70 |
|
102 | | - # ---- Build ---- |
103 | | - - name: Configure CMake |
| 71 | + - name: Windows Embree and TBB |
| 72 | + if: startsWith(matrix.os, 'windows-') |
| 73 | + shell: pwsh |
104 | 74 | run: | |
105 | | - cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} |
| 75 | + $ErrorActionPreference = "Stop" |
| 76 | + $deps = Join-Path $env:GITHUB_WORKSPACE "deps" |
| 77 | + New-Item -ItemType Directory -Force -Path $deps | Out-Null |
| 78 | + $embreeZip = Join-Path $deps "embree.zip" |
| 79 | + Invoke-WebRequest "https://github.com/RenderKit/embree/releases/download/v${{ env.EMBREE_VERSION }}/embree-${{ env.EMBREE_VERSION }}.x64.windows.zip" -OutFile $embreeZip |
| 80 | + $embreeRoot = Join-Path $deps "embree" |
| 81 | + New-Item -ItemType Directory -Force -Path $embreeRoot | Out-Null |
| 82 | + Expand-Archive -Path $embreeZip -DestinationPath $embreeRoot -Force |
| 83 | + $tbbZip = Join-Path $deps "tbb.zip" |
| 84 | + Invoke-WebRequest "https://github.com/uxlfoundation/oneTBB/releases/download/v${{ env.TBB_VERSION }}/oneapi-tbb-${{ env.TBB_VERSION }}-win.zip" -OutFile $tbbZip |
| 85 | + Expand-Archive -Path $tbbZip -DestinationPath $deps -Force |
| 86 | + $prefixes = @($embreeRoot, (Join-Path $deps "oneapi-tbb-${{ env.TBB_VERSION }}")) |
| 87 | + if ($env:Qt6_DIR) { $prefixes += $env:Qt6_DIR } |
| 88 | + "CMAKE_PREFIX_PATH=$($prefixes -join ';')" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding ascii |
| 89 | +
|
| 90 | + - name: Configure CMake |
| 91 | + run: cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_PREFIX_PATH="${{ env.CMAKE_PREFIX_PATH }}" |
106 | 92 |
|
107 | 93 | - name: Build |
108 | 94 | run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel |
109 | 95 |
|
110 | | - - name: Run Tests |
| 96 | + - name: Test |
111 | 97 | run: ctest --test-dir build --output-on-failure --build-config ${{ env.BUILD_TYPE }} |
112 | | - |
113 | | - - name: Package |
114 | | - run: cmake --build build --target package --config ${{ env.BUILD_TYPE }} |
115 | | - |
116 | | - # ---- Upload Artifacts ---- |
117 | | - - name: Upload Artifact |
118 | | - uses: actions/upload-artifact@v4 |
119 | | - with: |
120 | | - name: ${{ matrix.artifact_name }}-${{ needs.version.outputs.version_full }} |
121 | | - path: build/VibeyMapTools-*${{ matrix.archive_ext }} |
122 | | - if-no-files-found: warn |
123 | | - |
124 | | - # ========================================================================== |
125 | | - # Release Job |
126 | | - # ========================================================================== |
127 | | - release: |
128 | | - name: Create Release |
129 | | - needs: [version, build] |
130 | | - if: startsWith(github.ref, 'refs/tags/v') |
131 | | - runs-on: ubuntu-latest |
132 | | - permissions: |
133 | | - contents: write |
134 | | - |
135 | | - steps: |
136 | | - - uses: actions/checkout@v4 |
137 | | - |
138 | | - - name: Download all artifacts |
139 | | - uses: actions/download-artifact@v4 |
140 | | - with: |
141 | | - path: artifacts |
142 | | - |
143 | | - - name: Generate Release Notes |
144 | | - id: notes |
145 | | - run: | |
146 | | - VERSION="${{ needs.version.outputs.version }}" |
147 | | - cat << 'EOF' > release_notes.md |
148 | | - # VibeyMapTools ${{ needs.version.outputs.version }} |
149 | | - |
150 | | - ## Downloads |
151 | | - |
152 | | - | Platform | Download | |
153 | | - |----------|----------| |
154 | | - | Windows | `vibeymaptools-windows-${{ needs.version.outputs.version_full }}.zip` | |
155 | | - | Linux | `vibeymaptools-linux-${{ needs.version.outputs.version_full }}.tar.gz` | |
156 | | - | macOS | `vibeymaptools-macos-${{ needs.version.outputs.version_full }}.tar.gz` | |
157 | | - |
158 | | - ## What's New |
159 | | - |
160 | | - See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details. |
161 | | - |
162 | | - ## Features |
163 | | - |
164 | | - - GPU-accelerated raytracing (OptiX) |
165 | | - - Intel OIDN denoising |
166 | | - - Stochastic light sampling |
167 | | - - Incremental lighting |
168 | | - - HDR lightmap support |
169 | | - EOF |
170 | | -
|
171 | | - - name: Create GitHub Release |
172 | | - uses: softprops/action-gh-release@v2 |
173 | | - with: |
174 | | - name: VibeyMapTools ${{ needs.version.outputs.version }} |
175 | | - body_path: release_notes.md |
176 | | - draft: true |
177 | | - prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }} |
178 | | - files: | |
179 | | - artifacts/**/* |
180 | | -
|
181 | | - # ========================================================================== |
182 | | - # Nightly Build |
183 | | - # ========================================================================== |
184 | | - nightly: |
185 | | - name: Nightly Build |
186 | | - if: github.event_name == 'schedule' || (github.event_name == 'push' && github.ref == 'refs/heads/main') |
187 | | - needs: [version, build] |
188 | | - runs-on: ubuntu-latest |
189 | | - permissions: |
190 | | - contents: write |
191 | | - |
192 | | - steps: |
193 | | - - uses: actions/checkout@v4 |
194 | | - |
195 | | - - name: Download all artifacts |
196 | | - uses: actions/download-artifact@v4 |
197 | | - with: |
198 | | - path: artifacts |
199 | | - |
200 | | - - name: Update Nightly Release |
201 | | - uses: andelf/nightly-release@main |
202 | | - env: |
203 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
204 | | - with: |
205 | | - tag_name: nightly |
206 | | - name: 'Nightly Build' |
207 | | - prerelease: true |
208 | | - body: | |
209 | | - Automated nightly build from main branch. |
210 | | - Version: ${{ needs.version.outputs.version_full }} |
211 | | - Commit: ${{ github.sha }} |
212 | | - files: | |
213 | | - artifacts/**/* |
0 commit comments