forked from k-pet-group/BlueJ-Greenfoot
-
Notifications
You must be signed in to change notification settings - Fork 0
307 lines (298 loc) · 12.4 KB
/
build-installers.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
name: Build Installers
on:
push:
paths:
- '.github/workflows/build-installers.yml'
- 'version.properties'
- 'bluej/build.gradle'
- 'greenfoot/build.gradle'
- 'bluej/package/build.xml'
- 'bluej/package/greenfoot-build.xml'
- '.env'
workflow_dispatch:
jobs:
Build-Windows-Installers:
runs-on: windows-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/[email protected]
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.java_version }}
java-package: jdk
architecture: x64
- name: Install choco packages
run: |
choco install wixtoolset -r --no-progress
choco install msys2 -r --no-progress
choco install mingw -r --no-progress
choco install sed -r --no-progress
choco install wget -r --no-progress
choco install ant -r --no-progress
- name: Check install locations
run: |
dir C:/ProgramData/mingw64/mingw64/bin
dir 'C:/Program Files/'
dir 'C:/Program Files (x86)/'
dir 'C:/Program Files (x86)/WiX Toolset v3.14/bin'
- name: Set tool locations
run: |
cd ${{ github.workspace }}
$propfile = 'tools.properties'
$java_home_forward = $env:JAVA_HOME -replace '\\', '/'
$workspace_forward = $PWD -replace '\\', '/'
(Get-Content $propfile) -replace 'mingw_root=.*', "mingw_root=C:/ProgramData/mingw64/mingw64" | Set-Content $propfile
(Get-Content $propfile) -replace 'wix_bin=.*', "wix_bin=C:/Program Files (x86)/WiX Toolset v3.14/bin" | Set-Content $propfile
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew :bluej:packageBlueJWindows :greenfoot:packageGreenfootWindows --info --stacktrace --no-daemon
- name: Archive BlueJ Windows installers
uses: actions/upload-artifact@v4
with:
name: bluej-installers-windows
path: |
bluej/package/BlueJ-windows*.msi
bluej/package/BlueJ-windows*.zip
- name: Archive Greenfoot Windows installers
uses: actions/upload-artifact@v4
with:
name: greenfoot-installers-windows
path: |
bluej/package/Greenfoot-windows*.msi
bluej/package/Greenfoot-windows*.zip
Build-Ubuntu-Installers:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/[email protected]
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.java_version }}
java-package: jdk
architecture: x64
- name: Install packages
run: |
sudo apt install fakeroot
- name: Check install locations
run: |
ls $JAVA_HOME
- name: Adjust JavaFX version on Linux
run: |
find . -name 'build.gradle' -exec sed -i '/javafx_version_setting/c\version = '\''20.0.2'\''' {} +
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew :bluej:packageBlueJLinux :greenfoot:packageGreenfootLinux --info --stacktrace --no-daemon
- name: Archive BlueJ Ubuntu installers
uses: actions/upload-artifact@v4
with:
name: bluej-installers-other
path: |
bluej/package/BlueJ-linux*.deb
bluej/package/BlueJ-generic*.jar
- name: Archive Greenfoot Ubuntu installers
uses: actions/upload-artifact@v4
with:
name: greenfoot-installers-other
path: |
bluej/package/Greenfoot-linux*.deb
bluej/package/Greenfoot-generic*.jar
Build-Mac-Installers-Intel:
runs-on: macos-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/[email protected]
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.java_version }}
java-package: jdk
architecture: x64
- name: Check install locations
run: |
ls $JAVA_HOME
- name: Run setup
run: |
brew install grep
brew install imagemagick
brew install [email protected]
export PATH=/usr/local/opt/[email protected]/libexec/bin:$PATH
brew install npm && npm install -g appdmg
cd ${{ github.workspace }}
echo 'ant_exe=ant' > tools.properties
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: Vh4o2zhsnBE5f
run: |
# From https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew :bluej:packageBlueJMacIntel :greenfoot:packageGreenfootMacIntel --info --stacktrace --no-daemon
- name: Sign and package
run: |
cd ${{ github.workspace }}
cd bluej/package
mkdir tmpsign
cd tmpsign
bash ../sign-mac.sh ${{ secrets.DEVELOPER_NAME }} ../BlueJ-mac*.zip ${{ secrets.APPLEID_EMAIL }} ${{ secrets.APPLEID_PASSWORD }} ${{ secrets.APPLEID_TEAMID }} `basename ../BlueJ-mac*.zip .zip`.dmg bluej_appdmg.json bluej-installer-icon
bash ../sign-mac.sh ${{ secrets.DEVELOPER_NAME }} ../Greenfoot-mac*.zip ${{ secrets.APPLEID_EMAIL }} ${{ secrets.APPLEID_PASSWORD }} ${{ secrets.APPLEID_TEAMID }} `basename ../Greenfoot-mac*.zip .zip`.dmg greenfoot_appdmg.json greenfoot-installer-icon
- name: Archive BlueJ Mac installers
uses: actions/upload-artifact@v4
with:
name: bluej-installers-mac-intel
path: |
bluej/package/BlueJ*.dmg
- name: Archive Greenfoot Mac installers
uses: actions/upload-artifact@v4
with:
name: greenfoot-installers-mac-intel
path: |
bluej/package/Greenfoot*.dmg
Build-Mac-Installers-Aarch:
runs-on: macos-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/[email protected]
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.java_version }}
java-package: jdk
architecture: aarch64
- name: Check install locations
run: |
ls $JAVA_HOME
- name: Run setup
run: |
brew install grep
brew install imagemagick
brew install [email protected]
export PATH=/usr/local/opt/[email protected]/libexec/bin:$PATH
brew install npm && npm install -g appdmg
cd ${{ github.workspace }}
echo 'ant_exe=ant' > tools.properties
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: Vh4o2zhsnBE5f
run: |
# From https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew :bluej:packageBlueJMacAarch :greenfoot:packageGreenfootMacAarch --info --stacktrace --no-daemon
- name: Sign and package
run: |
cd ${{ github.workspace }}
cd bluej/package
mkdir tmpsign
cd tmpsign
bash ../sign-mac.sh ${{ secrets.DEVELOPER_NAME }} ../BlueJ-mac*.zip ${{ secrets.APPLEID_EMAIL }} ${{ secrets.APPLEID_PASSWORD }} ${{ secrets.APPLEID_TEAMID }} `basename ../BlueJ-mac*.zip .zip`.dmg bluej_appdmg.json bluej-installer-icon
bash ../sign-mac.sh ${{ secrets.DEVELOPER_NAME }} ../Greenfoot-mac*.zip ${{ secrets.APPLEID_EMAIL }} ${{ secrets.APPLEID_PASSWORD }} ${{ secrets.APPLEID_TEAMID }} `basename ../Greenfoot-mac*.zip .zip`.dmg greenfoot_appdmg.json greenfoot-installer-icon
- name: Archive BlueJ Mac installers
uses: actions/upload-artifact@v4
with:
name: bluej-installers-mac-aarch
path: |
bluej/package/BlueJ*.dmg
- name: Archive Greenfoot Mac installers
uses: actions/upload-artifact@v4
with:
name: greenfoot-installers-mac-aarch
path: |
bluej/package/Greenfoot*.dmg
Build-UbuntuARM64-Installers:
runs-on: LinuxARM64
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/[email protected]
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.java_version }}
java-package: jdk
architecture: aarch64
- name: Install packages
run: |
sudo apt install fakeroot
- name: Check install locations
run: |
ls $JAVA_HOME
- name: Adjust JavaFX version on Linux
run: |
find . -name 'build.gradle' -exec sed -i '/javafx_version_setting/c\version = '\''22.0.1'\''' {} +
- name: Adjust architecture target on ARM64
run: |
find . -name 'control' -exec sed -i '/Architecture:/c\Architecture: arm64' {} +
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew :bluej:packageBlueJLinux :greenfoot:packageGreenfootLinux --info --stacktrace --no-daemon
- name: Archive BlueJ Ubuntu installers
uses: actions/upload-artifact@v4
with:
name: bluej-installers-arm64
path: |
bluej/package/BlueJ-linux*.deb
- name: Archive Greenfoot Ubuntu installers
uses: actions/upload-artifact@v4
with:
name: greenfoot-installers-arm64
path: |
bluej/package/Greenfoot-linux*.deb