11name : CI
22
3- on : [
4- push,
5- pull_request,
6- workflow_dispatch
7- ]
3+ on :
4+ push : {}
5+ pull_request : {}
6+ workflow_dispatch :
7+ inputs :
8+ new-release-tag :
9+ description : >
10+ New Release Tag. If given, creates a (draft) full release using the given tag.
11+ type : string
12+ required : false
813
914env :
1015 # Important to pin the clang version, cause we also use it for linting
2328
2429 steps :
2530 - name : Cache Clang
26- uses : actions/cache@v3
31+ uses : actions/cache@v4
2732 id : cache-clang
2833 with :
2934 path : C:\Program Files\LLVM
@@ -55,23 +60,23 @@ jobs:
5560 steps :
5661 - name : Restore Clang Cache
5762 if : startswith(matrix.preset, 'clang')
58- uses : actions/cache/restore@v3
63+ uses : actions/cache/restore@v4
5964 with :
6065 path : C:\Program Files\LLVM
6166 key : ${{ runner.os }}-clang-${{ env.CLANG_VERSION }}
6267 fail-on-cache-miss : true
6368
6469 - name : Add MSVC to PATH
6570 if : startswith(matrix.preset, 'msvc')
66- uses : TheMrMilchmann/setup-msvc-dev@v2
71+ uses : TheMrMilchmann/setup-msvc-dev@v3
6772 with :
6873 arch : ${{ fromJSON('["x86", "x64"]')[contains(matrix.preset, 'x64')] }}
6974
7075 - name : Setup CMake and Ninja
7176 uses : lukka/get-cmake@latest
7277
7378 - name : Checkout repository and submodules
74- uses : actions/checkout@v3
79+ uses : actions/checkout@v4
7580 with :
7681 submodules : recursive
7782
8489 run : cmake --build out/build/${{ matrix.preset }} --target install
8590
8691 - name : Upload artifact
87- uses : actions/upload-artifact@v3
92+ uses : actions/upload-artifact@v4
8893 with :
8994 name : ${{ matrix.preset }}
9095 path : out/install/${{ matrix.preset }}/
@@ -150,7 +155,7 @@ jobs:
150155 # xwin does take long enough that caching's worth it
151156 - name : Restore xwin cache
152157 if : contains(matrix.preset, 'cross')
153- uses : actions/cache@v3
158+ uses : actions/cache@v4
154159 id : cache-xwin
155160 with :
156161 path : ~/xwin
@@ -169,7 +174,7 @@ jobs:
169174 --output ~/xwin
170175
171176 - name : Checkout repository and submodules
172- uses : actions/checkout@v3
177+ uses : actions/checkout@v4
173178 with :
174179 submodules : recursive
175180
@@ -187,7 +192,7 @@ jobs:
187192 run : cmake --build out/build/${{ matrix.preset }} --target install
188193
189194 - name : Upload artifact
190- uses : actions/upload-artifact@v3
195+ uses : actions/upload-artifact@v4
191196 with :
192197 name : ${{ matrix.preset }}
193198 path : out/install/${{ matrix.preset }}/
@@ -208,7 +213,7 @@ jobs:
208213
209214 steps :
210215 - name : Restore Clang Cache
211- uses : actions/cache/restore@v3
216+ uses : actions/cache/restore@v4
212217 with :
213218 path : C:\Program Files\LLVM
214219 key : ${{ runner.os }}-clang-${{ env.CLANG_VERSION }}
@@ -222,7 +227,7 @@ jobs:
222227 run : pip install pyyaml
223228
224229 - name : Checkout repository and submodules
225- uses : actions/checkout@v3
230+ uses : actions/checkout@v4
226231 with :
227232 submodules : recursive
228233
@@ -257,14 +262,14 @@ jobs:
257262
258263 steps :
259264 - name : Restore Clang Cache
260- uses : actions/cache/restore@v3
265+ uses : actions/cache/restore@v4
261266 with :
262267 path : C:\Program Files\LLVM
263268 key : ${{ runner.os }}-clang-${{ env.CLANG_VERSION }}
264269 fail-on-cache-miss : true
265270
266271 - name : Checkout repository
267- uses : actions/checkout@v3
272+ uses : actions/checkout@v4
268273
269274 - name : Run clang-format
270275 run : |
@@ -282,7 +287,59 @@ jobs:
282287
283288 steps :
284289 - name : Checkout repository
285- uses : actions/checkout@v3
290+ uses : actions/checkout@v4
286291
287292 - name : Check spelling
288293 uses : crate-ci/typos@master
294+
295+ # ==============================================================================
296+
297+ release-draft-full :
298+ runs-on : ubuntu-latest
299+ if : >
300+ github.ref == 'refs/heads/master'
301+ && github.repository == 'bl-sdk/pluginloader'
302+ && inputs.new-release-tag != ''
303+
304+ needs :
305+ - build-ubuntu
306+ - build-windows
307+ - clang-tidy
308+ - clang-format
309+ - spelling
310+
311+ permissions :
312+ contents : write
313+
314+ steps :
315+ - name : Checkout repository
316+ uses : actions/checkout@v4
317+
318+ - name : Download artifacts
319+ uses : actions/download-artifact@v4
320+ with :
321+ path : ~/releases
322+
323+ - name : Zip artifacts
324+ shell : bash
325+ run : |
326+ cd ~/releases
327+ for folder in */ ; do
328+ cd "$folder"
329+ zip -r "${folder%/}.zip" .
330+ cd ..
331+ done
332+
333+ - name : Create new release tag
334+ uses : rickstaa/action-create-tag@v1
335+ with :
336+ tag : ${{ inputs.new-release-tag }}
337+
338+ - name : Upload releases
339+ uses : softprops/action-gh-release@v1
340+ with :
341+ tag_name : ${{ inputs.new-release-tag }}
342+ files : " /home/runner/releases/*/*.zip"
343+ fail_on_unmatched_files : true
344+ draft : true
345+ generate_release_notes : true
0 commit comments