docs: publish checked-in release notes with screenshots on both hosts
Some checks are pending
CI / vet-build-test (push) Waiting to run
Some checks are pending
CI / vet-build-test (push) Waiting to run
This commit is contained in:
parent
c655e941bc
commit
11e1f0b46b
3 changed files with 21 additions and 1 deletions
7
.github/workflows/release.yml
vendored
7
.github/workflows/release.yml
vendored
|
|
@ -39,6 +39,11 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
run: |
|
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 \
|
gh release create "${{ github.ref_name }}" dist/devbox_* dist/devbox-hub_* dist/install.sh dist/install.ps1 dist/SHA256SUMS \
|
||||||
--title "${{ github.ref_name }}" \
|
--title "${{ github.ref_name }}" \
|
||||||
--generate-notes
|
"${notes[@]}"
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,11 @@ fi
|
||||||
upload_tag="$TAG"
|
upload_tag="$TAG"
|
||||||
[ "$TAG" != latest ] || upload_tag="latest-staging-${COMMIT:0:12}-$(date +%s)"
|
[ "$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 <data>/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")
|
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 <data>/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' \
|
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")" \
|
-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"])')
|
| python3 -c 'import json,sys;print(json.load(sys.stdin)["id"])')
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,16 @@ class ReleaseTest(unittest.TestCase):
|
||||||
self.assertNotEqual(self.run_release('v2.1.0').returncode, 0)
|
self.assertNotEqual(self.run_release('v2.1.0').returncode, 0)
|
||||||
self.assertEqual([method for method, _, _ in self.calls], ['GET'])
|
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\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):
|
def test_lookup_failure_does_not_publish(self):
|
||||||
self.lookup_code = 403
|
self.lookup_code = 403
|
||||||
self.assertNotEqual(self.run_release('latest').returncode, 0)
|
self.assertNotEqual(self.run_release('latest').returncode, 0)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue