4
4
push :
5
5
tags :
6
6
- ' **'
7
- branches :
8
- - refactor/refactor-base # remove this once rebuild is merged
9
7
pull_request :
10
8
branches :
11
9
- ' **'
12
10
13
11
concurrency :
14
- # SHA is added to the end if on `main` to let all main workflows run
15
- group : ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }}
12
+ group : ${{ github.ref }}-${{ github.workflow }}
16
13
cancel-in-progress : true
17
14
18
15
permissions :
@@ -27,15 +24,23 @@ jobs:
27
24
name : Build Mac Installer
28
25
runs-on : macos-latest
29
26
steps :
30
- - uses : Chia-Network/actions/clean-workspace@main
31
-
32
27
- name : Checkout Code
33
28
uses : actions/checkout@v4
34
29
35
30
- name : Setup Node 20
36
31
uses : actions/setup-node@v4
37
32
with :
38
- node-version : ' 20.10'
33
+ node-version : ' 20.16'
34
+
35
+ - name : Change the package.json version if an RC tag
36
+ if : startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
37
+ run : |
38
+ echo "Github ref: $GITHUB_REF"
39
+ IFS='/' read -r base directory tag <<< "$GITHUB_REF"
40
+ echo "Extracted tag is $tag"
41
+
42
+ jq ".version = \"${tag}\"" package.json > package.tmp
43
+ mv package.tmp package.json
39
44
40
45
- name : Install Husky
41
46
run : npm install --save-dev husky
59
64
SIGNING_SECRET : " ${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
60
65
61
66
- name : Import Apple installer signing certificate
62
- if : steps.check_secrets.outputs.HAS_SIGNING_SECRET
67
+ if : steps.check_secrets.outputs.HAS_SIGNING_SECRET && startsWith(github.ref, 'refs/tags/')
63
68
uses : Apple-Actions/import-codesign-certs@v3
64
69
with :
65
70
p12-file-base64 : ${{ secrets.APPLE_DEV_ID_APP }}
71
76
run : npm run electron:package:mac
72
77
73
78
- name : Notarize
74
- if : steps.check_secrets.outputs.HAS_SIGNING_SECRET
79
+ if : steps.check_secrets.outputs.HAS_SIGNING_SECRET && startsWith(github.ref, 'refs/tags/')
75
80
run : |
76
81
DMG_FILE=$(find ${{ github.workspace }}/dist/ -type f -name '*.dmg')
77
82
xcrun notarytool submit \
@@ -94,10 +99,19 @@ jobs:
94
99
- name : Checkout Code
95
100
uses : actions/checkout@v4
96
101
97
- - name : Setup Node 20.10
102
+ - name : Setup Node 20.16
98
103
uses : actions/setup-node@v4
99
104
with :
100
- node-version : ' 20.10'
105
+ node-version : ' 20.16'
106
+
107
+ - name : Change the package.json version if an RC tag
108
+ if : startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
109
+ shell : bash
110
+ run : |
111
+ IFS='/' read -r base directory tag <<< "$GITHUB_REF"
112
+
113
+ jq ".version = \"${tag}\"" package.json > package.tmp
114
+ mv package.tmp package.json
101
115
102
116
- name : Install Husky
103
117
run : npm install --save-dev husky
@@ -155,10 +169,19 @@ jobs:
155
169
- name : Checkout Code
156
170
uses : actions/checkout@v4
157
171
158
- - name : Setup Node 20.10
172
+ - name : Setup Node 20.16
159
173
uses : actions/setup-node@v4
160
174
with :
161
- node-version : ' 20.10'
175
+ node-version : ' 20.16'
176
+
177
+ - name : Change the package.json version if an RC tag
178
+ if : startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
179
+ shell : bash
180
+ run : |
181
+ IFS='/' read -r base directory tag <<< "$GITHUB_REF"
182
+
183
+ jq ".version = \"${tag}\"" package.json > package.tmp
184
+ mv package.tmp package.json
162
185
163
186
- name : Install Husky
164
187
run : npm install --save-dev husky
@@ -190,10 +213,19 @@ jobs:
190
213
- name : Checkout Code
191
214
uses : actions/checkout@v4
192
215
193
- - name : Setup Node 20.10
216
+ - name : Setup Node 20.16
194
217
uses : actions/setup-node@v4
195
218
with :
196
- node-version : ' 20.10'
219
+ node-version : ' 20.16'
220
+
221
+ - name : Change the package.json version if an RC tag
222
+ if : startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
223
+ shell : bash
224
+ run : |
225
+ IFS='/' read -r base directory tag <<< "$GITHUB_REF"
226
+
227
+ jq ".version = \"${tag}\"" package.json > package.tmp
228
+ mv package.tmp package.json
197
229
198
230
- name : Install Husky
199
231
run : npm install --save-dev husky
@@ -258,29 +290,52 @@ jobs:
258
290
echo "EXE_FILE=$EXE_FILE" >>$GITHUB_ENV
259
291
echo "WEB_FILE=$WEB_FILE" >>$GITHUB_ENV
260
292
293
+ # RC release should not be set as latest
294
+ - name : Decide if release should be set as latest
295
+ id : is_latest
296
+ shell : bash
297
+ run : |
298
+ unset IS_LATEST
299
+
300
+ echo "Github ref is $GITHUB_REF"
301
+
302
+ if [[ "$GITHUB_REF" =~ "-rc" ]]; then
303
+ echo "release candidate tag matched"
304
+ IS_LATEST='false'
305
+ IS_PRERELEASE='true'
306
+ else
307
+ echo "main branch release matched"
308
+ IS_LATEST='true'
309
+ IS_PRERELEASE='false'
310
+ fi
311
+
312
+ echo "IS_LATEST=${IS_LATEST}" >> "$GITHUB_OUTPUT"
313
+ echo "IS_PRERELEASE=${IS_PRERELEASE}" >> "$GITHUB_OUTPUT"
314
+
261
315
- name : Release
262
- uses : softprops/action-gh-release@v2.2.0
316
+ uses : softprops/action-gh-release@v2
263
317
with :
318
+ prerelease : ${{steps.is_latest.outputs.IS_PRERELEASE}}
319
+ make_latest : " ${{steps.is_latest.outputs.IS_LATEST}}"
264
320
files : |
265
321
${{ env.DMG_FILE }}
266
322
${{ env.DEB_FILE }}
267
323
${{ env.EXE_FILE }}
268
324
${{ env.WEB_FILE }}
269
325
270
326
- name : Get repo name
327
+ if : startsWith(github.ref, 'refs/tags/') && !contains( github.ref, '-rc')
271
328
id : repo-name
272
329
run : |
273
330
echo "REPO_NAME=$(echo "$GITHUB_REPOSITORY" | cut -d "/" -f 2)" >>$GITHUB_OUTPUT
274
331
275
332
- name : Get tag name
333
+ if : startsWith(github.ref, 'refs/tags/') && !contains( github.ref, '-rc')
276
334
id : tag-name
277
335
run : |
278
- echo "TAGNAME=$(echo $GITHUB_REF | cut -d / -f 3)" >>$GITHUB_OUTPUT
279
-
280
- - name : Gets JWT Token from GitHub
281
- uses : Chia-Network/actions/github/jwt@main
282
336
283
337
- name : Trigger apt repo update
338
+ if : startsWith(github.ref, 'refs/tags/') && !contains( github.ref, '-rc')
284
339
uses : Chia-Network/actions/github/glue@main
285
340
with :
286
341
json_data : ' {"climate_tokenization_repo":"${{ steps.repo-name.outputs.REPO_NAME }}","application_name":"[\"${{ env.APP_NAME }}\"]","release_version":"${{ steps.tag-name.outputs.TAGNAME }}","add_debian_version":"true","arm64":"available"}'
0 commit comments