77 # Set up the OS
88 runs-on : ubuntu-latest
99 env :
10- # Nexus credentials and GitHub token
11- NEXUS_USERNAME : ' ${{ secrets.NEXUS_USERNAME }}'
12- NEXUS_PASSWORD : ' ${{ secrets.NEXUS_PASSWORD }}'
10+ # Sonatype Credentials & GitHub token
11+ SONATYPE_USERNAME : ' ${{ secrets.SONATYPE_USERNAME }}'
12+ SONATYPE_PASSWORD : ' ${{ secrets.SONATYPE_PASSWORD }}'
1313 GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
1414 # Set environment
15- env : ' prod'
15+ ENV : ' prod'
16+ PROJECT_NAME : ' LoggingModule'
1617 steps :
1718 # Checkout the Code
1819 - name : Checkout Code
1920 uses : actions/checkout@v3
2021 # Set up git hashes environment variables
2122 - name : Git Hashes
22- uses : Im-Fran/git-hashes-action@v1.0.1
23+ uses : Im-Fran/git-hashes-action@v1.0.3
2324 # Set up version from tag environment variables
2425 - name : Version from Tag Action
25- uses : Im-Fran/version-from-tag-action@v1.0.1
26+ uses : Im-Fran/version-from-tag-action@v1.0.3
2627 with :
2728 remove-first-character : ' v'
2829 # Set up the JDK
@@ -31,22 +32,30 @@ jobs:
3132 with :
3233 distribution : adopt
3334 java-version : 11
35+ cache : ' gradle'
3436 # Make gradle executable
3537 - name : Make gradle executable
3638 run : chmod +x gradlew
3739 # Clean, Test, Publish and Build (in that order to save the artifact to the action)
3840 - name : Test, Deploy and Build with Gradle
39- run : ./gradlew clean test publish shadow dokkaHtml
41+ run : ./gradlew clean test shadowJar dokkaHtml publish publishToSonatype closeAndReleaseSonatypeStagingRepository -no-daemon
4042 # Now we store the artifact in the action
4143 - name : Upload the artifact
4244 uses : actions/upload-artifact@v3
4345 with :
44- name : LoggingModule
45- path : ./build/libs/LoggingModule-${{ env.VERSION }}.jar
46+ name : ${{ env.PROJECT_NAME }}
47+ path : ./build/libs/${{ env.PROJECT_NAME }}-${{ env.VERSION }}.jar
48+ # Here we upload the binary to the release
49+ - name : Upload to release
50+ uses : JasonEtco/upload-to-release@master
51+ with :
52+ args : ./build/libs/${{ env.PROJECT_NAME }}-${{ env.VERSION }}.jar application/java-archive
4653 # Now we deploy the documents to GitHub pages
4754 - name : Deploy Dokka
4855 uses : JamesIves/github-pages-deploy-action@v4.4.1
4956 with :
5057 branch : gh-pages
5158 folder : build/dokka
52- clean : true
59+ clean : true
60+ clean-exclude : |
61+ CNAME
0 commit comments