From 11e1f0b46b90851e2bb6d9615c77dcb2466b1708 Mon Sep 17 00:00:00 2001 From: shoemoney Date: Fri, 27 Nov 2026 21:38:11 -0600 Subject: [PATCH] docs: publish checked-in release notes with screenshots on both hosts --- .github/workflows/release.yml | 7 ++++++- scripts/release.sh | 5 +++++ scripts/test-release.py | 10 ++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b35eeba..9dbfd88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,6 +39,11 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | + if [ -f "docs/releases/${{ github.ref_name }}.md" ]; then + notes=(--notes-file "docs/releases/${{ github.ref_name }}.md") + else + notes=(--generate-notes) + fi gh release create "${{ github.ref_name }}" dist/devbox_* dist/devbox-hub_* dist/install.sh dist/install.ps1 dist/SHA256SUMS \ --title "${{ github.ref_name }}" \ - --generate-notes + "${notes[@]}" diff --git a/scripts/release.sh b/scripts/release.sh index 0db94e5..55917b0 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -58,6 +58,11 @@ fi upload_tag="$TAG" [ "$TAG" != latest ] || upload_tag="latest-staging-${COMMIT:0:12}-$(date +%s)" body=$(printf 'devbox %s — built from source `%s`, binary version `%s`.\n\nBuilt-in Tailscale in the hub: `devbox-hub serve --data ./hub-data --tailscale`. No separate Tailscale installation is required on the hub. Authenticate using the logged login URL or TS_AUTHKEY; identity persists under /tailscale. Clients use the regular Tailscale app. Existing HTTP/HTTPS deployments remain supported.\n\nInstall: `curl -fsSL https://git.shoemoney.ai/%s/releases/download/%s/install.sh -o install.sh && sh install.sh --release-url https://git.shoemoney.ai/%s/releases/download/%s`\n\nAssets include 12 binaries, both installers, and SHA256SUMS. Building from source requires Go 1.27.4+.' "$TAG" "$COMMIT" "$BUILD_VERSION" "$REPO" "$TAG" "$REPO" "$TAG") +if [ -f "docs/releases/$BUILD_VERSION.md" ]; then + body="$(cat "docs/releases/$BUILD_VERSION.md") + +Built from source \`$COMMIT\`; binary version \`$BUILD_VERSION\`." +fi rel_id=$(api -X POST "$API/repos/$REPO/releases" -H 'Content-Type: application/json' \ -d "$(python3 -c 'import json,sys;print(json.dumps(dict(tag_name=sys.argv[1],target_commitish=sys.argv[2],name=sys.argv[3],body=sys.argv[4],draft=True,prerelease=False)))' "$upload_tag" "$DIST_BRANCH" "$TAG" "$body")" \ | python3 -c 'import json,sys;print(json.load(sys.stdin)["id"])') diff --git a/scripts/test-release.py b/scripts/test-release.py index 7fdef44..e73e91c 100644 --- a/scripts/test-release.py +++ b/scripts/test-release.py @@ -119,6 +119,16 @@ class ReleaseTest(unittest.TestCase): self.assertNotEqual(self.run_release('v2.1.0').returncode, 0) self.assertEqual([method for method, _, _ in self.calls], ['GET']) + def test_checked_in_release_notes_are_published(self): + notes = self.root / 'docs/releases' + notes.mkdir(parents=True) + (notes / 'v2.1.0.md').write_text('# Custom release\n\n![Screenshot](https://example.com/demo.png)\n') + result = self.run_release('v2.1.0') + self.assertEqual(result.returncode, 0, result.stderr) + create = next(json.loads(body) for method, _, body in self.calls if method == 'POST' and body.startswith(b'{')) + self.assertIn('![Screenshot]', create['body']) + self.assertIn(self.sha, create['body']) + def test_lookup_failure_does_not_publish(self): self.lookup_code = 403 self.assertNotEqual(self.run_release('latest').returncode, 0)