Skip to content

Commit 90dc729

Browse files
committed
Fix deploy pipeline configuration
Secret names are wrong; also The "skipDeployment" feature is used so that the release job just pushes the previously build deploy bundle
1 parent 9e3b71b commit 90dc729

File tree

1 file changed

+27
-30
lines changed

1 file changed

+27
-30
lines changed

.github/workflows/release-workflow.yml

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242
exit 1
4343
fi
4444
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)
4747
# and the Linux-specific samm-cli binary to the build artifacts
4848
build-linux:
4949
name: Linux build
@@ -63,6 +63,7 @@ jobs:
6363
with:
6464
distribution: 'temurin'
6565
java-version: '21'
66+
# The following variables are defined in https://github.com/eclipse-esmf/.eclipsefdn/blob/main/otterdog/eclipse-esmf.jsonnet
6667
gpg-private-key: ${{ secrets.PGP_KEY }}
6768
gpg-passphrase: PGP_KEY_PASSWORD
6869
overwrite-settings: false
@@ -88,7 +89,7 @@ jobs:
8889
with:
8990
swap-size-gb: 12
9091

91-
# The Linux build will prepare a local Nexus staging repository
92+
# The Linux build will prepare a Maven Central upload "bundle"
9293
# that includes all .jars except the CLI jar
9394
- name: Build and run tests
9495
run: |
@@ -98,11 +99,17 @@ jobs:
9899
mvn clean install -DskipTests -Dmaven.javadoc.skip=true
99100
mvn versions:set -DnewVersion=${{ github.event.inputs.release_version }}
100101
mvn versions:commit
101-
102+
102103
release_version=${{ github.event.inputs.release_version }}
103104
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+
106113
# Build samm-cli executable jar and run integration tests
107114
unset JAVA_TOOL_OPTIONS
108115
mvn -B -pl tools/samm-cli clean verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
@@ -136,6 +143,7 @@ jobs:
136143
with:
137144
name: linux-artifacts
138145
path: |
146+
central-bundle.zip
139147
samm-cli-${{ github.event.inputs.release_version }}-linux-x86_64.tar.gz
140148
samm-cli-${{ github.event.inputs.release_version }}.jar
141149
samm-cli-${{ github.event.inputs.release_version }}-javadoc.jar
@@ -187,19 +195,19 @@ jobs:
187195
bundle="samm-bundle-$(date +%s)"
188196
mkdir ${bundle}
189197
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
191199
cp -r ./jdk-21.0.6+7-jre/Contents/Home ./${bundle}/jre
192200
cp tools/samm-cli/target/samm-cli-${{ github.event.inputs.release_version }}.jar ./${bundle}/
193-
201+
194202
cat <<EOF > ./${bundle}/run.sh
195203
#!/usr/bin/env bash
196-
204+
197205
HERE=\${BASH_SOURCE%/*}
198-
206+
199207
"\$HERE/jre/bin/java" -jar "\$HERE/samm-cli-${{ github.event.inputs.release_version }}.jar" "\$@"
200208
EOF
201-
chmod +x ./${bundle}/run.sh
202-
209+
chmod +x ./${bundle}/run.sh
210+
203211
curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
204212
chmod +x warp-packer
205213
./warp-packer --arch macos-x64 --input_dir ${bundle} --exec run.sh --output samm
@@ -296,11 +304,10 @@ jobs:
296304
with:
297305
distribution: 'temurin'
298306
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
300309
server-username: CENTRAL_SONATYPE_TOKEN_USERNAME
301310
server-password: CENTRAL_SONATYPE_TOKEN_PASSWORD
302-
gpg-private-key: GPG_PRIVATE_KEY
303-
gpg-passphrase: GPG_PASSPHRASE
304311
overwrite-settings: false
305312

306313
# Required to run the mvn:versions, since enforcer plugin
@@ -412,27 +419,17 @@ jobs:
412419
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}"
413420
414421
# 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
419422
- name: Release to Maven Central
420423
if: ${{ !contains( github.event.inputs.release_version, '-M' ) }}
421424
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
432430
env:
433431
CENTRAL_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
434432
CENTRAL_TOKEN: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
435-
PGP_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY }}
436433

437434
# Milestone release: Write settings to deploy to Github repo
438435
- name: Write settings.xml

0 commit comments

Comments
 (0)