18
18
build :
19
19
name : " Build"
20
20
runs-on : ubuntu-latest
21
+ outputs :
22
+ octoprint-version : ${{ env.OCTOPRINT_VERSION }}
23
+ octopi-version : ${{ env.OCTOPI_VERSION }}
24
+ tag : ${{ env.RELEASE_TAG }}
21
25
steps :
22
26
23
27
- name : " ⬇ Checkout"
@@ -140,10 +144,11 @@ jobs:
140
144
141
145
- name : " 📝 Prepare release"
142
146
run : |
143
- RELEASE_NAME="OctoPi ${{ env.OCTOPI_VERSION }} with OctoPrint ${{ env.OCTOPRINT_VERSION }}"
147
+ now=$(date +"%Y%m%d%H%M%S")
148
+
149
+ RELEASE_NAME="OctoPi ${{ env.OCTOPI_VERSION }} with OctoPrint ${{ env.OCTOPRINT_VERSION }} (build $now)"
144
150
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
145
151
146
- now=$(date +"%Y%m%d%H%M%S")
147
152
RELEASE_TAG="${{ env.OCTOPI_VERSION }}-${{ env.OCTOPRINT_VERSION }}-$now"
148
153
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
149
154
@@ -156,6 +161,8 @@ jobs:
156
161
* Latest kernel & bootloader
157
162
158
163
Created with [CustoPiZer](https://github.com/OctoPrint/CustoPiZer)
164
+
165
+ <!-- mark:untested -->
159
166
EOF
160
167
161
168
- name : " 🏗 Run CustoPiZer"
@@ -209,3 +216,39 @@ jobs:
209
216
build/rpi-imager.json
210
217
env :
211
218
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
219
+
220
+ deploy :
221
+ name : " Deploy"
222
+ runs-on : ubuntu-latest
223
+ needs : build
224
+ environment : live
225
+ steps :
226
+
227
+ - uses : actions/github-script@v5
228
+ name : " ✔ Mark release as tested"
229
+ env :
230
+ TAG : " ${{ needs.build.outputs.tag }}"
231
+ with :
232
+ script : |
233
+ const { TAG } = process.env;
234
+
235
+ const owner = context.repo.owner;
236
+ const repo = context.repo.repo;
237
+ const marker = "<!-- mark:untested -->";
238
+
239
+ github.rest.repos.getReleaseByTag({
240
+ owner: owner,
241
+ repo: repo,
242
+ tag: TAG
243
+ }).then(release => {
244
+ release.data.body = release.data.body.replace(marker, "")
245
+ return github.rest.repos.updateRelease({
246
+ owner: owner,
247
+ repo: repo,
248
+ release_id: release.data.id,
249
+ body: release.data.body
250
+ })
251
+ }).catch(err => {
252
+ console.error(err)
253
+ throw new Error(`Could not update release ${TAG}`)
254
+ })
0 commit comments