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
63
with :
64
64
distribution : ' temurin'
65
65
java-version : ' 21'
66
+ # The following variables are defined in https://github.com/eclipse-esmf/.eclipsefdn/blob/main/otterdog/eclipse-esmf.jsonnet
66
67
gpg-private-key : ${{ secrets.PGP_KEY }}
67
68
gpg-passphrase : PGP_KEY_PASSWORD
68
69
overwrite-settings : false
88
89
with :
89
90
swap-size-gb : 12
90
91
91
- # The Linux build will prepare a local Nexus staging repository
92
+ # The Linux build will prepare a Maven Central upload "bundle"
92
93
# that includes all .jars except the CLI jar
93
94
- name : Build and run tests
94
95
run : |
@@ -98,11 +99,17 @@ jobs:
98
99
mvn clean install -DskipTests -Dmaven.javadoc.skip=true
99
100
mvn versions:set -DnewVersion=${{ github.event.inputs.release_version }}
100
101
mvn versions:commit
101
-
102
+
102
103
release_version=${{ github.event.inputs.release_version }}
103
104
104
- # Actual build of core SDK
105
- mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
105
+ # Actual build of core SDK
106
+ mvn -B -pl '!org.eclipse.esmf:samm-cli' clean deploy -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -Psign
107
+
108
+ # Create Maven Central upload bundle
109
+ pushd target/central-deferred
110
+ zip -r -9 ../../central-bundle.zip .
111
+ popd
112
+
106
113
# Build samm-cli executable jar and run integration tests
107
114
unset JAVA_TOOL_OPTIONS
108
115
mvn -B -pl tools/samm-cli clean verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
@@ -136,6 +143,7 @@ jobs:
136
143
with :
137
144
name : linux-artifacts
138
145
path : |
146
+ central-bundle.zip
139
147
samm-cli-${{ github.event.inputs.release_version }}-linux-x86_64.tar.gz
140
148
samm-cli-${{ github.event.inputs.release_version }}.jar
141
149
samm-cli-${{ github.event.inputs.release_version }}-javadoc.jar
@@ -187,19 +195,19 @@ jobs:
187
195
bundle="samm-bundle-$(date +%s)"
188
196
mkdir ${bundle}
189
197
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
190
- tar -xvf jre.tar.gz
198
+ tar -xvf jre.tar.gz
191
199
cp -r ./jdk-21.0.6+7-jre/Contents/Home ./${bundle}/jre
192
200
cp tools/samm-cli/target/samm-cli-${{ github.event.inputs.release_version }}.jar ./${bundle}/
193
-
201
+
194
202
cat <<EOF > ./${bundle}/run.sh
195
203
#!/usr/bin/env bash
196
-
204
+
197
205
HERE=\${BASH_SOURCE%/*}
198
-
206
+
199
207
"\$HERE/jre/bin/java" -jar "\$HERE/samm-cli-${{ github.event.inputs.release_version }}.jar" "\$@"
200
208
EOF
201
- chmod +x ./${bundle}/run.sh
202
-
209
+ chmod +x ./${bundle}/run.sh
210
+
203
211
curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
204
212
chmod +x warp-packer
205
213
./warp-packer --arch macos-x64 --input_dir ${bundle} --exec run.sh --output samm
@@ -296,11 +304,10 @@ jobs:
296
304
with :
297
305
distribution : ' temurin'
298
306
java-version : ' 21'
299
- server-id : ossrh
307
+ server-id : central
308
+ # The following variables are defined in https://github.com/eclipse-esmf/.eclipsefdn/blob/main/otterdog/eclipse-esmf.jsonnet
300
309
server-username : CENTRAL_SONATYPE_TOKEN_USERNAME
301
310
server-password : CENTRAL_SONATYPE_TOKEN_PASSWORD
302
- gpg-private-key : GPG_PRIVATE_KEY
303
- gpg-passphrase : GPG_PASSPHRASE
304
311
overwrite-settings : false
305
312
306
313
# Required to run the mvn:versions, since enforcer plugin
@@ -412,27 +419,17 @@ jobs:
412
419
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}"
413
420
414
421
# Full release: Maven Central
415
- # The (apparently) only way to retrieve the staging profile id
416
- # is the undocumented rc-list-profiles command of the
417
- # nexus-staging-maven-plugin:
418
- # mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:rc-list-profiles -DnexusUrl=https://oss.sonatype.org/ -DserverId=ossrh
419
422
- name : Release to Maven Central
420
423
if : ${{ !contains( github.event.inputs.release_version, '-M' ) }}
421
424
run : |
422
- mvn -B -pl '!org.eclipse.esmf:samm-cli,!org.eclipse.esmf:documentation' clean deploy -Psign
423
- # run: |
424
- # mkdir deploy
425
- # mv nexus-staging deploy
426
- # cd deploy
427
- # mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:deploy-staged-repository \
428
- # -DnexusUrl=https://oss.sonatype.org/ \
429
- # -DserverId=ossrh \
430
- # -DrepositoryDirectory=nexus-staging \
431
- # -DstagingProfileId=7e73217781f2e
425
+ token_header=$(printf "$CENTRAL_USERNAME:$CENTRAL_PASSWORD" | base64)
426
+ curl --request POST \
427
+ --header "Authorization: Bearer $token_header" \
428
+
429
+ https://central.sonatype.com/api/v1/publisher/upload
432
430
env :
433
431
CENTRAL_USERNAME : ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
434
432
CENTRAL_TOKEN : ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
435
- PGP_KEY_PASSWORD : ${{ secrets.GPG_PRIVATE_KEY }}
436
433
437
434
# Milestone release: Write settings to deploy to Github repo
438
435
- name : Write settings.xml
0 commit comments