-
Notifications
You must be signed in to change notification settings - Fork 95
645 lines (522 loc) · 22 KB
/
release.yml
File metadata and controls
645 lines (522 loc) · 22 KB
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
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
name: Release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: Release Version
required: true
default: 12.0.0
snapshotVersion:
description: Snapshot Version
required: true
default: 13.0.0-SNAPSHOT
code-scans:
description: Perform SAST and DAST code scans
type: boolean
default: true
upload-scanned-sarif-report:
description: Upload SAST and DAST code scans to Github Security
type: boolean
default: true
run-name: 'version set to ${{ github.event.inputs.releaseVersion }} for release'
permissions:
contents: write
id-token: write
jobs:
release-docker-images:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- runner: ubuntu-latest
platform: amd64
- runner: ubuntu-24.04-arm
platform: arm64
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Set up JDK Corretto 21
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: 22.x
registry-url: 'https://registry.npmjs.org'
- name: Install TypeScript and esbuild
run: npm install -g typescript@5.9.3 esbuild
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: "Maven: Set Release Version"
run: mvn versions:set -DnewVersion=${{ github.event.inputs.releaseVersion }}
- name: Build Dirigible
run: mvn clean install -P quick-build
- name: Log in to Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
context: build/application
platforms: ${{ matrix.platform }}
tags: dirigiblelabs/dirigible
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ matrix.platform }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
release-docker-manifest:
needs: release-docker-images
runs-on: ubuntu-latest
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create -t dirigiblelabs/dirigible:${{ github.event.inputs.releaseVersion }} \
$(printf 'dirigiblelabs/dirigible@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect dirigiblelabs/dirigible:${{ github.event.inputs.releaseVersion }}
release-artifacts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Set up JDK Corretto 21
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
architecture: x64
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: 22.x
registry-url: 'https://registry.npmjs.org'
# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@11.11.1
- name: Install TypeScript and esbuild
run: npm install -g typescript@5.9.3 esbuild
- name: "Configure Git"
run: |
git fetch
git checkout ${{ github.event.inputs.branch }}
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: "Maven: Set Release Version"
run: mvn versions:set -DnewVersion=${{ github.event.inputs.releaseVersion }}
- name: Build Dirigible
run: mvn clean install -Dmaven.javadoc.skip=false
- name: Publish packages to Maven Central
run: |
mvn javadoc:jar
mvn deploy -P release -DskipTests -Dmaven.test.skip=true
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASS_PHRASE }}
- name: "Git: Commit Release Version"
run: |
git add '**pom.xml'
git commit -m "version set to ${{ github.event.inputs.releaseVersion }} for release"
- name: "Maven: Set Snapshot Version"
run: mvn versions:set -DnewVersion=${{ github.event.inputs.snapshotVersion }}
- name: "Git: Commit Snapshot Version"
run: |
git add '**pom.xml'
git commit -m "version set to ${{ github.event.inputs.snapshotVersion }} for development"
#---------------Publish to Maven Central-----------------#
#--------------- Publish dirigible jar to NPM -----------------#
- name: (@dirigiblelabs/dirigible) Set the new package version
working-directory: ./npm/dirigible
run: npm version "${{ github.event.inputs.releaseVersion }}" --no-git-tag-version
- name: (@dirigiblelabs/dirigible) Publish the package to npm
working-directory: ./npm/dirigible
run: npm publish --access public
#--------------- Publish dirigible jar to NPM -----------------#
#--------------- Publish dirigible-cli to NPM -----------------#
- name: (@dirigiblelabs/dirigible-cli) Copy cli jar to the npm project
working-directory: ./
run: |
mkdir -p ./npm/dirigible-cli/bin
cp ./cli/target/dirigible-cli-${{ github.event.inputs.releaseVersion }}-executable.jar ./npm/dirigible-cli/bin/dirigible-cli.jar
- name: (@dirigiblelabs/dirigible-cli) Set the new package version
working-directory: ./npm/dirigible-cli
run: npm version "${{ github.event.inputs.releaseVersion }}" --no-git-tag-version
- name: (@dirigiblelabs/dirigible-cli) Set the new dependency version
working-directory: ./npm/dirigible-cli
run: npm pkg set dependencies.@dirigiblelabs/dirigible=${{ github.event.inputs.releaseVersion }}
- name: (@dirigiblelabs/dirigible-cli) Publish the package to npm
working-directory: ./npm/dirigible-cli
run: npm publish --access public
#--------------- Publish dirigible-cli to NPM -----------------#
#--------------- Publish aerokit/sdk to NPM -----------------#
- name: (@aerokit/sdk) Set the new package version
working-directory: ./components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules
run: npm version "${{ github.event.inputs.releaseVersion }}" --no-git-tag-version
- name: (@aerokit/sdk) Publish the package to npm
working-directory: ./components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules
run: npm publish --access public
#--------------- Publish aerokit/sdk to NPM -----------------#
- name: "Git: Push Changes"
run: |
git checkout -B ${{ github.event.inputs.releaseVersion }}
git push --set-upstream origin ${{ github.event.inputs.releaseVersion }}
git checkout -B master
git push --set-upstream origin master
- name: Package fat JAR
run: |
zip --junk-paths application-all build/application/target/dirigible-application-${{ github.event.inputs.releaseVersion }}-executable.jar
- name: Upload fat JAR as artifact
uses: actions/upload-artifact@v4
with:
name: application-all
path: application-all.zip
sast-docker-scout-scan:
if: ${{ inputs.code-scans }}
runs-on: ubuntu-latest
needs: release-docker-manifest
permissions:
security-events: write # Required to upload SARIF to GitHub Security tab
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in Docker Hub # required dockerhub login for docker/scout-action
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Scout Quickview and CVEs
uses: docker/scout-action@v1
with:
registry-user: ${{ secrets.DOCKER_USER }}
registry-password: ${{ secrets.DOCKER_PASSWORD }}
command: quickview,cves
image: dirigiblelabs/dirigible:${{ github.event.inputs.releaseVersion }}
sarif-file: sast_docker_scout_sarif.json
summary: true
only-fixed: false
- name: Upload Docker Scout SARIF file as artifact
uses: actions/upload-artifact@v4
with:
name: sast_docker_scout_sarif.json
path: sast_docker_scout_sarif.json
- name: Upload Docker Scout SARIF Report to GitHub Security tab
if: ${{ inputs.upload-scanned-sarif-report }}
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sast_docker_scout_sarif.json
sast-codeql-scan:
if: ${{ inputs.code-scans }}
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
needs: release-docker-manifest
permissions:
security-events: write # Required to upload SARIF to GitHub Security tab
strategy:
fail-fast: false
matrix:
include:
- language: java-kotlin
build-mode: manual
- language: javascript-typescript
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK Corretto 21
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
architecture: x64
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install TypeScript and esbuild
run: npm install -g typescript@5.9.3 esbuild
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
config: |
name: "Comprehensive Multi-language CodeQL Config"
query-filters:
- exclude:
id: java/path-injection
queries:
- uses: security-and-quality
- name: Build Java/Kotlin project
if: matrix.language == 'java-kotlin'
run: mvn clean install -P quick-build
- name: Perform CodeQL Analysis for language ${{ matrix.language }}
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
output: "sast_codeql_report_${{ matrix.language }}"
upload: always
- name: Upload CodeQL Analysis SARIF file as artifact
uses: actions/upload-artifact@v4
with:
name: sast_codeql_sarif_${{ matrix.language }}
path: sast_codeql_report_${{ matrix.language }}
dast-scan:
if: ${{ inputs.code-scans }}
name: Perform DAST testing using ZAP
needs: release-docker-manifest
runs-on: ubuntu-latest
services:
app:
image: dirigiblelabs/dirigible:${{ github.event.inputs.releaseVersion }}
ports:
- 8080:8080
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Wait for app to start
run: |
URL='http://localhost:8080/actuator/health/readiness'
for i in {1..30}; do
echo "Checking readiness at $URL... attempt $i"
if curl -f $URL; then
echo '----------------------'
echo "Application is ready."
break
fi
sleep 5
done
- name: Run OWASP ZAP Full Scan
uses: zaproxy/action-full-scan@v0.12.0
with:
target: 'http://localhost:8080'
cmd_options: '-T 10' # https://www.zaproxy.org/docs/docker/full-scan/
artifact_name: dast_zap_report # all results will be uploaded with an artifact with this name
allow_issue_writing: false # create an issue with the results
issue_title: '[DAST] ZAP Full Scan Report'
wait-for-scans:
if: always() # Runs even if previous jobs were skipped or failed
needs:
- sast-codeql-scan
- sast-docker-scout-scan
- dast-scan
runs-on: ubuntu-latest
steps:
- run: echo "Proceeding to next job"
generate-git-security-report:
if: ${{ inputs.code-scans }}
needs:
- wait-for-scans
runs-on: ubuntu-latest
permissions:
security-events: read
steps:
- name: Create dummy reports folder
run: mkdir reports
- name: Generate GitHub Security Report
uses: rsdmike/github-security-report-action@v3.0.4
with:
template: summary
token: ${{ secrets.GITHUB_TOKEN }}
sarifReportDir: "reports"
outputDir: "security-report"
- name: Upload Generated GitHub Security Report as Artifact
uses: actions/upload-artifact@v4
with:
name: security_report
path: security-report
github-release:
if: ${{ always() && !failure() && !cancelled() }} # run only if all prior jobs succeeded or were skipped, but not if one failed
runs-on: ubuntu-latest
needs: [release-artifacts, generate-git-security-report]
permissions:
packages: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create uploaded-artifacts folder
run: |
mkdir -p uploaded-artifacts/application-all
mkdir -p uploaded-artifacts/dast_zap_report
mkdir -p uploaded-artifacts/sast_codeql_sarif_java-kotlin
mkdir -p uploaded-artifacts/sast_codeql_sarif_javascript-typescript
mkdir -p uploaded-artifacts/sast_docker_scout_sarif.json
mkdir -p uploaded-artifacts/security_report
- name: Download Uploaded Artifacts (application-all)
uses: actions/download-artifact@v5
with:
path: uploaded-artifacts/application-all
pattern: application-all
- name: Download Uploaded Artifacts (dast_zap_report)
uses: actions/download-artifact@v5
with:
path: uploaded-artifacts/dast_zap_report
pattern: dast_zap_report
- name: Download Uploaded Artifacts (sast_codeql_sarif_java-kotlin)
uses: actions/download-artifact@v5
with:
path: uploaded-artifacts/sast_codeql_sarif_java-kotlin
pattern: sast_codeql_sarif_java-kotlin
- name: Download Uploaded Artifacts (sast_codeql_sarif_javascript-typescript)
uses: actions/download-artifact@v5
with:
path: uploaded-artifacts/sast_codeql_sarif_javascript-typescript
pattern: sast_codeql_sarif_javascript-typescript
- name: Download Uploaded Artifacts (sast_docker_scout_sarif.json)
uses: actions/download-artifact@v5
with:
path: uploaded-artifacts/sast_docker_scout_sarif.json
pattern: sast_docker_scout_sarif.json
- name: Download Uploaded Artifacts (security_report)
uses: actions/download-artifact@v5
with:
path: uploaded-artifacts/security_report
pattern: security_report
- name: Display Downloaded Artifacts
run: ls -R uploaded-artifacts
- name: Create release files
run: mkdir release_files
- name: Copy report files due to naming collisions
if: ${{ inputs.code-scans }}
run: |
cp uploaded-artifacts/security_report/summary.pdf release_files/security-report.pdf
cp uploaded-artifacts/sast_codeql_sarif_java-kotlin/java.sarif release_files/sast_codeql_sarif_java-kotlin.sarif
cp uploaded-artifacts/sast_codeql_sarif_javascript-typescript/javascript.sarif release_files/sast_codeql_sarif_javascript-typescript.sarif
cp uploaded-artifacts/sast_docker_scout_sarif.json/sast_docker_scout_sarif.json release_files/sast_docker_scout_sarif.json
cp uploaded-artifacts/dast_zap_report/report_html.html release_files/dast_zap_report.html
cp uploaded-artifacts/application-all/application-all.zip release_files/application-all.zip
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: v${{ github.event.inputs.releaseVersion }}
name: ${{ github.event.inputs.releaseVersion }}
draft: false
prerelease: false
files: |
release_files/**
body: |
## Eclipse Dirigible - ${{ github.event.inputs.releaseVersion }}
#### Release:
The lates release notes are available [here](https://www.dirigible.io/releases/).
> _**Note:** All released versions can be found [here](https://github.com/eclipse/dirigible/releases/)._
#### Maven:
250+ Maven dependencies can be found [here]( https://search.maven.org/#search%7Cga%7C1%7Corg.eclipse.dirigible).
```xml
<dependency>
<groupId>org.eclipse.dirigible</groupId>
<artifactId>dirigible-components-group-core</artifactId>
<version>${{ github.event.inputs.releaseVersion }}</version>
</dependency>
```
#### Helm:
To install Eclipse Dirigible with Helm go to the [Setup with Helm](https://www.dirigible.io/help/setup/helm/) page.
All Helm charts, with detailed explanation, setup and configurations, can be found [here](https://artifacthub.io/packages/search?org=dirigiblelabs).
```
helm repo add dirigible https://eclipse.github.io/dirigible
helm repo update
helm install dirigible dirigible/dirigible --version ${{ github.event.inputs.releaseVersion }}
```
#### Docker images:
- [dirigiblelabs/dirigible](https://hub.docker.com/r/dirigiblelabs/dirigible/tags?page=1&ordering=last_updated) - All-in-one docker image - recommended for local test & development.
> _**Note:** All Docker images are availalbe [here](https://hub.docker.com/u/dirigiblelabs)_
#### Available for download `*.war` packages:
- _**[application-all](https://github.com/eclipse/dirigible/releases/download/v${{ github.event.inputs.releaseVersion }}/application-all.zip) - All-in-one package - recommended for local test & development.**_
> _**Note:** Unzip the downloaded file to extract the `application-all-XXX.jar` binary._
For more information go to [https://www.dirigible.io/help/setup/](https://www.dirigible.io/help/setup/).
helm-release:
runs-on: ubuntu-latest
needs: github-release
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Helm tool installer
uses: Azure/setup-helm@v4
- name: Helm Charts Release - Checkout gh-pages
run: |
mkdir charts-temp
cp -r build/helm-charts/ charts-temp/
#### Git Checkout Workaround
git add .github/
git add .reuse/
git add LICENSES/
git add logo/
git add components/
git reset --hard
####
git fetch
git checkout gh-pages
cp charts/* .
- name: Helm Charts Release - Set Chart Version - Dirigible
run: |
cd charts-temp/helm-charts/dirigible/
find *.yaml -type f -exec sed -i ''s/#{DirigibleVersion}#/${{ github.event.inputs.releaseVersion }}/g'' {} \;
- name: Helm Charts Release
run: |
cp charts/* charts-temp/helm-charts/
cd charts-temp/helm-charts/
helm package dirigible
cd ..
helm repo index helm-charts/ --url https://eclipse.github.io/dirigible/charts
cp helm-charts/index.yaml ../.
cp helm-charts/dirigible-${{ github.event.inputs.releaseVersion }}.tgz ../charts/
cd ..
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add index.yaml
git add charts/
git commit -m "Updates Helm Charts - Release ${{ github.event.inputs.releaseVersion }}"
git push origin gh-pages