1- name : Build a Release
1+ name : Release
22
33on :
44 # If you push to master|main this will trigger a stable release
1616 default : false
1717 type : boolean
1818
19+ # Manual Trigger
20+ workflow_dispatch :
21+
1922env :
20- MODULE_ID : MockDataCFC
23+ MODULE_ID : ${{ github.event.repository.name }}
24+ JDK : 21
2125 SNAPSHOT : ${{ inputs.snapshot || false }}
26+ BUILD_ID : ${{ github.run_number }}
2227
2328jobs :
2429 # #########################################################################################
2530 # Build & Publish
2631 # #########################################################################################
2732 build :
2833 name : Build & Publish
29- runs-on : ubuntu-20.04
34+ runs-on : ubuntu-latest
35+ permissions :
36+ checks : write
37+ pull-requests : write
38+ contents : write
39+ issues : write
3040 steps :
3141 - name : Checkout Repository
3242 uses : actions/checkout@v4
3646 with :
3747 forgeboxAPIKey : ${{ secrets.FORGEBOX_TOKEN }}
3848
49+ - name : Setup Java
50+ uses : actions/setup-java@v4
51+ with :
52+ distribution : " temurin"
53+ java-version : ${{ env.JDK }}
54+
3955 - name : " Setup Environment Variables For Build Process"
4056 id : current_version
4157 run : |
5066 fi
5167
5268 - name : Update changelog [unreleased] with latest version
53- uses : thomaseizinger/keep-a-changelog-new-release@1.3 .0
69+ uses : thomaseizinger/keep-a-changelog-new-release@3.1 .0
5470 if : env.SNAPSHOT == 'false'
5571 with :
5672 changelogPath : ./changelog.md
@@ -61,10 +77,10 @@ jobs:
6177 npm install -g markdownlint-cli
6278 markdownlint changelog.md --fix
6379 box install commandbox-docbox
64- box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }}
80+ box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ env.BUILD_ID }} :branch=${{ env.BRANCH }}
6581
66- - name : Commit Changelog To Master
67- uses : EndBug/add-and-commit@v9.1.1
82+ - name : Commit Changelog [unreleased] with latest version
83+ uses : EndBug/add-and-commit@v9.1.4
6884 if : env.SNAPSHOT == 'false'
6985 with :
7086 author_name : Github Actions
7389 add : changelog.md
7490
7591 - name : Tag Version
76- uses : rickstaa/action-create-tag@v1.6.1
92+ uses : rickstaa/action-create-tag@v1.7.2
7793 if : env.SNAPSHOT == 'false'
7894 with :
7995 tag : " v${{ env.VERSION }}"
@@ -118,23 +134,41 @@ jobs:
118134 box forgebox publish --force
119135
120136 - name : Create Github Release
121- uses : taiki-e/create-gh-release-action@v1.6.2
137+ uses : taiki-e/create-gh-release-action@v1.8.0
122138 continue-on-error : true
123139 if : env.SNAPSHOT == 'false'
140+ id : create_release
124141 with :
125142 title : ${{ env.VERSION }}
126143 changelog : changelog.md
127144 token : ${{ secrets.GITHUB_TOKEN }}
128145 ref : refs/tags/v${{ env.VERSION }}
129146
147+ - name : Inform Slack
148+ if : ${{ always() }}
149+ uses : rtCamp/action-slack-notify@v2
150+ env :
151+ SLACK_CHANNEL : coding
152+ SLACK_COLOR : ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
153+ SLACK_ICON_EMOJI : " :bell:"
154+ SLACK_MESSAGE : " Module ${{ env.MODULE_ID }} v${{ env.VERSION }} Built with ${{ job.status }}!"
155+ SLACK_TITLE : " ColdBox Module ${{ env.MODULE_ID }}"
156+ SLACK_USERNAME : CI
157+ SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK_URL }}
158+
130159 # #########################################################################################
131160 # Prep Next Release
132161 # #########################################################################################
133162 prep_next_release :
134163 name : Prep Next Release
135164 if : github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
136- runs-on : ubuntu-20.04
165+ runs-on : ubuntu-latest
137166 needs : [ build ]
167+ permissions :
168+ checks : write
169+ pull-requests : write
170+ contents : write
171+ issues : write
138172 steps :
139173 # Checkout development
140174 - name : Checkout Repository
@@ -148,7 +182,7 @@ jobs:
148182 forgeboxAPIKey : ${{ secrets.FORGEBOX_TOKEN }}
149183
150184 - name : Download build artifacts
151- uses : actions/download-artifact@v2
185+ uses : actions/download-artifact@v4
152186 with :
153187 name : ${{ env.MODULE_ID }}
154188 path : .tmp
@@ -165,7 +199,7 @@ jobs:
165199
166200 # Commit it back to development
167201 - name : Commit Version Bump
168- uses : EndBug/add-and-commit@v9.1.1
202+ uses : EndBug/add-and-commit@v9.1.4
169203 with :
170204 author_name : Github Actions
171205 author_email : info@ortussolutions.com
0 commit comments