File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 11name : Publish to Maven Central
22
33on :
4- pull_request :
5- types : [closed]
4+ push :
65 branches :
76 - main
87
9-
108jobs :
119 publish :
12- if : github.event.pull_request.merged == true && contains(github.event.pull_request.head.ref, 'release')
1310 runs-on : ubuntu-latest
1411 steps :
1512 - name : Checkout code
@@ -30,11 +27,21 @@ jobs:
3027 ORG_GRADLE_PROJECT_SIGNING_KEY : ${{ secrets.SIGNING_KEY }}
3128 ORG_GRADLE_PROJECT_SIGNING_PASSWORD : ${{ secrets.SIGNING_PASSWORD }}
3229
30+ - name : Check version
31+ id : version
32+ run : |
33+ version=$(grep "attributeCachingFilesystemVersion" gradle.properties | cut -d'=' -f2 | tr -d ' ')
34+ if [[ "$version" != *"SNAPSHOT"* ]]; then
35+ echo "is_release=true" >> $GITHUB_OUTPUT
36+ else
37+ echo "is_release=false" >> $GITHUB_OUTPUT
38+ fi
39+
3340 - name : Notify Central Publisher Portal
34- if : contains(github.event.pull_request.head.ref, 'SNAPSHOT') == false
41+ if : steps.version.outputs.is_release == 'true'
3542 run : |
3643 token=$(echo -n "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" | base64)
3744 curl -X POST \
3845 -H "Authorization: Bearer $token" \
3946 -F "publishing_type=automatic" \
40- https://central.sonatype.com/manual/upload/defaultRepository/com.pkware.filesystem
47+ https://ossrh-staging-api. central.sonatype.com/manual/upload/defaultRepository/com.pkware.filesystem
You can’t perform that action at this time.
0 commit comments