Skip to content

Commit 521e871

Browse files
devonfw#427: added comments updated release
added comments to cli/pom.xml profiles added changes of nightly build workflow to release workflow
1 parent a1d3c81 commit 521e871

File tree

2 files changed

+50
-15
lines changed

2 files changed

+50
-15
lines changed

.github/workflows/release.yml

+44-10
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,38 @@ on:
55
workflow_dispatch
66

77
jobs:
8+
9+
# Builds documentation pdf file in cli/target/package and uploads artifact to docs
10+
build-documentation:
11+
name: Build documentation
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
with:
17+
submodules: recursive
18+
- name: Set up JDK
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: '17'
22+
- name: Make documentation available
23+
run: |
24+
mvn -B -Pbuild-documentation -Dstyle.color=always -DskipTests=true package
25+
- name: Upload documentation
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: docs
29+
path: cli/target/package/*.pdf
30+
31+
# Downloads documentation docs artifact, builds all native images, archives native image for each os with documentation pdf file and uploads artifacts to f.e. natives-windows-latest
832
build-natives:
933
name: Build native images
34+
needs: build-documentation
1035
runs-on: ${{ matrix.os }}
1136
strategy:
1237
matrix:
13-
os: [ windows-latest, macos-latest, macos-13, ubuntu-latest ]
38+
os: [ windows-latest, ubuntu-latest, macos-latest, macos-13 ]
39+
1440
steps:
1541
- uses: actions/checkout@v3
1642
with:
@@ -21,23 +47,26 @@ jobs:
2147
distribution: 'graalvm'
2248
github-token: ${{ secrets.GITHUB_TOKEN }}
2349
native-image-job-reports: 'true'
24-
- name: Build native images with nativ maven plugin and extract in tar.gz
50+
- name: Download documentation
51+
uses: actions/download-artifact@v4
52+
with:
53+
name: docs
54+
path: ./cli/target/package
55+
- name: Build native image
2556
shell: bash
2657
run: |
27-
maven_config="$(cat .mvn/maven.config)"
28-
current_version="${maven_config/#*-Drevision=}"
29-
current_version="${current_version/ */}"
3058
cd cli
31-
mvn -B -ntp -Pnative -DskipTests=true package
32-
- uses: actions/upload-artifact@v3
59+
mvn -B -ntp -P${{ matrix.os }} '-P!build-documentation' -DskipTests=true package
60+
- name: Upload native image
61+
uses: actions/upload-artifact@v4
3362
with:
34-
name: natives
63+
name: natives-${{ matrix.os }}
3564
path: cli/target/*.tar.gz
3665

3766
release:
3867
name: Release on Sonatype OSS
3968
runs-on: ubuntu-latest
40-
needs: [ build-natives ]
69+
needs: [ build-documentation, build-natives ]
4170
steps:
4271
- name: Checkout
4372
uses: actions/checkout@v3
@@ -52,7 +81,12 @@ jobs:
5281
cache: 'maven'
5382
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
5483
gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase
55-
- uses: actions/download-artifact@v3
84+
- name: Download natives and build project
85+
uses: actions/download-artifact@v4
86+
with:
87+
pattern: natives-*
88+
path: ./cli/target/
89+
merge-multiple: true
5690
- name: Publish to Apache Maven Central
5791
run: |
5892
maven_config="$(cat .mvn/maven.config)"

cli/pom.xml

+6-5
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142

143143

144144
<profiles>
145-
145+
<!-- Builds the windows x86_64 native image and archives it with the documentation from the github artifact -->
146146
<profile>
147147
<id>windows-latest</id>
148148
<build>
@@ -207,7 +207,7 @@
207207
</plugins>
208208
</build>
209209
</profile>
210-
210+
<!-- Builds the linux x86_64 native image and archives it with the documentation from the github artifact -->
211211
<profile>
212212
<id>ubuntu-latest</id>
213213
<build>
@@ -272,7 +272,7 @@
272272
</plugins>
273273
</build>
274274
</profile>
275-
275+
<!-- Builds the osx x86_64 native image and archives it with the documentation from the github artifact -->
276276
<profile>
277277
<id>macos-13</id>
278278
<build>
@@ -337,7 +337,7 @@
337337
</plugins>
338338
</build>
339339
</profile>
340-
340+
<!-- Builds the osx aarch_64 native image and archives it with the documentation from the github artifact -->
341341
<profile>
342342
<id>macos-latest</id>
343343
<build>
@@ -403,7 +403,7 @@
403403
</build>
404404
</profile>
405405

406-
<!-- New profile for including documentation -->
406+
<!-- Builds the documentation pdf file and stores it in target/package -->
407407
<profile>
408408
<id>build-documentation</id>
409409
<build>
@@ -440,6 +440,7 @@
440440
</build>
441441
</profile>
442442

443+
<!-- Attaches artifacts stored in cli/target/*.tgz to the maven build, moves them to documentation/target/nexus-staging/.../*.tgz and deploys them with the name defined in the classifier -->
443444
<profile>
444445
<id>deploy</id>
445446
<build>

0 commit comments

Comments
 (0)