42
42
exit 1
43
43
fi
44
44
45
- # The Linux build will upload the local Nexus deployment repository
46
- # (i.e., what will be deployed to OSSRH/ Maven Central)
45
+ # The Linux build will upload the local Maven Central bundle
46
+ # (i.e., what will be deployed to Maven Central)
47
47
# and the Linux-specific samm-cli binary to the build artifacts
48
48
build-linux :
49
49
name : Linux build
@@ -63,16 +63,19 @@ jobs:
63
63
with :
64
64
distribution : ' temurin'
65
65
java-version : ' 21'
66
+ server-id : central
67
+ # The following variables are defined in https://github.com/eclipse-esmf/.eclipsefdn/blob/main/otterdog/eclipse-esmf.jsonnet
66
68
gpg-private-key : ${{ secrets.PGP_KEY }}
67
69
gpg-passphrase : PGP_KEY_PASSWORD
70
+ server-username : CENTRAL_SONATYPE_TOKEN_USERNAME
71
+ server-password : CENTRAL_SONATYPE_TOKEN_PASSWORD
68
72
overwrite-settings : false
69
73
70
74
- name : Setup JDK
71
75
uses : graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # v1.3.3
72
76
with :
73
77
java-version : ' 21.0.6'
74
78
distribution : ' graalvm'
75
- components : ' native-image,js'
76
79
github-token : ${{ secrets.GITHUB_TOKEN }}
77
80
native-image-job-reports : ' true'
78
81
@@ -89,21 +92,30 @@ jobs:
89
92
with :
90
93
swap-size-gb : 12
91
94
92
- # The Linux build will prepare a local Nexus staging repository
95
+ # The Linux build will prepare a Maven Central upload "bundle"
93
96
# that includes all .jars except the CLI jar
94
97
- name : Build and run tests
95
98
run : |
96
99
export MAVEN_OPTS="-Xmx4096m"
97
100
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
101
+ release_version=${{ github.event.inputs.release_version }}
102
+
98
103
# Required for reactor dependencies
99
104
mvn clean install -DskipTests -Dmaven.javadoc.skip=true
100
- mvn versions:set -DnewVersion=${{ github.event.inputs. release_version } }
105
+ mvn versions:set -DnewVersion=${release_version}
101
106
mvn versions:commit
102
-
103
- release_version=${{ github.event.inputs.release_version }}
104
107
105
- # Actual build of core SDK
106
- mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
108
+ # Actual build of core SDK
109
+ mvn -B -pl '!org.eclipse.esmf:samm-cli' clean deploy -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -Psign
110
+
111
+ # Create Maven Central upload bundle
112
+ pushd target/central-staging
113
+ echo "Contents of $(pwd):"
114
+ ls -lR
115
+ rm -rf org/eclipse/esmf/esmf-documentation
116
+ zip -r -9 ../../central-bundle.zip .
117
+ popd
118
+
107
119
# Build samm-cli executable jar and run integration tests
108
120
unset JAVA_TOOL_OPTIONS
109
121
mvn -B -pl tools/samm-cli clean verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
@@ -137,6 +149,7 @@ jobs:
137
149
with :
138
150
name : linux-artifacts
139
151
path : |
152
+ central-bundle.zip
140
153
samm-cli-${{ github.event.inputs.release_version }}-linux-x86_64.tar.gz
141
154
samm-cli-${{ github.event.inputs.release_version }}.jar
142
155
samm-cli-${{ github.event.inputs.release_version }}-javadoc.jar
@@ -158,9 +171,8 @@ jobs:
158
171
with :
159
172
java-version : ' 21.0.6'
160
173
distribution : ' graalvm'
161
- components : ' native-image,js'
162
174
github-token : ${{ secrets.GITHUB_TOKEN }}
163
- native-image-job-reports : ' true '
175
+ native-image-job-reports : ' false '
164
176
165
177
- name : Cache Maven packages
166
178
uses : actions/cache@v4
@@ -189,19 +201,19 @@ jobs:
189
201
bundle="samm-bundle-$(date +%s)"
190
202
mkdir ${bundle}
191
203
curl -Lo jre.tar.gz https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.6%2B7/OpenJDK21U-jre_x64_mac_hotspot_21.0.6_7.tar.gz
192
- tar -xvf jre.tar.gz
204
+ tar -xvf jre.tar.gz
193
205
cp -r ./jdk-21.0.6+7-jre/Contents/Home ./${bundle}/jre
194
206
cp tools/samm-cli/target/samm-cli-${{ github.event.inputs.release_version }}.jar ./${bundle}/
195
-
207
+
196
208
cat <<EOF > ./${bundle}/run.sh
197
209
#!/usr/bin/env bash
198
-
210
+
199
211
HERE=\${BASH_SOURCE%/*}
200
-
212
+
201
213
"\$HERE/jre/bin/java" -jar "\$HERE/samm-cli-${{ github.event.inputs.release_version }}.jar" "\$@"
202
214
EOF
203
- chmod +x ./${bundle}/run.sh
204
-
215
+ chmod +x ./${bundle}/run.sh
216
+
205
217
curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
206
218
chmod +x warp-packer
207
219
./warp-packer --arch macos-x64 --input_dir ${bundle} --exec run.sh --output samm
@@ -233,7 +245,6 @@ jobs:
233
245
with :
234
246
java-version : ' 21.0.6'
235
247
distribution : ' graalvm'
236
- components : ' native-image,js'
237
248
github-token : ${{ secrets.GITHUB_TOKEN }}
238
249
native-image-job-reports : ' true'
239
250
@@ -299,11 +310,10 @@ jobs:
299
310
with :
300
311
distribution : ' temurin'
301
312
java-version : ' 21'
302
- server-id : ossrh
313
+ server-id : central
314
+ # The following variables are defined in https://github.com/eclipse-esmf/.eclipsefdn/blob/main/otterdog/eclipse-esmf.jsonnet
303
315
server-username : CENTRAL_SONATYPE_TOKEN_USERNAME
304
316
server-password : CENTRAL_SONATYPE_TOKEN_PASSWORD
305
- gpg-private-key : GPG_PRIVATE_KEY
306
- gpg-passphrase : GPG_PASSPHRASE
307
317
overwrite-settings : false
308
318
309
319
# Required to run the mvn:versions, since enforcer plugin
@@ -313,7 +323,6 @@ jobs:
313
323
with :
314
324
java-version : ' 21.0.6'
315
325
distribution : ' graalvm'
316
- components : ' native-image,js'
317
326
github-token : ${{ secrets.GITHUB_TOKEN }}
318
327
native-image-job-reports : ' false'
319
328
@@ -416,27 +425,17 @@ jobs:
416
425
curl -X POST https://ci.eclipse.org/esmf/github-webhook/ -H "Content-Type: application/json" -H "X-GitHub-Event: push" -H "X-Hub-Signature: sha1=${SHA1}" -d "${DATA}"
417
426
418
427
# Full release: Maven Central
419
- # The (apparently) only way to retrieve the staging profile id
420
- # is the undocumented rc-list-profiles command of the
421
- # nexus-staging-maven-plugin:
422
- # mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:rc-list-profiles -DnexusUrl=https://oss.sonatype.org/ -DserverId=ossrh
423
428
- name : Release to Maven Central
424
429
if : ${{ !contains( github.event.inputs.release_version, '-M' ) }}
425
430
run : |
426
- mvn -B -pl '!org.eclipse.esmf:samm-cli,!org.eclipse.esmf:documentation' clean deploy -Psign
427
- # run: |
428
- # mkdir deploy
429
- # mv nexus-staging deploy
430
- # cd deploy
431
- # mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:deploy-staged-repository \
432
- # -DnexusUrl=https://oss.sonatype.org/ \
433
- # -DserverId=ossrh \
434
- # -DrepositoryDirectory=nexus-staging \
435
- # -DstagingProfileId=7e73217781f2e
431
+ token_header=$(printf "$CENTRAL_USERNAME:$CENTRAL_TOKEN" | base64)
432
+ curl --request POST \
433
+ --header "Authorization: Bearer $token_header" \
434
+
435
+ https://central.sonatype.com/api/v1/publisher/upload
436
436
env :
437
437
CENTRAL_USERNAME : ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
438
438
CENTRAL_TOKEN : ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
439
- PGP_KEY_PASSWORD : ${{ secrets.GPG_PRIVATE_KEY }}
440
439
441
440
# Milestone release: Write settings to deploy to Github repo
442
441
- name : Write settings.xml
0 commit comments