Skip to content

Commit f5c71dd

Browse files
committed
👷 Add build review requirement
Mark newly built images/releases with `<!-- mark:untested -->` until manually improved. This way they won't get published via `rpi-imager.json` from OctoPrint/octoprint.org until confirmed to be working.
1 parent a8d37ec commit f5c71dd

File tree

1 file changed

+45
-2
lines changed

1 file changed

+45
-2
lines changed

.github/workflows/custopize.yml

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ jobs:
1818
build:
1919
name: "Build"
2020
runs-on: ubuntu-latest
21+
outputs:
22+
octoprint-version: ${{ env.OCTOPRINT_VERSION }}
23+
octopi-version: ${{ env.OCTOPI_VERSION }}
24+
tag: ${{ env.RELEASE_TAG }}
2125
steps:
2226

2327
- name: "⬇ Checkout"
@@ -140,10 +144,11 @@ jobs:
140144
141145
- name: "📝 Prepare release"
142146
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)"
144150
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
145151
146-
now=$(date +"%Y%m%d%H%M%S")
147152
RELEASE_TAG="${{ env.OCTOPI_VERSION }}-${{ env.OCTOPRINT_VERSION }}-$now"
148153
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
149154
@@ -156,6 +161,8 @@ jobs:
156161
* Latest kernel & bootloader
157162

158163
Created with [CustoPiZer](https://github.com/OctoPrint/CustoPiZer)
164+
165+
<!-- mark:untested -->
159166
EOF
160167

161168
- name: "🏗 Run CustoPiZer"
@@ -209,3 +216,39 @@ jobs:
209216
build/rpi-imager.json
210217
env:
211218
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

Comments
 (0)