1
+ name : Build and Release
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - ' v*'
7
+
8
+ jobs :
9
+ build-artifacts :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout repository
13
+ uses : actions/checkout@v4
14
+
15
+ - name : Set up JDK
16
+ uses : actions/setup-java@v3
17
+ with :
18
+ distribution : ' temurin'
19
+ java-version : ' 21'
20
+
21
+ - name : Set up Gradle
22
+ uses : gradle/gradle-build-action@v2
23
+
24
+ - name : Build JAR, ShadowJAR and WAR
25
+ run : ./gradlew build shadowJar :webapp:shadowJar :webapp:war
26
+
27
+ - name : Upload artifacts (.jar and .war)
28
+ uses : actions/upload-artifact@v4
29
+ with :
30
+ name : jars-and-wars
31
+ path : |
32
+ build/libs/*.jar
33
+ build/libs/*.war
34
+ webapp/build/libs/*.jar
35
+ webapp/build/libs/*.war
36
+
37
+ - name : Create GitHub Release with JAR/WAR files
38
+ uses : softprops/action-gh-release@v1
39
+ with :
40
+ files : |
41
+ build/libs/*.jar
42
+ build/libs/*.war
43
+ webapp/build/libs/*.war
44
+ webapp/build/libs/*.jar
45
+ env :
46
+ GITHUB_TOKEN : ${{ secrets.GH_PAT }}
47
+
48
+ build-exe :
49
+ runs-on : windows-latest
50
+ needs : build-artifacts
51
+ steps :
52
+ - name : Checkout repository
53
+ uses : actions/checkout@v4
54
+
55
+ - name : Set up JDK
56
+ uses : actions/setup-java@v3
57
+ with :
58
+ distribution : ' temurin'
59
+ java-version : ' 21'
60
+
61
+ - name : Download and extract WiX Toolset 3.11
62
+ run : |
63
+ Invoke-WebRequest -Uri https://github.com/wixtoolset/wix3/releases/download/wix3111rtm/wix311-binaries.zip -OutFile wix.zip
64
+ Expand-Archive wix.zip -DestinationPath "$env:ProgramFiles\wix"
65
+ echo "$env:ProgramFiles\wix" | Out-File -Append -Encoding ascii $env:GITHUB_PATH
66
+ shell : pwsh
67
+
68
+ - name : Set up Gradle
69
+ uses : gradle/gradle-build-action@v2
70
+
71
+ - name : Run createEXE task with debug output
72
+ run : ./gradlew createEXE
73
+
74
+ - name : Upload EXE Installer
75
+ uses : actions/upload-artifact@v4
76
+ with :
77
+ name : windows-installer
78
+ path : build/**/*.exe
79
+
80
+ - name : Add EXE to GitHub Release
81
+ uses : softprops/action-gh-release@v1
82
+ with :
83
+ files : build/**/*.exe
84
+ env :
85
+ GITHUB_TOKEN : ${{ secrets.GH_PAT }}
0 commit comments