-
Notifications
You must be signed in to change notification settings - Fork 185
477 lines (455 loc) · 19.2 KB
/
release_build_extended_services.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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
name: "Release :: Build (Extended Services)"
on:
workflow_dispatch:
inputs:
dry_run:
type: boolean
required: true
description: "Dry run mode"
base_ref:
type: string
required: true
description: "Base reference for the checkout"
release_candidate_version:
type: string
required: true
description: "Release candidate version"
drools_repository:
required: true
description: "Drools artifacts repository"
kogito_runtimes_repository:
required: true
description: "Kogito runtimes artifacts repository"
kogito_apps_repository:
required: true
description: "Kogito apps artifacts repository"
jitexecutor_native_macos_repository:
required: true
description: "JITExecutor native macOS artifacts repository"
jitexecutor_native_windows_repository:
required: true
description: "JITExecutor native windows artifacts repository"
env:
KIE_TOOLS_BUILD__runLinters: "false"
KIE_TOOLS_BUILD__runTests: "false"
KIE_TOOLS_BUILD__runEndToEndTests: "false"
KIE_TOOLS_BUILD__buildContainerImages: "true"
jobs:
extended_services_build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13, windows-latest]
steps:
- name: "Support longpaths (Windows only)"
if: runner.os == 'Windows'
run: git config --system core.longpaths true
- name: "Checkout @ GitHub default"
uses: actions/checkout@v3
- name: "Checkout @ Simulated squashed-merge if PR"
uses: ./.github/actions/checkout-pr
with:
ref: ${{ inputs.base_ref }}
- name: "Setup environment"
id: setup_env
uses: ./.github/actions/setup-env
- name: Setup maven settings (MacOS)
if: runner.os == 'macOS'
env:
WORKDIR_PATH: ${{ github.workspace }}
DROOLS_REPO: ${{ github.event.inputs.drools_repository }}
KOGITO_RUNTIMES_REPO: ${{ github.event.inputs.kogito_runtimes_repository }}
KOGITO_APPS_REPO: ${{ github.event.inputs.kogito_apps_repository }}
JITEXECUTOR_NATIVE_REPO: ${{ github.event.inputs.jitexecutor_native_macos_repository }}
run: |
mkdir -p ${WORKDIR_PATH}/.m2
echo "<settings>
<servers>
<server>
<id>apache.snapshots.https</id>
<username>${{ secrets.NEXUS_USER }}</username>
<password>${{ secrets.NEXUS_PW }}</password>
</server>
</servers>
<profiles>
<profile>
<id>additional_repos</id>
<repositories>
<repository>
<id>apache-kie-drools-staging-repository</id>
<name>Apache KIE Drools Staging Repository</name>
<url>${DROOLS_REPO}</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>apache-kie-kogito-runtimes-staging-repository</id>
<name>Apache KIE Kogito Runtimes Staging Repository</name>
<url>${KOGITO_RUNTIMES_REPO}</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>apache-kie-kogito-apps-staging-repository</id>
<name>Apache KIE Kogito Apps Staging Repository</name>
<url>${KOGITO_APPS_REPO}</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>apache-kie-jitexecutor-native-staging-repository</id>
<name>Apache KIE JITExecutor Native Staging Repository</name>
<url>${JITEXECUTOR_NATIVE_REPO}</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>apache-kie-drools-staging-repository</id>
<name>Apache KIE Drools Staging Repository</name>
<url>${DROOLS_REPO}</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>apache-kie-kogito-runtimes-staging-repository</id>
<name>Apache KIE Kogito Runtimes Staging Repository</name>
<url>${KOGITO_RUNTIMES_REPO}</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>apache-kie-kogito-apps-staging-repository</id>
<name>Apache KIE Kogito Apps Staging Repository</name>
<url>${KOGITO_APPS_REPO}</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>apache-kie-jitexecutor-native-staging-repository</id>
<name>Apache KIE JITExecutor Native Staging Repository</name>
<url>${JITEXECUTOR_NATIVE_REPO}</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>additional_repos</activeProfile>
</activeProfiles>
</settings>" > ${WORKDIR_PATH}/.m2/settings.xml
- name: Setup maven settings (Windows)
if: runner.os == 'Windows'
env:
WORKDIR_PATH: ${{ github.workspace }}
DROOLS_REPO: ${{ github.event.inputs.drools_repository }}
KOGITO_RUNTIMES_REPO: ${{ github.event.inputs.kogito_runtimes_repository }}
KOGITO_APPS_REPO: ${{ github.event.inputs.kogito_apps_repository }}
JITEXECUTOR_NATIVE_REPO: ${{ github.event.inputs.jitexecutor_native_windows_repository }}
shell: pwsh
run: |
New-Item -Name ".m2" -Path "$env:WORKDIR_PATH" -ItemType Directory
$contentToAdd = @"
<settings>
<servers>
<server>
<id>apache.snapshots.https</id>
<username>${{ secrets.NEXUS_USER }}</username>
<password>${{ secrets.NEXUS_PW }}</password>
</server>
</servers>
<profiles>
<profile>
<id>additional_repos</id>
<repositories>
<repository>
<id>apache-kie-drools-staging-repository</id>
<name>Apache KIE Drools Staging Repository</name>
<url>$env:DROOLS_REPO</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>apache-kie-kogito-runtimes-staging-repository</id>
<name>Apache KIE Kogito Runtimes Staging Repository</name>
<url>$env:KOGITO_RUNTIMES_REPO</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>apache-kie-kogito-apps-staging-repository</id>
<name>Apache KIE Kogito Apps Staging Repository</name>
<url>$env:KOGITO_APPS_REPO</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>apache-kie-jitexecutor-native-staging-repository</id>
<name>Apache KIE JITExecutor Native Staging Repository</name>
<url>$env:JITEXECUTOR_NATIVE_REPO</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>apache-kie-drools-staging-repository</id>
<name>Apache KIE Drools Staging Repository</name>
<url>$env:DROOLS_REPO</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>apache-kie-kogito-runtimes-staging-repository</id>
<name>Apache KIE Kogito Runtimes Staging Repository</name>
<url>$env:KOGITO_RUNTIMES_REPO</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>apache-kie-kogito-apps-staging-repository</id>
<name>Apache KIE Kogito Apps Staging Repository</name>
<url>$env:KOGITO_APPS_REPO</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>apache-kie-jitexecutor-native-staging-repository</id>
<name>Apache KIE JITExecutor Native Staging Repository</name>
<url>$env:JITEXECUTOR_NATIVE_REPO</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>additional_repos</activeProfile>
</activeProfiles>
</settings>
"@
Add-Content "$env:WORKDIR_PATH\.m2\settings.xml" $contentToAdd
- name: "Setup Maven settings file (MacOS)"
if: runner.os == 'macOS'
shell: bash
run: |
pnpm -r exec 'bash' '-c' 'echo --settings=${{ github.workspace }}/.m2/settings.xml >> .mvn/maven.config'
- name: "Setup Maven settings file (Windows)"
if: runner.os == 'Windows'
shell: pwsh
run: |
pnpm -r powershell "Add-Content .\.mvn\maven.config '--settings=${{ github.workspace }}\.m2\settings.xml'"
- name: "Bootstrap"
id: bootstrap
uses: ./.github/actions/bootstrap
with:
pnpm_filter_string: -F @kie-tools/extended-services...
- name: "Build"
shell: bash
run: |
pnpm ${{ steps.bootstrap.outputs.pnpm_filter_string }} build:prod
- name: Temporary MacOS artifacts
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: extended-services-macos-artifacts
path: ./packages/extended-services/dist/darwin/Kogito.dmg
retention-days: 1
- name: Temporary Windows artifacts
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: extended-services-windows-artifacts
path: .\packages\extended-services\dist\win32\kie_sandbox_extended_services.exe
retention-days: 1
extended_services_sign_and_deploy:
needs: [extended_services_build]
runs-on: ubuntu-latest
env:
RELEASE_CANDIDATE_ARTIFACTS_DIR: ${{ github.workspace }}/extended-services-release-candidate-artifacts
steps:
- name: Import GPG key
if: github.event_name != 'pull_request'
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549
with:
gpg_private_key: ${{ secrets.GPG_KEY }}
- name: Create release artifacts directory
shell: bash
run: |
mkdir $RELEASE_CANDIDATE_ARTIFACTS_DIR
- name: Retrieve MacOS artifacts
uses: actions/download-artifact@v4
with:
name: extended-services-macos-artifacts
path: $RELEASE_CANDIDATE_ARTIFACTS_DIR
- name: Retrieve Windows artifacts
uses: actions/download-artifact@v4
with:
name: extended-services-windows-artifacts
path: $RELEASE_CANDIDATE_ARTIFACTS_DIR
- name: "Zip artifacts"
id: zip_artifacts
if: ${{ !inputs.dry_run }}
shell: bash
env:
RELEASE_CANDIDATE_VERSION: ${{ inputs.release_candidate_version }}
run: |
MACOS_ARTIFACT_ZIP_FILE="incubator-kie-$RELEASE_CANDIDATE_VERSION-sandbox-extended-services-macOS-x86.zip"
WINDOWS_ARTIFACT_ZIP_FILE="incubator-kie-$RELEASE_CANDIDATE_VERSION-sandbox-extended-services-windows-x86.zip"
echo "MACOS_ARTIFACT_ZIP_FILE=$MACOS_ARTIFACT_ZIP_FILE" >> "$GITHUB_OUTPUT"
echo "WINDOWS_ARTIFACT_ZIP_FILE=$WINDOWS_ARTIFACT_ZIP_FILE" >> "$GITHUB_OUTPUT"
cd $RELEASE_CANDIDATE_ARTIFACTS_DIR
zip $RELEASE_CANDIDATE_ARTIFACTS_DIR/$MACOS_ARTIFACT_ZIP_FILE ./Kogito.dmg
zip $RELEASE_CANDIDATE_ARTIFACTS_DIR/$WINDOWS_ARTIFACT_ZIP_FILE ./kie_sandbox_extended_services.exe
rm -f ./Kogito.dmg
rm -f ./kie_sandbox_extended_services.exe
- name: "Sign artifacts"
if: ${{ !inputs.dry_run }}
shell: bash
env:
MACOS_ARTIFACT_ZIP_FILE: ${{ steps.zip_artifacts.outputs.MACOS_ARTIFACT_ZIP_FILE }}
WINDOWS_ARTIFACT_ZIP_FILE: ${{ steps.zip_artifacts.outputs.WINDOWS_ARTIFACT_ZIP_FILE }}
run: |
cd $RELEASE_CANDIDATE_ARTIFACTS_DIR
gpg --no-tty --batch --sign --pinentry-mode loopback --output $MACOS_ARTIFACT_ZIP_FILE.asc --detach-sig $MACOS_ARTIFACT_ZIP_FILE
shasum -a 512 $MACOS_ARTIFACT_ZIP_FILE > $MACOS_ARTIFACT_ZIP_FILE.sha512
gpg --no-tty --batch --sign --pinentry-mode loopback --output $WINDOWS_ARTIFACT_ZIP_FILE.asc --detach-sig $WINDOWS_ARTIFACT_ZIP_FILE
shasum -a 512 $WINDOWS_ARTIFACT_ZIP_FILE > $WINDOWS_ARTIFACT_ZIP_FILE.sha512
- name: "Upload artifacts to SVN"
if: ${{ !inputs.dry_run }}
shell: bash
env:
SVN_USERNAME: ${{ secrets.INCUBATOR_SVN_DEV_USERNAME }}
SVN_PASSWORD: ${{ secrets.INCUBATOR_SVN_DEV_PASSWORD }}
RELEASE_CANDIDATE_VERSION: ${{ inputs.release_candidate_version }}
run: |
svn co --depth=empty https://dist.apache.org/repos/dist/dev/incubator/kie/$RELEASE_CANDIDATE_VERSION/ svn-kie
cp $RELEASE_CANDIDATE_ARTIFACTS_DIR/* svn-kie
cd svn-kie
svn add . --force
svn ci --non-interactive --no-auth-cache --username $SVN_USERNAME --password "$SVN_PASSWORD" -m "Apache KIE $RELEASE_CANDIDATE_VERSION Extended Services artifacts"
rm -rf svn-kie