1515 required : false
1616 default : false
1717 type : boolean
18- doTests :
19- description : ' Run tests before the release'
20- required : false
21- default : true
22- type : boolean
2318
2419env :
2520 MODULE_ID : cbvalidation
21+ SNAPSHOT : ${{ inputs.snapshot || false }}
2622
2723jobs :
28- # #########################################################################################
29- # Module Tests
30- # #########################################################################################
31- tests :
32- if : ${{ inputs.doTests }}
33- secrets : inherit
34- uses : ./.github/workflows/tests.yml
35-
36- # #########################################################################################
37- # Format Source Code
38- # This only fires on `development`, stable releases should not have auto-formatting
39- # #########################################################################################
40- format :
41- name : Code Auto-Formatting
42- runs-on : ubuntu-20.04
43- if : ${{ inputs.snapshot && ( success() || !inputs.doTests ) }}
44- needs : [ tests ]
45- steps :
46- - uses : actions/checkout@v3
47-
48- - name : Auto-format
49- uses : Ortus-Solutions/commandbox-action@v1.0.2
50- with :
51- cmd : run-script format
52-
53- - name : Commit Format Changes
54- uses : stefanzweifel/git-auto-commit-action@v4
55- with :
56- commit_message : Apply cfformat changes
57-
5824 # #########################################################################################
5925 # Build & Publish
6026 # #########################################################################################
6127 build :
6228 name : Build & Publish
63- if : ${{ success() || !inputs.doTests }}
64- needs : [ tests, format ]
6529 runs-on : ubuntu-20.04
6630 steps :
6731 - name : Checkout Repository
6832 uses : actions/checkout@v3
6933
70- - name : Setup Java
71- uses : actions/setup-java@v3
72- with :
73- distribution : " temurin"
74- java-version : " 11"
75-
7634 - name : Setup CommandBox
7735 uses : Ortus-Solutions/setup-commandbox@v2.0.1
7836 with :
7937 forgeboxAPIKey : ${{ secrets.FORGEBOX_TOKEN }}
8038
81- - name : Setup Environment Variables For Build Process
39+ - name : " Setup Environment Variables For Build Process"
8240 id : current_version
8341 run : |
8442 echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
9351
9452 - name : Update changelog [unreleased] with latest version
9553 uses : thomaseizinger/keep-a-changelog-new-release@1.3.0
96- if : ${{ !inputs.snapshot }}
54+ if : env.SNAPSHOT == 'false'
9755 with :
9856 changelogPath : ./changelog.md
9957 tag : v${{ env.VERSION }}
10563
10664 - name : Commit Changelog To Master
10765 uses : EndBug/add-and-commit@v9.1.1
108- if : ${{ !inputs.snapshot }}
66+ if : env.SNAPSHOT == 'false'
10967 with :
11068 author_name : Github Actions
11169 author_email : info@ortussolutions.com
11472
11573 - name : Tag Version
11674 uses : rickstaa/action-create-tag@v1.6.1
117- if : ${{ !inputs.snapshot }}
75+ if : env.SNAPSHOT == 'false'
11876 with :
11977 tag : " v${{ env.VERSION }}"
12078 force_push_tag : true
13694 - name : Create Github Release
13795 uses : taiki-e/create-gh-release-action@v1.6.2
13896 continue-on-error : true
139- if : ${{ !inputs.snapshot }}
97+ if : env.SNAPSHOT == 'false'
14098 with :
14199 title : ${{ env.VERSION }}
142100 changelog : changelog.md
@@ -146,18 +104,23 @@ jobs:
146104 # #########################################################################################
147105 # Prep Next Release
148106 # #########################################################################################
149- prep-next-release :
107+ prep_next_release :
150108 name : Prep Next Release
151- if : ${{ !inputs.snapshot && success() }}
152- needs : [ build ]
109+ if : github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
153110 runs-on : ubuntu-20.04
111+ needs : [ build ]
154112 steps :
155113 # Checkout development
156114 - name : Checkout Repository
157115 uses : actions/checkout@v3
158116 with :
159117 ref : development
160118
119+ - name : Setup CommandBox
120+ uses : Ortus-Solutions/setup-commandbox@v2.0.1
121+ with :
122+ forgeboxAPIKey : ${{ secrets.FORGEBOX_TOKEN }}
123+
161124 - name : Download build artifacts
162125 uses : actions/download-artifact@v2
163126 with :
0 commit comments