Skip to content

Commit 318cfca

Browse files
committed
Fix windows build - update parameters
1 parent 707fdaa commit 318cfca

2 files changed

Lines changed: 14 additions & 61 deletions

File tree

.github/workflows/build-desktop.yml

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -186,48 +186,24 @@ jobs:
186186
$JAR_NAME = $jarFile.Name
187187
$APP_VERSION = ($jarFile.BaseName -replace 'desktop-client-', '') -replace '-SNAPSHOT', '' -replace '-.*', ''
188188
if ($APP_VERSION -notmatch "\.") { $APP_VERSION = "$APP_VERSION.0" }
189-
$ICON_ARG = ""
189+
$iconArgs = @()
190190
if (Test-Path "src\main\resources\icons\app-icon.ico") {
191-
$ICON_ARG = "--icon src\main\resources\icons\app-icon.ico"
191+
$iconArgs = @("--icon", "src\main\resources\icons\app-icon.ico")
192192
}
193-
jpackage --input target `
194-
--name "JSTutor" `
195-
--main-jar $JAR_NAME `
196-
--main-class com.posadskiy.javaswingtutor.Start `
197-
--type exe `
198-
--dest X:\d `
199-
--temp C:\t `
200-
--app-version $APP_VERSION `
201-
--vendor Posadskiy `
202-
--java-options "-Dfile.encoding=UTF-8" `
203-
--win-dir-chooser `
204-
--win-menu `
205-
--win-menu-group JSTutor `
206-
--win-shortcut `
207-
$ICON_ARG
208-
jpackage --input target `
209-
--name "JSTutor" `
210-
--main-jar $JAR_NAME `
211-
--main-class com.posadskiy.javaswingtutor.Start `
212-
--type app-image `
213-
--dest X:\d `
214-
--temp C:\t `
215-
--app-version $APP_VERSION `
216-
--vendor Posadskiy `
217-
--java-options "-Dfile.encoding=UTF-8" `
218-
$ICON_ARG
193+
jpackage --input target --name "JSTutor" --main-jar $JAR_NAME --main-class com.posadskiy.javaswingtutor.Start --type exe --dest X:\d --temp C:\t --app-version $APP_VERSION --vendor Posadskiy --java-options "-Dfile.encoding=UTF-8" --win-dir-chooser --win-menu --win-menu-group JSTutor --win-shortcut @iconArgs
194+
jpackage --input target --name "JSTutor" --main-jar $JAR_NAME --main-class com.posadskiy.javaswingtutor.Start --type app-image --dest X:\d --temp C:\t --app-version $APP_VERSION --vendor Posadskiy --java-options "-Dfile.encoding=UTF-8" @iconArgs
219195
if (Test-Path "X:\d\JSTutor") {
220196
Compress-Archive -Path "X:\d\JSTutor" -DestinationPath ("X:\d\JSTutor-win-${APP_VERSION}.zip") -Force
221197
}
198+
New-Item -ItemType Directory -Force -Path "$env:GITHUB_WORKSPACE\windows-installer-out" | Out-Null
199+
Copy-Item -Path "X:\d\*" -Destination "$env:GITHUB_WORKSPACE\windows-installer-out" -Recurse -Force
222200
subst X: /d
223201
224202
- name: Upload artifact
225203
uses: actions/upload-artifact@v4
226204
with:
227205
name: windows-installer
228-
path: |
229-
d/*.exe
230-
d/*.zip
206+
path: windows-installer-out/
231207
retention-days: 30
232208

233209
build-linux:

.github/workflows/release-desktop.yml

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -88,39 +88,17 @@ jobs:
8888
$JAR_NAME = $jarFile.Name
8989
$APP_VERSION = ($jarFile.BaseName -replace 'desktop-client-', '') -replace '-SNAPSHOT', '' -replace '-.*', ''
9090
if ($APP_VERSION -notmatch "\.") { $APP_VERSION = "$APP_VERSION.0" }
91-
$ICON_ARG = ""
91+
$iconArgs = @()
9292
if (Test-Path "src\main\resources\icons\app-icon.ico") {
93-
$ICON_ARG = "--icon src\main\resources\icons\app-icon.ico"
93+
$iconArgs = @("--icon", "src\main\resources\icons\app-icon.ico")
9494
}
95-
jpackage --input target `
96-
--name "JSTutor" `
97-
--main-jar $JAR_NAME `
98-
--main-class com.posadskiy.javaswingtutor.Start `
99-
--type exe `
100-
--dest X:\d `
101-
--temp C:\t `
102-
--app-version $APP_VERSION `
103-
--vendor Posadskiy `
104-
--java-options "-Dfile.encoding=UTF-8" `
105-
--win-dir-chooser `
106-
--win-menu `
107-
--win-menu-group JSTutor `
108-
--win-shortcut `
109-
$ICON_ARG
110-
jpackage --input target `
111-
--name "JSTutor" `
112-
--main-jar $JAR_NAME `
113-
--main-class com.posadskiy.javaswingtutor.Start `
114-
--type app-image `
115-
--dest X:\d `
116-
--temp C:\t `
117-
--app-version $APP_VERSION `
118-
--vendor Posadskiy `
119-
--java-options "-Dfile.encoding=UTF-8" `
120-
$ICON_ARG
95+
jpackage --input target --name "JSTutor" --main-jar $JAR_NAME --main-class com.posadskiy.javaswingtutor.Start --type exe --dest X:\d --temp C:\t --app-version $APP_VERSION --vendor Posadskiy --java-options "-Dfile.encoding=UTF-8" --win-dir-chooser --win-menu --win-menu-group JSTutor --win-shortcut @iconArgs
96+
jpackage --input target --name "JSTutor" --main-jar $JAR_NAME --main-class com.posadskiy.javaswingtutor.Start --type app-image --dest X:\d --temp C:\t --app-version $APP_VERSION --vendor Posadskiy --java-options "-Dfile.encoding=UTF-8" @iconArgs
12197
if (Test-Path "X:\d\JSTutor") {
12298
Compress-Archive -Path "X:\d\JSTutor" -DestinationPath ("X:\d\JSTutor-win-${APP_VERSION}.zip") -Force
12399
}
100+
New-Item -ItemType Directory -Force -Path "$env:GITHUB_WORKSPACE\windows-installer-out" | Out-Null
101+
Copy-Item -Path "X:\d\*" -Destination "$env:GITHUB_WORKSPACE\windows-installer-out" -Recurse -Force
124102
subst X: /d
125103
126104
- name: Build installers and portable app image (Linux)
@@ -172,8 +150,7 @@ jobs:
172150
desktop-client/target/jpackage/*.dmg
173151
desktop-client/target/jpackage/*.deb
174152
desktop-client/target/jpackage/*app-image*.zip
175-
d/*.exe
176-
d/*.zip
153+
windows-installer-out/
177154
retention-days: 30
178155

179156
bundle:

0 commit comments

Comments
 (0)