-
Notifications
You must be signed in to change notification settings - Fork 219
124 lines (114 loc) · 4.22 KB
/
bundles-mac_aarch64.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: MacOs 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:
CERTIFICATES_FILE_BASE64:
required: true
CERTIFICATES_PASSWORD:
required: true
NOTARIZATION_USERNAME:
required: true
NOTARIZATION_PASSWORD:
required: true
MACSIGN_USER:
required: true
MACSIGN_PREFIX:
required: true
jobs:
build:
name: macOS on M1
runs-on: macos-14
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 }}
- uses: Apple-Actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.CERTIFICATES_FILE_BASE64 }}
p12-password: ${{ secrets.CERTIFICATES_PASSWORD }}
- name: Setup JavaFX
id: javafx
run: |
JAVAFX_MAJOR_VERSION=$(echo ${{ inputs.javafx-version }} | cut -d- -f1)
echo JAVAFX_MAJOR_VERSION=$JAVAFX_MAJOR_VERSION >> $GITHUB_OUTPUT
wget -P /tmp https://download2.gluonhq.com/openjfx/$JAVAFX_MAJOR_VERSION/openjfx-${{ inputs.javafx-version }}_osx-aarch64_bin-jmods.zip
unzip /tmp/openjfx-${{ inputs.javafx-version }}_osx-aarch64_bin-jmods.zip -d /tmp
- 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
run: |
mvn -B -ntp -q versions:set -DnewVersion=${{ env.APP_VERSION }} -DgenerateBackupPoms=false
mvn -B -ntp -q clean package -Dmaven.test.skip=true
env:
APP_VERSION: ${{ inputs.app-version }}
- name: Create Bundle using JPackage
id: outputfile
run: |
.github/scripts/jpackage.sh \
--icon app/assets/osx/icon-mac.icns \
--java-options '"--add-opens=javafx.fxml/javafx.fxml=ALL-UNNAMED"' \
--type dmg \
--mac-package-identifier com.gluonhq.scenebuilder \
--mac-package-name 'Scene Builder' \
--mac-package-signing-prefix "${{ env.MACSIGN_PREFIX }}" \
--mac-signing-key-user-name "${{ env.MACSIGN_USER }}" \
--mac-sign
mv ${{ env.INSTALL_DIR }}/SceneBuilder-${{ env.APP_VERSION }}.dmg ${{ env.INSTALL_DIR }}/SceneBuilder-${{ env.PROJECT_VERSION }}-aarch64.dmg
ls ${{ env.INSTALL_DIR }}
echo path=${{ env.INSTALL_DIR }}/SceneBuilder-${{ env.PROJECT_VERSION }}-aarch64.dmg >> $GITHUB_OUTPUT
env:
MAIN_CLASS: com.oracle.javafx.scenebuilder.app.SceneBuilderApp
JAVAFX_HOME: /tmp/javafx-jmods-${{ steps.javafx.outputs.JAVAFX_MAJOR_VERSION }}/
JPACKAGE_HOME: ${{ env.JAVA_HOME }}
MACSIGN_PREFIX: ${{ secrets.MACSIGN_PREFIX }}
MACSIGN_USER: ${{ secrets.MACSIGN_USER }}
PROJECT_VERSION: ${{ inputs.project-version }}
APP_VERSION: ${{ inputs.app-version }}
INSTALL_DIR: app/target/install
- name: Notarize Release Build
uses: erwin1/xcode-notarizer@v1
with:
product-path: ${{ steps.outputfile.outputs.path }}
apple-id: ${{ secrets.NOTARIZATION_USERNAME }}
app-password: ${{ secrets.NOTARIZATION_PASSWORD }}
team-id: ${{ secrets.MACSIGN_PREFIX }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: SceneBuilder-${{ inputs.project-version }}-aarch64.dmg
path: ${{ steps.outputfile.outputs.path }}