-
Notifications
You must be signed in to change notification settings - Fork 219
105 lines (95 loc) · 3.33 KB
/
bundles-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Windows Bundles
on:
workflow_call:
inputs:
app-version:
required: true
type: string
project-version:
required: true
type: string
java-release:
default: '23'
required: false
type: string
java-version:
default: '23.0.1'
required: false
type: string
javafx-version:
default: '23.0.1'
required: false
type: string
test:
default: false
required: false
type: boolean
secrets:
WINDOWS_CERTIFICATE:
required: true
WINDOWS_PASSWORD:
required: true
WINDOWS_CERTNAME:
required: true
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: oracle-actions/[email protected]
with:
website: jdk.java.net
release: ${{ inputs.java-release }}
version: ${{ inputs.java-version }}
- name: Setup JavaFX
id: javafx
shell: pwsh
run: |
$JAVAFX_MAJOR_VERSION = '${{ inputs.javafx-version }}' -split '-' | Select-Object -Index 0
echo "JAVAFX_MAJOR_VERSION=$JAVAFX_MAJOR_VERSION" >> $env:GITHUB_OUTPUT
Invoke-WebRequest -Uri https://download2.gluonhq.com/openjfx/$JAVAFX_MAJOR_VERSION/openjfx-${{ inputs.javafx-version }}_windows-x64_bin-jmods.zip -OutFile D:\openjfx-${{ inputs.javafx-version }}_windows-x64_bin-jmods.zip
Expand-Archive -Force D:\openjfx-${{ inputs.javafx-version }}_windows-x64_bin-jmods.zip D:\
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Run Tests
if: ${{ inputs.test }}
run: |
mvn -B -ntp clean verify checkstyle:checkstyle --no-transfer-progress
- name: Build and package JAR
shell: cmd
run: |
call mvn -B -ntp versions:set -DnewVersion=${{ env.APP_VERSION }} -DgenerateBackupPoms=false
call mvn -B -ntp package -Dmaven.test.skip=true
env:
APP_VERSION: ${{ inputs.app-version }}
- name: Create Bundle using JPackage
shell: cmd
run: |
call .github\scripts\jpackage.bat
call ren ${{ env.INSTALL_DIR }}\SceneBuilder-${{ env.APP_VERSION }}.msi SceneBuilder-${{ env.PROJECT_VERSION }}.msi
call dir ${{ env.INSTALL_DIR }}
env:
MAIN_CLASS: com.oracle.javafx.scenebuilder.app.SceneBuilderApp
JAVAFX_HOME: D:\javafx-jmods-${{ steps.javafx.outputs.JAVAFX_MAJOR_VERSION }}
JPACKAGE_HOME: ${{ env.JAVA_HOME }}
PROJECT_VERSION: ${{ inputs.project-version }}
APP_VERSION: ${{ inputs.app-version }}
INSTALL_DIR: app\target\install
- name: Codesign
uses: erwin1/code-sign-action@master
if: false
with:
certificate: '${{ secrets.WINDOWS_CERTIFICATE }}'
password: '${{ secrets.WINDOWS_PASSWORD }}'
certificatename: '${{ secrets.WINDOWS_CERTNAME }}'
folder: 'app/target/install'
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: SceneBuilder-${{ inputs.project-version }}.msi
path: app/target/install/*.msi