15
15
required : false
16
16
default : false
17
17
type : boolean
18
- doTests :
19
- description : ' Run tests before the release'
20
- required : false
21
- default : true
22
- type : boolean
23
18
24
19
env :
25
20
MODULE_ID : cbvalidation
21
+ SNAPSHOT : ${{ inputs.snapshot || false }}
26
22
27
23
jobs :
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/[email protected]
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
-
58
24
# #########################################################################################
59
25
# Build & Publish
60
26
# #########################################################################################
61
27
build :
62
28
name : Build & Publish
63
- if : ${{ success() || !inputs.doTests }}
64
- needs : [ tests, format ]
65
29
runs-on : ubuntu-20.04
66
30
steps :
67
31
- name : Checkout Repository
68
32
uses : actions/checkout@v3
69
33
70
- - name : Setup Java
71
- uses : actions/setup-java@v3
72
- with :
73
- distribution : " temurin"
74
- java-version : " 11"
75
-
76
34
- name : Setup CommandBox
77
35
uses :
Ortus-Solutions/[email protected]
78
36
with :
79
37
forgeboxAPIKey : ${{ secrets.FORGEBOX_TOKEN }}
80
38
81
- - name : Setup Environment Variables For Build Process
39
+ - name : " Setup Environment Variables For Build Process"
82
40
id : current_version
83
41
run : |
84
42
echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
93
51
94
52
- name : Update changelog [unreleased] with latest version
95
53
uses :
thomaseizinger/[email protected]
96
- if : ${{ !inputs.snapshot }}
54
+ if : env.SNAPSHOT == 'false'
97
55
with :
98
56
changelogPath : ./changelog.md
99
57
tag : v${{ env.VERSION }}
105
63
106
64
- name : Commit Changelog To Master
107
65
108
- if : ${{ !inputs.snapshot }}
66
+ if : env.SNAPSHOT == 'false'
109
67
with :
110
68
author_name : Github Actions
111
69
114
72
115
73
- name : Tag Version
116
74
117
- if : ${{ !inputs.snapshot }}
75
+ if : env.SNAPSHOT == 'false'
118
76
with :
119
77
tag : " v${{ env.VERSION }}"
120
78
force_push_tag : true
136
94
- name : Create Github Release
137
95
138
96
continue-on-error : true
139
- if : ${{ !inputs.snapshot }}
97
+ if : env.SNAPSHOT == 'false'
140
98
with :
141
99
title : ${{ env.VERSION }}
142
100
changelog : changelog.md
@@ -146,18 +104,23 @@ jobs:
146
104
# #########################################################################################
147
105
# Prep Next Release
148
106
# #########################################################################################
149
- prep-next-release :
107
+ prep_next_release :
150
108
name : Prep Next Release
151
- if : ${{ !inputs.snapshot && success() }}
152
- needs : [ build ]
109
+ if : github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
153
110
runs-on : ubuntu-20.04
111
+ needs : [ build ]
154
112
steps :
155
113
# Checkout development
156
114
- name : Checkout Repository
157
115
uses : actions/checkout@v3
158
116
with :
159
117
ref : development
160
118
119
+ - name : Setup CommandBox
120
+ uses :
Ortus-Solutions/[email protected]
121
+ with :
122
+ forgeboxAPIKey : ${{ secrets.FORGEBOX_TOKEN }}
123
+
161
124
- name : Download build artifacts
162
125
uses : actions/download-artifact@v2
163
126
with :
0 commit comments