@@ -60,10 +60,43 @@ jobs:
60
60
61
61
echo "result=$RESULT" >> $GITHUB_OUTPUT
62
62
63
- build :
64
- name : build (${{ matrix.config.name }})
63
+ build-type-determination :
65
64
needs : run-determination
66
65
if : needs.run-determination.outputs.result == 'true'
66
+ runs-on : ubuntu-latest
67
+ outputs :
68
+ is-release : ${{ steps.determination.outputs.is-release }}
69
+ is-nightly : ${{ steps.determination.outputs.is-nightly }}
70
+ permissions : {}
71
+ steps :
72
+ - name : Determine the type of build
73
+ id : determination
74
+ run : |
75
+ if [[
76
+ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true"
77
+ ]]; then
78
+ is_release="true"
79
+ is_nightly="false"
80
+ elif [[
81
+ "${{ github.event_name }}" == "schedule" ||
82
+ (
83
+ "${{ github.event_name }}" == "workflow_dispatch" &&
84
+ "${{ github.ref }}" == "refs/heads/main"
85
+ )
86
+ ]]; then
87
+ is_release="false"
88
+ is_nightly="true"
89
+ else
90
+ is_release="false"
91
+ is_nightly="false"
92
+ fi
93
+
94
+ echo "is-release=$is_release" >> $GITHUB_OUTPUT
95
+ echo "is-nightly=$is_nightly" >> $GITHUB_OUTPUT
96
+
97
+ build :
98
+ name : build (${{ matrix.config.name }})
99
+ needs : build-type-determination
67
100
strategy :
68
101
matrix :
69
102
config :
@@ -120,8 +153,8 @@ jobs:
120
153
AC_TEAM_ID : ${{ secrets.AC_TEAM_ID }}
121
154
AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
122
155
AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
123
- IS_NIGHTLY : ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') }}
124
- IS_RELEASE : ${{ startsWith(github.ref, 'refs/tags/') }}
156
+ IS_NIGHTLY : ${{ needs.build-type-determination.outputs.is-nightly }}
157
+ IS_RELEASE : ${{ needs.build-type-determination.outputs.is-release }}
125
158
CAN_SIGN : ${{ secrets[matrix.config.certificate-secret] != '' }}
126
159
run : |
127
160
# See: https://www.electron.build/code-signing
@@ -190,7 +223,9 @@ jobs:
190
223
path : ${{ env.JOB_TRANSFER_ARTIFACT }}/${{ matrix.artifact.path }}
191
224
192
225
changelog :
193
- needs : build
226
+ needs :
227
+ - build-type-determination
228
+ - build
194
229
runs-on : ubuntu-latest
195
230
outputs :
196
231
BODY : ${{ steps.changelog.outputs.BODY }}
@@ -203,7 +238,7 @@ jobs:
203
238
- name : Generate Changelog
204
239
id : changelog
205
240
env :
206
- IS_RELEASE : ${{ startsWith(github.ref, 'refs/tags/') }}
241
+ IS_RELEASE : ${{ needs.build-type-determination.outputs.is-release }}
207
242
run : |
208
243
export LATEST_TAG=$(git describe --abbrev=0)
209
244
export GIT_LOG=$(git log --pretty=" - %s [%h]" $LATEST_TAG..HEAD | sed 's/ *$//g')
@@ -229,15 +264,19 @@ jobs:
229
264
echo "$BODY" > CHANGELOG.txt
230
265
231
266
- name : Upload Changelog [GitHub Actions]
232
- if : github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
267
+ if : needs.build-type-determination.outputs.is-nightly == 'true'
233
268
uses : actions/upload-artifact@v3
234
269
with :
235
270
name : ${{ env.JOB_TRANSFER_ARTIFACT }}
236
271
path : CHANGELOG.txt
237
272
238
273
publish :
239
- needs : changelog
240
- if : github.repository == 'arduino/arduino-ide' && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'))
274
+ needs :
275
+ - build-type-determination
276
+ - changelog
277
+ if : >
278
+ github.repository == 'arduino/arduino-ide' &&
279
+ needs.build-type-determination.outputs.is-nightly == 'true'
241
280
runs-on : ubuntu-latest
242
281
steps :
243
282
- name : Download [GitHub Actions]
@@ -257,8 +296,10 @@ jobs:
257
296
AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
258
297
259
298
release :
260
- needs : changelog
261
- if : startsWith(github.ref, 'refs/tags/')
299
+ needs :
300
+ - build-type-determination
301
+ - changelog
302
+ if : needs.build-type-determination.outputs.is-release == 'true'
262
303
runs-on : ubuntu-latest
263
304
steps :
264
305
- name : Download [GitHub Actions]
0 commit comments