14
14
- " **.md"
15
15
- " **.yml"
16
16
workflow_dispatch :
17
- inputs :
18
- tag :
19
- description : " The tag to create (optional)"
20
- required : false
21
17
pull_request :
22
18
types :
23
19
- opened
@@ -34,7 +30,7 @@ concurrency:
34
30
# # Always cancel duplicate jobs
35
31
cancel-in-progress : true
36
32
37
- run-name : ${{ inputs.tag }}
33
+ run-name : ${{ github.ref_name }}
38
34
39
35
jobs :
40
36
# #
@@ -54,149 +50,169 @@ jobs:
54
50
with :
55
51
alias : " fmt-stacks"
56
52
53
+ # #####################################################################################
54
+ # # Check if the branch that this workflow is being run against is a release branch
55
+ check-release :
56
+ name : Check Release
57
+ needs :
58
+ - rustfmt
59
+ runs-on : ubuntu-latest
60
+ outputs :
61
+ tag : ${{ steps.check_release.outputs.tag }}
62
+ docker_tag : ${{ steps.check_release.outputs.docker_tag }}
63
+ is_release : ${{ steps.check_release.outputs.is_release }}
64
+ steps :
65
+ - name : Check Release
66
+ id : check_release
67
+ uses : stacks-network/actions/stacks-core/check-release@main
68
+ with :
69
+ tag : ${{ github.ref_name }}
70
+
57
71
# #####################################################################################
58
72
# # Create a tagged github release
59
73
# #
60
- # # Runs when the following is true :
61
- # # - tag is provided
74
+ # # Runs when:
75
+ # # - it is a release run
62
76
create-release :
63
77
if : |
64
- inputs.tag != ' '
78
+ needs.check-release.outputs.is_release == 'true '
65
79
name : Create Release
66
80
needs :
67
81
- rustfmt
82
+ - check-release
68
83
uses : ./.github/workflows/github-release.yml
69
84
with :
70
- tag : ${{ inputs.tag }}
85
+ tag : ${{ needs.check-release.outputs.tag }}
86
+ docker_tag : ${{ needs.check-release.outputs.docker_tag }}
71
87
secrets : inherit
72
88
73
89
# # Build and push Debian image built from source
74
90
# #
75
91
# # Runs when:
76
- # # - tag is not provided
92
+ # # - it is not a release run
77
93
docker-image :
78
94
if : |
79
- inputs.tag == ' '
95
+ needs.check-release.outputs.is_release != 'true '
80
96
name : Docker Image (Source)
81
97
uses : ./.github/workflows/image-build-source.yml
82
98
needs :
83
99
- rustfmt
100
+ - check-release
84
101
secrets : inherit
85
102
86
103
# # Create a reusable cache for tests
87
104
# #
88
105
# # Runs when:
89
- # # - tag is provided
106
+ # # - it is a release run
90
107
# # or:
91
- # # - no tag provided
108
+ # # - it is not a release run
92
109
# # and any of:
93
110
# # - this workflow is called manually
94
111
# # - PR is opened
95
112
# # - commit to either (development, master) branch
96
113
create-cache :
97
114
if : |
98
- inputs.tag != '' || (
99
- inputs.tag == '' && (
100
- github.event_name == 'workflow_dispatch' ||
101
- github.event_name == 'pull_request' ||
102
- github.event_name == 'merge_group' ||
103
- (
104
- contains('
105
- refs/heads/master
106
- refs/heads/develop
107
- refs/heads/next
108
- ', github.event.pull_request.head.ref) &&
109
- github.event_name == 'push'
110
- )
115
+ needs.check-release.outputs.is_release == 'true' || (
116
+ github.event_name == 'workflow_dispatch' ||
117
+ github.event_name == 'pull_request' ||
118
+ github.event_name == 'merge_group' ||
119
+ (
120
+ contains('
121
+ refs/heads/master
122
+ refs/heads/develop
123
+ refs/heads/next
124
+ ', github.event.pull_request.head.ref) &&
125
+ github.event_name == 'push'
111
126
)
112
127
)
113
128
name : Create Test Cache
114
129
needs :
115
130
- rustfmt
131
+ - check-release
116
132
uses : ./.github/workflows/create-cache.yml
117
133
118
134
# # Tests to run regularly
119
135
# #
120
136
# # Runs when:
121
- # # - tag is provided
137
+ # # - it is a release run
122
138
# # or:
123
- # # - no tag provided
139
+ # # - it is not a release run
124
140
# # and any of:
125
141
# # - this workflow is called manually
126
142
# # - PR is opened
127
143
# # - PR added to merge queue
128
144
# # - commit to either (development, next, master) branch
129
145
stacks-core-tests :
130
146
if : |
131
- inputs.tag != '' || (
132
- inputs.tag == '' && (
133
- github.event_name == 'workflow_dispatch' ||
134
- github.event_name == 'pull_request' ||
135
- github.event_name == 'merge_group' ||
136
- (
137
- contains('
138
- refs/heads/master
139
- refs/heads/develop
140
- refs/heads/next
141
- ', github.event.pull_request.head.ref) &&
142
- github.event_name == 'push'
143
- )
147
+ needs.check-release.outputs.is_release == 'true' || (
148
+ github.event_name == 'workflow_dispatch' ||
149
+ github.event_name == 'pull_request' ||
150
+ github.event_name == 'merge_group' ||
151
+ (
152
+ contains('
153
+ refs/heads/master
154
+ refs/heads/develop
155
+ refs/heads/next
156
+ ', github.event.pull_request.head.ref) &&
157
+ github.event_name == 'push'
144
158
)
145
159
)
146
160
name : Stacks Core Tests
147
161
needs :
148
162
- rustfmt
149
163
- create-cache
164
+ - check-release
150
165
uses : ./.github/workflows/stacks-core-tests.yml
151
166
152
167
bitcoin-tests :
153
168
if : |
154
- inputs.tag != '' || (
155
- inputs.tag == '' && (
156
- github.event_name == 'workflow_dispatch' ||
157
- github.event_name == 'pull_request' ||
158
- github.event_name == 'merge_group' ||
159
- (
160
- contains('
161
- refs/heads/master
162
- refs/heads/develop
163
- refs/heads/next
164
- ', github.event.pull_request.head.ref) &&
165
- github.event_name == 'push'
166
- )
169
+ needs.check-release.outputs.is_release == 'true' || (
170
+ github.event_name == 'workflow_dispatch' ||
171
+ github.event_name == 'pull_request' ||
172
+ github.event_name == 'merge_group' ||
173
+ (
174
+ contains('
175
+ refs/heads/master
176
+ refs/heads/develop
177
+ refs/heads/next
178
+ ', github.event.pull_request.head.ref) &&
179
+ github.event_name == 'push'
167
180
)
168
181
)
169
182
name : Bitcoin Tests
170
183
needs :
171
184
- rustfmt
172
185
- create-cache
186
+ - check-release
173
187
uses : ./.github/workflows/bitcoin-tests.yml
174
188
175
189
# # Test to run on a tagged release
176
190
# #
177
191
# # Runs when:
178
- # # - tag is provided
192
+ # # - it is a release run
179
193
atlas-tests :
180
- if : inputs.tag != ' '
194
+ if : needs.check-release.outputs.is_release == 'true '
181
195
name : Atlas Tests
182
196
needs :
183
197
- rustfmt
184
198
- create-cache
199
+ - check-release
185
200
uses : ./.github/workflows/atlas-tests.yml
186
201
187
202
epoch-tests :
188
- if : inputs.tag != ' '
203
+ if : needs.check-release.outputs.is_release == 'true '
189
204
name : Epoch Tests
190
205
needs :
191
206
- rustfmt
192
207
- create-cache
208
+ - check-release
193
209
uses : ./.github/workflows/epoch-tests.yml
194
210
195
211
slow-tests :
196
- if : inputs.tag != ' '
212
+ if : needs.check-release.outputs.is_release == 'true '
197
213
name : Slow Tests
198
214
needs :
199
215
- rustfmt
200
216
- create-cache
217
+ - check-release
201
218
uses : ./.github/workflows/slow-tests.yml
202
-
0 commit comments