44 types : [published]
55permissions : {}
66jobs :
7- release :
7+ publish :
88 permissions :
99 contents : write # to create release
1010 issues : write # to modify milestones
11-
1211 runs-on : ubuntu-latest
13- strategy :
14- matrix :
15- java : ['11']
12+ outputs :
13+ release_version : ${{ steps.release_version.outputs.value }}
14+ target_branch : ${{ steps.extract_branch.outputs.value }}
1615 env :
1716 GIT_USER_NAME : puneetbehl
1817@@ -21,27 +20,27 @@ jobs:
2120 uses : actions/checkout@v4
2221 with :
2322 token : ${{ secrets.GH_TOKEN }}
24- - uses : gradle/wrapper-validation-action@v1
2523 - name : Set up JDK
26- uses : actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
24+ uses : actions/setup-java@v4
2725 with :
2826 distribution : ' adopt'
29- java-version : ${{ matrix.java }}
27+ java-version : ' 11 '
3028 - name : Extract Target Branch
3129 id : extract_branch
3230 run : |
3331 echo "Determining Target Branch"
3432 TARGET_BRANCH=`cat $GITHUB_EVENT_PATH | jq '.release.target_commitish' | sed -e 's/^"\(.*\)"$/\1/g'`
3533 echo $TARGET_BRANCH
36- echo ::set-output name= value:: ${TARGET_BRANCH}
34+ echo " value= ${TARGET_BRANCH}" >> $GITHUB_OUTPUT
3735 - name : Set the current release version
3836 id : release_version
39- run : echo "release_version =${GITHUB_REF:11}" >> $GITHUB_OUTPUT
37+ run : echo "value =${GITHUB_REF:11}" >> $GITHUB_OUTPUT
4038 - name : Run pre-release
4139 uses : ./.github/actions/pre-release
4240 with :
4341 token : ${{ secrets.GITHUB_TOKEN }}
4442 - name : Run Assemble
43+ if : success()
4544 id : assemble
4645 uses : gradle/gradle-build-action@v2
4746 with :
@@ -50,13 +49,28 @@ jobs:
5049 GRADLE_ENTERPRISE_ACCESS_KEY : ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
5150 GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER : ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
5251 GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY : ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
52+ - name : Upload Distribution
53+ if : success()
54+ uses : actions/upload-artifact@v3
55+ with :
56+ name : grails-${{ steps.release_version.outputs.value }}.zip
57+ path : build/distributions/grails-${{ steps.release_version.outputs.value }}.zip
58+ - name : Upload artifacts to the Github release
59+ if : success()
60+ id : upload_artifact
61+ uses : Roang-zero1/github-upload-release-artifacts-action@master
62+ with :
63+ args : build/distributions/grails-${{ steps.release_version.outputs.value }}.zip
64+ env :
65+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5366 - name : Generate secring file
67+ if : success() && false
5468 env :
5569 SECRING_FILE : ${{ secrets.SECRING_FILE }}
5670 run : echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
5771 - name : Publish to Sonatype OSSRH
5872 id : publish
59- if : steps.assemble.outcome == 'success'
73+ if : success() && false
6074 uses : gradle/gradle-build-action@v2
6175 env :
6276 GRADLE_ENTERPRISE_ACCESS_KEY : ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
@@ -71,48 +85,52 @@ jobs:
7185 SECRING_FILE : ${{ secrets.SECRING_FILE }}
7286 with :
7387 arguments : -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeAndReleaseSonatypeStagingRepository
74- - name : Export Gradle Properties
75- uses : micronaut-projects/github-actions/export-gradle-properties@master
7688 - name : Run post-release
77- if : steps.publish.outcome == ' success'
89+ if : success()
7890 uses : ./.github/actions/post-release
7991 with :
8092 token : ${{ secrets.GITHUB_TOKEN }}
8193 env :
8294 SNAPSHOT_SUFFIX : -SNAPSHOT
83- - name : Upload artifacts to the Github release
84- id : upload_artifact
85- if : steps.publish.outcome == 'success'
86- uses : Roang-zero1/github-upload-release-artifacts-action@master
87- with :
88- args : build/distributions/grails-${{ steps.release_version.outputs.release_version }}.zip
89- env :
90- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
91- - name : Create Message for the Grails Documentation Release
92- if : steps.publish.outcome == 'success'
93- id : grails_docs_release_message
95+ docs :
96+ needs : publish
97+ runs-on : ubuntu-latest
98+ permissions :
99+ contents : read
100+ steps :
101+ - name : Prepare Input
102+ id : prep_inputs
94103 run : |
95104 echo "value={\"grails_version\":\"$RELEASE_VERSION\"}" >> $GITHUB_OUTPUT
96105 env :
97- RELEASE_VERSION : ${{ steps.release_version .outputs.release_version }}
106+ RELEASE_VERSION : ${{ needs.publish .outputs.release_version }}
98107 - name : Invoke grails-doc release workflow
99- if : steps.publish.outcome == 'success'
100- id : grails_doc
101108102109 with :
103110 workflow : Release
104111 repo : grails/grails-doc
105- ref : ${{ steps.extract_branch .outputs.value }}
112+ ref : ${{ needs.publish .outputs.target_branch }}
106113 token : ${{ secrets.GH_TOKEN }}
107- inputs : ${{ steps.grails_docs_release_message.outputs.value }}
114+ inputs : ${{ steps.prep_inputs.outputs.value }}
115+ website :
116+ needs : publish
117+ runs-on : ubuntu-latest
118+ permissions :
119+ contents : read
120+ steps :
121+ - name : Prepare Input
122+ id : prep_inputs
123+ run : |
124+ echo "value={\"grails_version\":\"$RELEASE_VERSION\"}" >> $GITHUB_OUTPUT
125+ env :
126+ RELEASE_VERSION : ${{ needs.publish.outputs.release_version }}
108127 - name : Invoke grails-static-website release workflow
109- if : steps.publish.outcome == ' success'
128+ if : success()
110129 id : grails_static_website
111130112131 with :
113132 workflow : Release
114133 repo : grails/grails-static-website
115134 ref : master
116135 token : ${{ secrets.GH_TOKEN }}
117- inputs : ${{ steps.grails_docs_release_message.outputs.value }}
118-
136+ inputs : ${{ steps.prep_inputs.outputs.value }}
0 commit comments