Skip to content

Commit db06d14

Browse files
committed
main.yml: deploy the artifacts from each release to Sonatype
1 parent 2272bce commit db06d14

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

.github/workflows/main.yml

+21-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# - Build natives for android
66
# - Merge the natives, build the engine, create the zip release, maven artifacts, javadoc and native snapshot
77
# - (only when native code changes) Deploy the natives snapshot to the MinIO instance
8-
# - (only when building a release) Deploy everything else to github releases, github packet registry and bintray
8+
# - (only when building a release) Deploy everything else to github releases, github packet registry, Bintray, and Sonatype
99
# - (only when building a release) Update javadoc.jmonkeyengine.org
1010
# Note:
1111
# All the actions/upload-artifact and actions/download-artifact steps are used to pass
@@ -22,6 +22,9 @@
2222
# BINTRAY_LICENSE="BSD 3-Clause"
2323
# >> Configure MINIO NATIVES SNAPSHOT
2424
# OBJECTS_KEY=XXXXXX
25+
# >> Configure SONATYPE RELEASE
26+
# OSSRH_PASSWORD=XXXXXX
27+
# OSSRH_USERNAME=XXXXXX
2528
# >> Configure SIGNING
2629
# SIGNING_KEY=XXXXXX
2730
# SIGNING_PASSWORD=XXXXXX
@@ -319,9 +322,23 @@ jobs:
319322
uses: actions/download-artifact@master
320323
with:
321324
name: release
322-
path: dist/release
323-
324-
- name: Deploy to github releases
325+
path: dist/release
326+
327+
- name: Deploy the maven artifacts to Sonatype OSSRH
328+
run: |
329+
if [ "${{ secrets.OSSRH_PASSWORD }}" = "" ];
330+
then
331+
echo "Configure the following secrets to enable deployment to Sonatype:"
332+
echo "OSSRH_PASSWORD, OSSRH_USERNAME"
333+
else
334+
./gradlew publishMavenPublicationToOSSRHRepository \
335+
-PossrhPassword=${{ secrets.OSSRH_PASSWORD }} \
336+
-PossrhUsername=${{ secrets.OSSRH_USERNAME }} \
337+
-PskipPrebuildLibraries=true -PuseCommitHashAsVersionName=true \
338+
--console=plain --stacktrace
339+
fi
340+
341+
- name: Deploy to GitHub Releases
325342
run: |
326343
# We need to get the release id (yeah, it's not the same as the tag)
327344
echo "${GITHUB_EVENT_PATH}"

0 commit comments

Comments
 (0)