1- name : 🛠️ Publish to GitHub Packages
1+ name : 🛠️ Publish to Sonatype
22
33on :
44 release :
@@ -20,31 +20,39 @@ jobs:
2020 java-version : " 21"
2121 distribution : " temurin"
2222
23- # Step 3: Setup Gradle
23+ # Step 3: Set up GPG
24+ - name : Set up GPG key
25+ run : |
26+ echo "$GPG_PRIVATE_KEY" | gpg --batch --import
27+ echo "$GPG_PASSPHRASE" | gpg --batch --passphrase-fd 0 --pinentry-mode loopback --sign
28+
29+ # Step 4: Setup Gradle
2430 - name : Setup Gradle
2531 uses : gradle/actions/setup-gradle@v3
2632 with :
2733 cache-read-only : false
2834
29- # Step 4 : Grant execute permissions to gradlew
35+ # Step 5 : Grant execute permissions to gradlew
3036 - name : Grant execute permissions to gradlew
3137 run : chmod +x ./gradlew
3238
33- # Step 5 : Set version based on the release tag
39+ # Step 6 : Set version based on the release tag
3440 - name : Set version based on release tag
3541 run : echo VERSION=$(echo "${GITHUB_REF}" | sed 's/refs\/tags\///') >> $GITHUB_ENV
3642
37- # Step 6 : Build the project using Gradle
43+ # Step 7 : Build the project using Gradle
3844 - name : Build with Gradle
3945 run : ./gradlew build
4046
41- # Step 7 : Publish the project to GitHub Packages
42- - name : Publish to GitHub Packages
47+ # Step 8 : Publish the project to Sonatype OSSRH
48+ - name : Publish to Sonatype OSSRH
4349 run : ./gradlew publish -Pversion=$VERSION
4450 env :
4551 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
53+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
4654
47- # Step 8 : Send notification to Discord
55+ # Step 9 : Send notification to Discord
4856 - name : Send notification to Discord
49575058 with :
0 commit comments