@@ -12,7 +12,7 @@ permissions:
1212 contents : write
1313
1414jobs :
15- build-windows-exe :
15+ build-windows-zip :
1616 runs-on : windows-latest
1717 steps :
1818 - name : Checkout
@@ -31,39 +31,10 @@ jobs:
3131 distribution : temurin
3232 java-version : " 17"
3333
34- - name : Install WiX Toolset
35- shell : powershell
36- run : choco install wixtoolset --no-progress -y
37-
38- - name : Add WiX to PATH
39- shell : powershell
40- run : |
41- $candle = Get-Command candle.exe -ErrorAction SilentlyContinue
42- if ($candle) {
43- $wixBin = Split-Path $candle.Source
44- } else {
45- $candidates = @(
46- "$env:ProgramFiles(x86)\WiX Toolset v3.14\bin",
47- "$env:ProgramFiles(x86)\WiX Toolset v3.11\bin",
48- "$env:ProgramFiles(x86)\WiX Toolset v3.10\bin",
49- "$env:ProgramFiles\WiX Toolset v3.14\bin"
50- )
51- $wixBin = $candidates | Where-Object { Test-Path (Join-Path $_ 'candle.exe') } | Select-Object -First 1
52- }
53-
54- if (-not $wixBin) {
55- throw "WiX Toolset was installed but candle.exe was not found."
56- }
57-
58- $wixBin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
59- Write-Host "WiX bin path added: $wixBin"
60-
6134 - name : Verify packaging tools
6235 shell : powershell
6336 run : |
6437 where.exe jpackage
65- where.exe candle.exe
66- where.exe light.exe
6738
6839 - name : Build shaded jar
6940 shell : cmd
@@ -100,50 +71,14 @@ jobs:
10071 -DestinationPath dist/MyNoSQL-${{ steps.app_version.outputs.version }}-windows-app.zip `
10172 -Force
10273
103- - name : Create EXE with jpackage
104- shell : powershell
105- run : |
106- $jar = Get-ChildItem target -Filter 'mynosql-*.jar' |
107- Where-Object { $_.Name -notlike 'original-*' } |
108- Select-Object -First 1
109-
110- if (-not $jar) {
111- throw "Could not find packaged JAR in target/."
112- }
113-
114- New-Item -Path dist -ItemType Directory -Force | Out-Null
115-
116- jpackage `
117- --type exe `
118- --name MyNoSQL `
119- --input target `
120- --main-jar $jar.Name `
121- --main-class com.mynosql.Main `
122- --dest dist `
123- --win-console
124-
125- $exe = Get-ChildItem dist -Filter '*.exe' | Select-Object -First 1
126- if (-not $exe) {
127- throw "Could not find generated EXE in dist/."
128- }
129-
130- Rename-Item `
131- -Path $exe.FullName `
132- -NewName ("MyNoSQL-{0}-setup.exe" -f "${{ steps.app_version.outputs.version }}") `
133- -Force
134-
135- - name : Upload Windows artifacts
74+ - name : Upload Windows ZIP artifact
13675 uses : actions/upload-artifact@v4
13776 with :
138- name : mynosql-windows-release
139- path : |
140- dist/*.exe
141- dist/*.zip
77+ name : mynosql-windows-zip
78+ path : dist/*.zip
14279
143- - name : Attach Windows artifacts to GitHub release
80+ - name : Attach Windows ZIP to GitHub release
14481 if : github.event_name == 'release'
14582 uses : softprops/action-gh-release@v2
14683 with :
147- files : |
148- dist/*.exe
149- dist/*.zip
84+ files : dist/*.zip
0 commit comments