@@ -11,46 +11,69 @@ jobs:
1111
1212 steps :
1313 - name : Checkout
14- uses : actions/checkout@v3
14+ uses : actions/checkout@v4
1515
1616 - name : Set up JDK 11
17- uses : actions/setup-java@v3
17+ uses : actions/setup-java@v4
1818 with :
19- distribution : ' adopt '
19+ distribution : ' temurin '
2020 java-version : ' 11'
21- server-id : ossrh
22- server-username : OSSRH_USERNAME
23- server-password : OSSRH_TOKEN
21+ server-id : central
22+ server-username : CENTRAL_SONATYPE_TOKEN_USERNAME
23+ server-password : CENTRAL_SONATYPE_TOKEN_PASSWORD
2424 gpg-private-key : ${{ secrets.PGP_KEY }}
2525 gpg-passphrase : PGP_KEY_PASSWORD
26- overwrite-settings : true
26+ overwrite-settings : false
2727
2828 - name : Set release version in antora.yml
2929 uses : mikefarah/yq@master
3030 with :
3131 cmd : yq eval -i '.version = "${{ github.event.inputs.release_version }}"' documentation/antora.yml
3232
33- - name : Build SAMM artifact and release to OSSRH
33+ - name : Build SAMM artifact and create Maven Central bundle
3434 run : |
3535 set -x
36+
37+ export MAVEN_OPTS="-Xmx4096m"
38+ export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
39+ release_version=${{ github.event.inputs.release_version }}
40+
3641 rm -rf ~/.m2/repository/org/eclipse/esmf
37- ./mvnw -B versions:set -DnewVersion=${{ github.event.inputs. release_version } }
42+ ./mvnw -B versions:set -DnewVersion=${ release_version }
3843 ./mvnw -B versions:commit
3944 # Since the meta model project itself does not inherit from the parent, we must set its version separately
40- ./mvnw -B versions:set -DnewVersion=${{ github.event.inputs. release_version } } -pl esmf-semantic-aspect-meta-model
45+ ./mvnw -B versions:set -DnewVersion=${ release_version } -pl esmf-semantic-aspect-meta-model
4146 ./mvnw -B versions:commit -pl esmf-semantic-aspect-meta-model
4247 ./mvnw -B clean generate-resources -pl documentation -Pantora
4348 ./mvnw -B -U clean install -pl esmf-samm-build-plugin
44- ./mvnw -B -U clean deploy -pl esmf-semantic-aspect-meta-model -Psign,release-build
49+ ./mvnw -B -U clean deploy -pl esmf-semantic-aspect-meta-model -Psign,release-build -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
50+
51+ echo "Contents of target/central-staging:"
52+ ls -lR target/central-staging
53+
54+ pushd target/central-staging
55+ zip -r -9 ../central-bundle.zip .
56+ popd
57+
4558 cd build/
46- mv site SAMM-${{ github.event.inputs. release_version } }
47- zip -r ../SAMM-${{ github.event.inputs. release_version }} -specification.zip SAMM-${{ github.event.inputs. release_version } }
59+ mv site SAMM-${ release_version }
60+ zip -r ../SAMM-${ release_version }-specification.zip SAMM-${ release_version }
4861 env :
49- OSSRH_USERNAME : ${{ secrets.OSSRH_USERNAME }}
50- OSSRH_TOKEN : ${{ secrets.OSSRH_TOKEN }}
5162 PGP_KEY_PASSWORD : ${{ secrets.PGP_KEY_PASSWORD }}
5263
53- # If the deployment to OSSRH went through, the following steps will
64+ - name : Release to Maven Central
65+ if : ${{ !contains( github.event.inputs.release_version, '-M' ) }}
66+ run : |
67+ token_header=$(printf "$CENTRAL_USERNAME:$CENTRAL_TOKEN" | base64)
68+ curl --request POST \
69+ --header "Authorization: Bearer $token_header" \
70+ 71+ https://central.sonatype.com/api/v1/publisher/upload
72+ env :
73+ CENTRAL_USERNAME : ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
74+ CENTRAL_TOKEN : ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
75+
76+ # If the deployment to Maven Central went through, the following steps will
5477 # - Commit updated version to release branch
5578 # - Create Github release
5679
0 commit comments