@@ -2,10 +2,10 @@ name: Build & Release
2
2
3
3
on :
4
4
push :
5
- branches :
6
- - develop
7
5
tags :
8
6
- ' **'
7
+ branches :
8
+ - refactor/refactor-base # remove this once rebuild is merged
9
9
pull_request :
10
10
branches :
11
11
- ' **'
@@ -30,25 +30,36 @@ jobs:
30
30
- uses : Chia-Network/actions/clean-workspace@main
31
31
32
32
- name : Checkout Code
33
- uses : actions/checkout@v3
33
+ uses : actions/checkout@v4
34
34
35
- - name : Setup Node 18.16
36
- uses : actions/setup-node@v3
35
+ - name : Setup Node 20
36
+ uses : actions/setup-node@v4
37
37
with :
38
- node-version : ' 18.16 '
38
+ node-version : ' 20.10 '
39
39
40
40
- name : Install Husky
41
41
run : npm install --save-dev husky
42
42
43
43
- name : install dmg-license
44
44
run : npm i dmg-license
45
45
46
- - name : npm install and build
46
+ - name : npm install
47
47
run : |
48
48
npm install
49
- npm run build
49
+
50
+ - name : Test for secrets access
51
+ id : check_secrets
52
+ shell : bash
53
+ run : |
54
+ unset HAS_SIGNING_SECRET
55
+
56
+ if [ -n "$SIGNING_SECRET" ]; then HAS_SIGNING_SECRET='true' ; fi
57
+ echo "HAS_SIGNING_SECRET=${HAS_SIGNING_SECRET}" >> "$GITHUB_OUTPUT"
58
+ env :
59
+ SIGNING_SECRET : " ${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
50
60
51
61
- name : Import Apple installer signing certificate
62
+ if : steps.check_secrets.outputs.HAS_SIGNING_SECRET
52
63
uses : Apple-Actions/import-codesign-certs@v1
53
64
with :
54
65
p12-file-base64 : ${{ secrets.APPLE_DEV_ID_APP }}
60
71
run : npm run electron:package:mac
61
72
62
73
- name : Notarize
74
+ if : steps.check_secrets.outputs.HAS_SIGNING_SECRET
63
75
run : |
64
76
DMG_FILE=$(find ${{ github.workspace }}/dist/ -type f -name '*.dmg')
65
77
xcrun notarytool submit \
70
82
"$DMG_FILE"
71
83
72
84
- name : Upload Mac Installer
73
- uses : actions/upload-artifact@v3
85
+ uses : actions/upload-artifact@v4
74
86
with :
75
87
name : ${{ env.APP_NAME }}-mac-installer
76
88
path : ${{ github.workspace }}/dist/*.dmg
@@ -80,12 +92,12 @@ jobs:
80
92
runs-on : windows-2019
81
93
steps :
82
94
- name : Checkout Code
83
- uses : actions/checkout@v3
95
+ uses : actions/checkout@v4
84
96
85
- - name : Setup Node 18.16
86
- uses : actions/setup-node@v3
97
+ - name : Setup Node 20.10
98
+ uses : actions/setup-node@v4
87
99
with :
88
- node-version : ' 18.16 '
100
+ node-version : ' 20.10 '
89
101
90
102
- name : Install Husky
91
103
run : npm install --save-dev husky
@@ -101,6 +113,17 @@ jobs:
101
113
- name : Build electron app
102
114
run : npm run electron:package:win
103
115
116
+ - name : Test for secrets access
117
+ id : check_secrets
118
+ shell : bash
119
+ run : |
120
+ unset HAS_SIGNING_SECRET
121
+
122
+ if [ -n "$SIGNING_SECRET" ]; then HAS_SIGNING_SECRET='true' ; fi
123
+ echo "HAS_SIGNING_SECRET=${HAS_SIGNING_SECRET}" >> "$GITHUB_OUTPUT"
124
+ env :
125
+ SIGNING_SECRET : " ${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
126
+
104
127
# Windows Code Signing
105
128
- name : Get installer name for signing
106
129
shell : bash
@@ -110,6 +133,7 @@ jobs:
110
133
echo "INSTALLER_FILE=$FILE" >> "$GITHUB_ENV"
111
134
112
135
- name : Sign windows artifacts
136
+ if : steps.check_secrets.outputs.HAS_SIGNING_SECRET
113
137
uses : chia-network/actions/digicert/windows-sign@main
114
138
with :
115
139
sm_api_key : ${{ secrets.SM_API_KEY }}
@@ -119,7 +143,7 @@ jobs:
119
143
file : " ${{ github.workspace }}/${{ env.INSTALLER_FILE }}"
120
144
121
145
- name : Upload Windows Installer
122
- uses : actions/upload-artifact@v3
146
+ uses : actions/upload-artifact@v4
123
147
with :
124
148
name : ${{ env.APP_NAME }}-windows-installer
125
149
path : " ${{ github.workspace }}/${{ env.INSTALLER_FILE }}"
@@ -129,12 +153,12 @@ jobs:
129
153
runs-on : ubuntu-latest
130
154
steps :
131
155
- name : Checkout Code
132
- uses : actions/checkout@v3
156
+ uses : actions/checkout@v4
133
157
134
- - name : Setup Node 18.16
135
- uses : actions/setup-node@v3
158
+ - name : Setup Node 20.10
159
+ uses : actions/setup-node@v4
136
160
with :
137
- node-version : ' 18.16 '
161
+ node-version : ' 20.10 '
138
162
139
163
- name : Install Husky
140
164
run : npm install --save-dev husky
@@ -154,22 +178,22 @@ jobs:
154
178
mv $ORIGINAL $MODIFIED
155
179
156
180
- name : Upload Linux Installer
157
- uses : actions/upload-artifact@v3
181
+ uses : actions/upload-artifact@v4
158
182
with :
159
183
name : ${{ env.APP_NAME }}-linux-installer
160
184
path : ${{ github.workspace }}/dist/*.deb
161
185
162
186
build_web :
163
- name : Build Core Registry UI Web App
187
+ name : Build Web App
164
188
runs-on : ubuntu-latest
165
189
steps :
166
190
- name : Checkout Code
167
- uses : actions/checkout@v3
191
+ uses : actions/checkout@v4
168
192
169
- - name : Setup Node 18.16
170
- uses : actions/setup-node@v3
193
+ - name : Setup Node 20.10
194
+ uses : actions/setup-node@v4
171
195
with :
172
- node-version : ' 18.16 '
196
+ node-version : ' 20.10 '
173
197
174
198
- name : Install Husky
175
199
run : npm install --save-dev husky
@@ -181,10 +205,10 @@ jobs:
181
205
npm run build
182
206
183
207
- name : Create .tar.gz of the web build
184
- run : tar -cvzf $APP_NAME-web-build.tar.gz build
208
+ run : tar -cvzf ${{ env. APP_NAME }} -web-build.tar.gz build
185
209
186
210
- name : Upload build artifact
187
- uses : actions/upload-artifact@v3
211
+ uses : actions/upload-artifact@v4
188
212
with :
189
213
name : ${{ env.APP_NAME }}-web-build
190
214
path : ${{ env.APP_NAME }}-web-build.tar.gz
@@ -199,35 +223,35 @@ jobs:
199
223
- build_web
200
224
steps :
201
225
- name : Download Windows artifacts
202
- uses : actions/download-artifact@v3
226
+ uses : actions/download-artifact@v4
203
227
with :
204
228
name : ${{ env.APP_NAME }}-windows-installer
205
229
path : ${{ env.APP_NAME }}-windows-installer
206
230
207
231
- name : Download MacOS artifacts
208
- uses : actions/download-artifact@v3
232
+ uses : actions/download-artifact@v4
209
233
with :
210
234
name : ${{ env.APP_NAME }}-mac-installer
211
235
path : ${{ env.APP_NAME }}-mac-installer
212
236
213
237
- name : Download Linux artifacts
214
- uses : actions/download-artifact@v3
238
+ uses : actions/download-artifact@v4
215
239
with :
216
240
name : ${{ env.APP_NAME }}-linux-installer
217
241
path : ${{ env.APP_NAME }}-linux-installer
218
242
219
243
- name : Download Web artifact
220
- uses : actions/download-artifact@v3
244
+ uses : actions/download-artifact@v4
221
245
with :
222
246
name : ${{ env.APP_NAME }}-web-build
223
247
path : ${{ env.APP_NAME }}-web-build
224
248
225
249
- name : Get Filenames
226
250
run : |
227
- DMG_FILE=$(find ${{ github.workspace }}/$APP_NAME-mac-installer/ -type f -name '*.dmg')
228
- DEB_FILE=$(find ${{ github.workspace }}/$APP_NAME-linux-installer/ -type f -name '*.deb')
229
- EXE_FILE=$(find ${{ github.workspace }}/$APP_NAME-windows-installer/ -type f -name '*.exe')
230
- WEB_FILE=$(find ${{ github.workspace }}/$APP_NAME-web-build/ -type f -name '*.tar.gz')
251
+ DMG_FILE=$(find ${{ github.workspace }}/${{ env. APP_NAME }} -mac-installer/ -type f -name '*.dmg')
252
+ DEB_FILE=$(find ${{ github.workspace }}/${{ env. APP_NAME }} -linux-installer/ -type f -name '*.deb')
253
+ EXE_FILE=$(find ${{ github.workspace }}/${{ env. APP_NAME }} -windows-installer/ -type f -name '*.exe')
254
+ WEB_FILE=$(find ${{ github.workspace }}/${{ env. APP_NAME }} -web-build/ -type f -name '*.tar.gz')
231
255
232
256
echo "DMG_FILE=$DMG_FILE" >>$GITHUB_ENV
233
257
echo "DEB_FILE=$DEB_FILE" >>$GITHUB_ENV
@@ -243,20 +267,23 @@ jobs:
243
267
${{ env.EXE_FILE }}
244
268
${{ env.WEB_FILE }}
245
269
246
- - name : Get tag name
247
- id : tag-name
248
- run : |
249
- echo "TAGNAME=$(echo $GITHUB_REF | cut -d / -f 3)" >>$GITHUB_OUTPUT
250
-
251
270
- name : Get repo name
252
271
id : repo-name
253
272
run : |
254
273
echo "REPO_NAME=$(echo "$GITHUB_REPOSITORY" | cut -d "/" -f 2)" >>$GITHUB_OUTPUT
255
274
275
+ - name : Get tag name
276
+ id : tag-name
277
+ run : |
278
+ echo "TAGNAME=$(echo $GITHUB_REF | cut -d / -f 3)" >>$GITHUB_OUTPUT
279
+
256
280
- name : Gets JWT Token from GitHub
257
281
uses : Chia-Network/actions/github/jwt@main
258
282
259
283
- name : Trigger apt repo update
260
- run : |
261
- curl -s -XPOST -H "Authorization: Bearer ${{ env.JWT_TOKEN }}" --data '{"climate_tokenization_repo":"${{ steps.repo-name.outputs.REPO_NAME }}","application_name":"[\"$APP_NAME\"]","release_version":"${{ steps.tag-name.outputs.TAGNAME }}","add_debian_version":"true","arm64":"false"}' ${{ secrets.GLUE_API_URL }}/api/v1/climate-tokenization/${{ github.sha }}/start
262
- curl -s -XPOST -H "Authorization: Bearer ${{ env.JWT_TOKEN }}" --data '{"climate_tokenization_repo":"${{ steps.repo-name.outputs.REPO_NAME }}","application_name":"[\"$APP_NAME\"]","release_version":"${{ steps.tag-name.outputs.TAGNAME }}","add_debian_version":"true","arm64":"false"}' ${{ secrets.GLUE_API_URL }}/api/v1/climate-tokenization/${{ github.sha }}/success/deploy
284
+ uses : Chia-Network/actions/github/glue@main
285
+ with :
286
+ 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"}'
287
+ glue_url : ${{ secrets.GLUE_API_URL }}
288
+ glue_project : " climate-tokenization"
289
+ glue_path : " trigger"
0 commit comments