99 types : [created]
1010
1111jobs :
12- build-and-upload :
12+ build-assets :
1313 runs-on : ubuntu-latest
1414 permissions :
15- contents : write
15+ contents : read
16+ strategy :
17+ fail-fast : true
18+ matrix :
19+ target :
20+ - name : jar
21+ command : ./gradlew build && cp app/build/libs/app-all.jar NumberGuessingGame.jar
22+ artifact : NumberGuessingGame.jar
23+ path : ./NumberGuessingGame.jar
24+ - name : deb
25+ command : ./package-deb.sh
26+ artifact : NumberGuessingGame.deb
27+ path : ./NumberGuessingGame.deb
28+ - name : rpm
29+ command : ./package-rpm.sh
30+ artifact : NumberGuessingGame.rpm
31+ path : ./NumberGuessingGame.rpm
32+ needsRpmTools : true
33+ - name : zip
34+ command : ./package-zip.sh
35+ artifact : NumberGuessingGame-archive.zip
36+ path : ./NumberGuessingGame-archive.zip
37+ - name : windows
38+ command : ./package-win.sh
39+ artifact : NumberGuessingGame-windows.zip
40+ path : ./NumberGuessingGame-windows.zip
41+ - name : macos
42+ command : ./package-macos.sh
43+ artifact : NumberGuessingGame-macos.zip
44+ path : ./NumberGuessingGame-macos.zip
45+ - name : linux
46+ command : ./package-linux.sh
47+ artifact : NumberGuessingGame-linux.tar.xz
48+ path : ./NumberGuessingGame-linux.tar.xz
1649
1750 steps :
1851 - name : Checkout code
@@ -27,38 +60,40 @@ jobs:
2760 - name : Setup Gradle
2861 uses : gradle/actions/setup-gradle@v5
2962
30- - name : Build JAR with Gradle
31- run : ./gradlew build
32-
33- - name : Build Debian package
34- run : ./package-deb.sh
35-
3663 - name : Install RPM build tools
64+ if : ${{ matrix.target.needsRpmTools }}
3765 run : sudo apt-get update && sudo apt-get install -y rpm
3866
39- - name : Build Fedora/RPM package
40- run : ./package-rpm.sh
67+ - name : Build ${{ matrix.target.name }}
68+ run : ${{ matrix.target.command }}
4169
42- - name : Build ZIP archive
43- run : ./package-zip.sh
44-
45- - name : Build Windows package with bundled JRE
46- run : ./package-win.sh
70+ - name : Upload ${{ matrix.target.name }} artifact
71+ uses : actions/upload-artifact@v6
72+ with :
73+ name : ${{ matrix.target.artifact }}
74+ path : ${{ matrix.target.path }}
75+ if-no-files-found : error
4776
48- - name : Build macOS package with bundled JRE
49- run : ./package-macos.sh
77+ create-release :
78+ runs-on : ubuntu-latest
79+ needs : build-assets
80+ permissions :
81+ contents : write
5082
51- - name : Build Linux package with bundled JRE
52- run : ./package-linux.sh
83+ steps :
84+ - name : Download artifacts
85+ uses : actions/download-artifact@v7
86+ with :
87+ path : dist
5388
5489 - name : Upload release assets
5590 uses : softprops/action-gh-release@v2
5691 with :
5792 files : |
58- ./app/build/libs/app-all .jar
59- ./numberguessinggame .deb
60- ./numberguessinggame-* .rpm
61- ./ archive.zip
62- . /NumberGuessingGame-windows.zip
63- . /NumberGuessingGame-macos.zip
64- . /NumberGuessingGame-linux.tar.xz
93+ dist/NumberGuessingGame.jar/NumberGuessingGame .jar
94+ dist/NumberGuessingGame.deb/NumberGuessingGame .deb
95+ dist/NumberGuessingGame.rpm/NumberGuessingGame .rpm
96+ dist/NumberGuessingGame-archive.zip/NumberGuessingGame- archive.zip
97+ dist/NumberGuessingGame-windows.zip /NumberGuessingGame-windows.zip
98+ dist/NumberGuessingGame-macos.zip /NumberGuessingGame-macos.zip
99+ dist/NumberGuessingGame-linux.tar.xz /NumberGuessingGame-linux.tar.xz
0 commit comments