55 tags-ignore : [ "**" ]
66 pull_request :
77 release :
8- types : [ released ]
8+ types : [ published ]
99jobs :
1010 build :
1111 # Only run on PRs if the source branch is on someone else's repo
@@ -19,13 +19,19 @@ jobs:
1919 with :
2020 distribution : ' temurin'
2121 java-version : 17
22+ - uses : gradle/gradle-build-action@v2
23+ with :
24+ # allow main and *-dev branches to write caches (default is only main/main)
25+ cache-read-only : ${{ github.ref != 'refs/heads/main' && !(endsWith(github.ref, '-dev') && startsWith(github.ref, 'refs/heads/')) }}
2226 - name : Build
2327 run : ./gradlew build
24- - name : Test Summary
25- uses : EnricoMi/publish-unit-test-result-action@v2.11.0
26- with :
27- junit_files : " **/build/test-results/test/TEST-*.xml"
28- if : always()
28+ - name : Upload Test Results
29+ if : always()
30+ uses : actions/upload-artifact@v4
31+ with :
32+ name : Test Results
33+ path : |
34+ **/build/test-results/test/TEST-*.xml
2935 - name : Determine Status
3036 run : |
3137 if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then
3440 echo "STATUS=release" >> $GITHUB_ENV
3541 fi
3642 - name : Publish Snapshot
37- if : " ${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/master ' }}"
43+ if : " ${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main ' }}"
3844 run : ./gradlew publish
3945 env :
4046 ORG_GRADLE_PROJECT_sonatypeUsername : " ${{ secrets.SONATYPE_USERNAME }}"
4753 ORG_GRADLE_PROJECT_sonatypePassword : " ${{ secrets.SONATYPE_PASSWORD }}"
4854 ORG_GRADLE_PROJECT_signingKey : " ${{ secrets.SIGNING_KEY }}"
4955 ORG_GRADLE_PROJECT_signingPassword : " ${{ secrets.SIGNING_PASSWORD }}"
56+ event_file :
57+ name : " Event File"
58+ # Only run on PRs if the source branch is on someone else's repo
59+ if : ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
60+ runs-on : ubuntu-latest
61+ steps :
62+ - name : Upload
63+ uses : actions/upload-artifact@v4
64+ with :
65+ name : Event File
66+ path : ${{ github.event_path }}
0 commit comments