Skip to content

Commit 6c2f877

Browse files
authored
Merge pull request #1082 from SlideRuleEarth/issue-1081-local-release-notes
Maintain web client release notes locally (#1081)
2 parents 0558e90 + 53219c4 commit 6c2f877

13 files changed

Lines changed: 317 additions & 10 deletions

File tree

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ doctor: ## Check that your Node/npm versions match .nvmrc and the packageManager
5959

6060
src-tag-and-push: ## Tag and push the web client source code to the repository
6161
$(ROOT)/VITE_VERSION.sh $(VERSION) && git push --tags; git push
62+
$(ROOT)/publish-gh-release.sh $(VERSION)
63+
64+
gen-release-notes: ## Generate web-client release notes draft from git log NEEDS VERSION
65+
$(ROOT)/gen-release-notes.sh $(VERSION)
6266

6367
upload-assets: ## Upload hashed JS/CSS assets with long cache duration
6468
export AWS_MAX_ATTEMPTS=10 AWS_RETRY_MODE=standard && \

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,63 @@ This project is designed to be deployed as a secure static site using Amazon Clo
7777

7878
We use [HashiCorp Terraform](https://www.terraform.io/) to deploy this website.
7979

80+
### Releasing
81+
82+
The recommended workflow is to release a new tagged version to the test site first,
83+
sanity-check it, then promote that same build to production.
84+
85+
**1. Tag and release to test** (requires `VERSION` in `vX.Y.Z` form):
86+
87+
```bash
88+
make release-live-update-to-testsliderule VERSION=v4.5.3
89+
```
90+
91+
This step does all the version-stamping work:
92+
93+
1. **Generates and commits the release notes** for the version from the git commit
94+
subjects since the previous tag, then creates and pushes the annotated `vX.Y.Z`
95+
tag (`src-tag-and-push``VITE_VERSION.sh``gen-release-notes.sh`).
96+
2. **Mirrors the notes to a GitHub Release** (`publish-gh-release.sh`). This step is
97+
non-fatal — if the `gh` CLI is missing or unauthenticated it warns and is skipped,
98+
so it never blocks a deploy.
99+
3. **Builds and deploys** the client to **testsliderule.org** — the tag is injected
100+
as `VITE_APP_VERSION`, assets are uploaded to S3, and CloudFront is invalidated.
101+
102+
Sanity-check the result at <https://client.testsliderule.org>.
103+
104+
**2. Promote the same tagged build to production:**
105+
106+
```bash
107+
make live-update-slideruleearth
108+
```
109+
110+
This rebuilds the current checkout and deploys it to **slideruleearth.io**. It does
111+
**not** create a new tag — the build reads the existing tag via `git describe --tags`,
112+
so the release notes and the GitHub Release are created exactly once, during step 1.
113+
114+
> A one-shot `make release-live-update-to-slideruleearth VERSION=v4.5.3` also exists
115+
> (it tags and deploys straight to production), but the test-first workflow above is
116+
> recommended.
117+
118+
### Release notes
119+
120+
Web-client release notes are maintained in this repo as one Markdown file per
121+
version under `web-client/src/assets/content/release-notes/` (e.g. `v4.5.3.md`).
122+
They are bundled into the client at build time and shown in the **Web Client
123+
Releases** tab on the landing page (the **SlideRule Releases** tab continues to
124+
show the platform/server notes from the docs site).
125+
126+
The release flow auto-generates a draft from the commits since the previous tag.
127+
To curate the notes before releasing, generate the draft first, edit it, then run
128+
the release (step 1 above) — an existing file is preserved (use `--force` to
129+
regenerate):
130+
131+
```bash
132+
make gen-release-notes VERSION=v4.5.3 # writes .../release-notes/v4.5.3.md
133+
# edit the generated file...
134+
make release-live-update-to-testsliderule VERSION=v4.5.3
135+
```
136+
80137
## License
81138

82139
This project is licensed under the following University of Washington Open Source License - see the [LICENSE](LICENSE) file for details.

VITE_VERSION.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ if git tag -l | grep -w $VERSION; then
1616
exit 1
1717
fi
1818

19+
#
20+
# Generate (if missing) and commit the web-client release notes for this version
21+
# BEFORE tagging, so the tag — and the build, which reads the tag for
22+
# VITE_APP_VERSION — includes the notes file. A pre-existing file (e.g. one a
23+
# developer generated via `make gen-release-notes` and hand-edited) is preserved.
24+
#
25+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
26+
ROOT_DIR="$(git rev-parse --show-toplevel)"
27+
NOTES_FILE="$ROOT_DIR/web-client/src/assets/content/release-notes/$VERSION.md"
28+
"$SCRIPT_DIR/gen-release-notes.sh" "$VERSION"
29+
git add "$NOTES_FILE"
30+
if ! git diff --cached --quiet -- "$NOTES_FILE"; then
31+
git commit -m "Add release notes for $VERSION"
32+
fi
33+
1934
#
2035
# Create tag and acrhive
2136
#

gen-release-notes.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
#
3+
# Generate a web-client release-notes markdown file for a given version,
4+
# derived from the git commit subjects since the previous tag.
5+
#
6+
# Usage:
7+
# gen-release-notes.sh <vX.Y.Z> [--force]
8+
#
9+
# Writes web-client/src/assets/content/release-notes/<vX.Y.Z>.md
10+
# These files are bundled into the web client at build time (see LandingView.vue)
11+
# and mirrored to a GitHub Release at tag time (see publish-gh-release.sh).
12+
#
13+
# Idempotent: an existing file is left untouched unless --force is passed. This
14+
# lets a developer pre-generate the draft (`make gen-release-notes VERSION=...`),
15+
# hand-edit it, and have the tag flow preserve their edits.
16+
#
17+
set -euo pipefail
18+
19+
VERSION="${1:-}"
20+
FORCE="${2:-}"
21+
22+
if [[ "$VERSION" != "v"*"."*"."* ]]; then
23+
echo "Usage: gen-release-notes.sh <vX.Y.Z> [--force]" >&2
24+
echo "Invalid version number: '$VERSION'" >&2
25+
exit 1
26+
fi
27+
28+
ROOT_DIR="$(git rev-parse --show-toplevel)"
29+
NOTES_DIR="$ROOT_DIR/web-client/src/assets/content/release-notes"
30+
NOTES_FILE="$NOTES_DIR/$VERSION.md"
31+
32+
if [[ -f "$NOTES_FILE" && "$FORCE" != "--force" ]]; then
33+
echo "Release notes already exist: $NOTES_FILE (use --force to regenerate)"
34+
exit 0
35+
fi
36+
37+
mkdir -p "$NOTES_DIR"
38+
39+
# Previous tag — computed before the new tag is created. Falls back to the full
40+
# history when no tags exist yet (first release).
41+
PREV_TAG="$(git describe --tags --abbrev=0 2>/dev/null || true)"
42+
if [[ -n "$PREV_TAG" ]]; then
43+
RANGE="$PREV_TAG..HEAD"
44+
else
45+
RANGE="HEAD"
46+
fi
47+
48+
BODY="$(git log "$RANGE" --no-merges --pretty='- %s (%h)')"
49+
if [[ -z "$BODY" ]]; then
50+
BODY="- No notable changes."
51+
fi
52+
53+
DATE="$(date +%Y-%m-%d)"
54+
55+
{
56+
echo "# $VERSION$DATE"
57+
echo
58+
echo "$BODY"
59+
} > "$NOTES_FILE"
60+
61+
echo "Wrote $NOTES_FILE"

publish-gh-release.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
#
3+
# Mirror a web-client release-notes file to a GitHub Release.
4+
#
5+
# Usage:
6+
# publish-gh-release.sh <vX.Y.Z>
7+
#
8+
# The committed markdown file remains the source of truth and is bundled into the
9+
# client; this just publishes the same notes to github.com so the Releases page
10+
# is populated. Run AFTER the tag has been pushed (see `src-tag-and-push`).
11+
#
12+
# This is intentionally non-fatal: a missing/unauthenticated `gh`, or a GitHub
13+
# API hiccup, must never break a deploy. It warns and exits 0 in those cases.
14+
#
15+
set -uo pipefail
16+
17+
VERSION="${1:-}"
18+
19+
if [[ "$VERSION" != "v"*"."*"."* ]]; then
20+
echo "Usage: publish-gh-release.sh <vX.Y.Z>" >&2
21+
echo "Invalid version number: '$VERSION'" >&2
22+
exit 1
23+
fi
24+
25+
ROOT_DIR="$(git rev-parse --show-toplevel)"
26+
NOTES_FILE="$ROOT_DIR/web-client/src/assets/content/release-notes/$VERSION.md"
27+
28+
if [[ ! -f "$NOTES_FILE" ]]; then
29+
echo "WARNING: no release-notes file at $NOTES_FILE — skipping GitHub Release." >&2
30+
exit 0
31+
fi
32+
33+
if ! command -v gh >/dev/null 2>&1; then
34+
echo "WARNING: 'gh' CLI not found — skipping GitHub Release for $VERSION." >&2
35+
exit 0
36+
fi
37+
38+
if ! gh auth status >/dev/null 2>&1; then
39+
echo "WARNING: 'gh' not authenticated — skipping GitHub Release for $VERSION." >&2
40+
exit 0
41+
fi
42+
43+
# Update in place if the release already exists, otherwise create it.
44+
if gh release view "$VERSION" >/dev/null 2>&1; then
45+
echo "Updating existing GitHub Release $VERSION..."
46+
gh release edit "$VERSION" --title "$VERSION" --notes-file "$NOTES_FILE" \
47+
|| echo "WARNING: failed to update GitHub Release $VERSION (continuing)." >&2
48+
else
49+
echo "Creating GitHub Release $VERSION..."
50+
gh release create "$VERSION" --title "$VERSION" --notes-file "$NOTES_FILE" \
51+
|| echo "WARNING: failed to create GitHub Release $VERSION (continuing)." >&2
52+
fi
53+
54+
exit 0
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# v4.4.4 — 2026-05-13
2+
3+
- Decouple plot and map point caps (#1070) (bd91a1b9)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# v4.4.5 — 2026-05-20
2+
3+
- updated articles location to new docs path; added easter egg globe view (8c3c47c6)
4+
- polished global view (51a96c7c)
5+
- added atl18 skin to globe (81c68f43)
6+
- updated some bathy types that were fixed on the server side (ef4df7fd)
7+
- initial commit for globe (df5a4012)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# v4.4.6 — 2026-05-20
2+
3+
- updated terraform lock file when deployment executed on linux machine (a04545b6)
4+
- added docs.slideruleearth.io as a trusted image src (c1f660ce)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# v4.5.0 — 2026-05-28
2+
3+
- Scope advanced parameters to the selected endpoint (#1074) (3ef7669b)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# v4.5.1 — 2026-06-08
2+
3+
- landing page release both web client and server release notes (7a16e4e2)
4+
- updated landing page to pull release notes instead of articles (fc23ef4f)

0 commit comments

Comments
 (0)