Skip to content

Commit 47abbda

Browse files
Merge pull request #74 from OpenAstroTech/feature/update-checker
Add GitHub release update checker
2 parents ded6d9f + 0b0b530 commit 47abbda

22 files changed

Lines changed: 2119 additions & 471 deletions

.claude/commands/release.md

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
name: release
3+
description: Use when the user wants to create a release, make a release, ship, cut a release, or publish a new version of OATControl. Triggers on phrases like "make a release", "let's ship", "let's release", "create a release", "ship it", "cut a release", "new release", "/release".
4+
---
5+
6+
# OATControl Release
7+
8+
Create a new OATControl release. Follow these steps in order. Stop and ask the user before proceeding if any step fails.
9+
10+
## Pre-flight
11+
12+
1. Verify `gh` CLI is available and authenticated (`gh auth status`)
13+
2. Verify `curl` is available (`which curl`)
14+
3. Verify git working tree is clean (`git status`)
15+
4. If either fails, stop and tell the user what to fix
16+
17+
## Step 1: Version
18+
19+
1. Read current version from `OATControl/Properties/AssemblyInfo.cs` line 54: `[assembly: AssemblyVersion("X.Y.Z.W")]`
20+
2. Show the current version to the user
21+
3. Propose the next version by bumping the minor segment (e.g. `1.2.0.0``1.3.0.0`)
22+
4. Ask the user to confirm or provide a different version
23+
5. Validate the new version is strictly higher than the current version
24+
6. Store as `$VERSION` (e.g. `1.3.0.0`) and `$TAG` (e.g. `V1.3.0.0`)
25+
26+
## Step 2: Version Bump
27+
28+
Update these two files:
29+
30+
**`OATControl/Properties/AssemblyInfo.cs`** — Update both lines:
31+
```
32+
[assembly: AssemblyVersion("$VERSION")]
33+
[assembly: AssemblyFileVersion("$VERSION")]
34+
```
35+
36+
**`OATControl/OATControl Setup.iss`** — Update line 5:
37+
```
38+
#define MyAppVersion "$VERSION"
39+
```
40+
41+
## Step 3: Changelog + Readme
42+
43+
1. Get the last release tag: `git tag --sort=-v:refname | grep -E '^V1\.' | head -1`
44+
2. Get commits since that tag: `git log $LAST_TAG..HEAD --oneline`
45+
3. Generate bullet points from the commit messages (combine related commits, make them concise)
46+
4. Present the bullet list to the user for editing
47+
5. Once approved, prepend to both files:
48+
49+
**`OATControl/CHANGELOG.md`** — Markdown format:
50+
```markdown
51+
## OATControl V$VERSION ($DATE)
52+
53+
- Change one.
54+
- Change two.
55+
```
56+
57+
**`OATControl/Readme.txt`** — Plain text format matching existing entries. Use the exact column alignment pattern:
58+
```
59+
OATControl V$VERSION $DATE
60+
- One-line change.
61+
- Another change.
62+
```
63+
The date format is `%d %b %Y` (e.g. `24 May 2026`). The header line is 65 characters wide — pad with spaces so the date aligns to the right edge.
64+
65+
## Step 4: Commit
66+
67+
1. Stage only the changed files: `AssemblyInfo.cs`, `OATControl Setup.iss`, `CHANGELOG.md`, `Readme.txt`
68+
2. Commit: `git commit -m "Release $TAG"`
69+
3. Push the commit to the remote branch
70+
71+
## Step 5: Create or Update PR
72+
73+
1. Check if an open PR exists: `gh pr list --head <branch> --state open`
74+
2. If no PR exists, create one with the release changes included in the description
75+
3. If PR already exists, it's now updated with the release files
76+
4. Tell the user to **merge the PR** and wait for confirmation
77+
78+
## Step 6: Switch to Master
79+
80+
After the PR is merged:
81+
82+
1. Switch to master and pull the merge:
83+
```
84+
git checkout master && git pull
85+
```
86+
2. Tag the merge commit:
87+
```
88+
git tag -a $TAG -m "Release $TAG"
89+
```
90+
3. Push the tag: `git push --tags`
91+
92+
## Step 7: Build Pause
93+
94+
Tell the user:
95+
96+
> **Build required.** Please do the following in Visual Studio:
97+
> 1. Build OATControl in **Release** mode
98+
> 2. Run **InnoSetup** on `OATControl/OATControl Setup.iss`
99+
> 3. Confirm when done
100+
101+
Wait for the user to confirm, then verify the installer exists at `OATControl/bin/SetupOutput/OATControlSetup.exe`. If not found, ask the user to check.
102+
103+
## Step 8: GitHub Draft Release
104+
105+
1. Create a temporary file with the changelog bullet points (just the bullets, no header) for release notes
106+
2. Create draft release:
107+
```
108+
gh release create $TAG --draft --title "OATControl $TAG Release" --notes-file <temp-file> "OATControl/bin/SetupOutput/OATControlSetup.exe"
109+
```
110+
3. Report the draft release URL to the user
111+
4. Clean up the temporary notes file
112+
113+
## Step 9: Discord Announcement
114+
115+
1. Read the webhook URL from `.claude/settings.local.json` key `discordReleaseWebhook`
116+
2. If the key is missing, ask the user for the webhook URL and save it to `.claude/settings.local.json`
117+
3. Build the announcement message:
118+
```
119+
@everyone A new OATControl version ($TAG) has been released. These are the main changes:
120+
121+
- Bullet one.
122+
- Bullet two.
123+
124+
Let us know if there are any issues.
125+
126+
OpenAstroTech Team
127+
$RELEASE_URL
128+
```
129+
Use the same user-facing bullet points from Step 3. The `$RELEASE_URL` is the GitHub release URL from Step 8.
130+
4. POST to the webhook:
131+
```bash
132+
curl -X POST "$WEBHOOK_URL" \
133+
-H "Content-Type: application/json" \
134+
-d '{"content": "<message with \\n for line breaks>"}'
135+
```
136+
5. Report success to the user
137+
138+
## Error Handling
139+
140+
- If any step fails, report the error clearly and stop
141+
- Do not attempt partial recovery or skip steps
142+
- The user can fix the issue and re-run `/release` from the beginning, or continue manually

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,3 +350,6 @@ MigrationBackup/
350350
SetupOutputTemp
351351
OATControl/OATControl Setup.exe
352352
ASCOM.Driver/OpenAstroTracker Setup.exe
353+
354+
# Superpowers brainstorming
355+
.superpowers/

OATControl/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## V1.2.1.0
4+
5+
### Update Checker
6+
7+
- Automatic update checking for both desktop app and firmware.
8+
- Update notification dialog with themed markdown changelog and download with progress.
9+
- Firmware update badge on Mount Settings button and update link in Settings dialog.
10+
- "Skip This Version" option to suppress notifications for a specific release.
11+
- "Check For Updates" button in App Settings with inline result display.
12+
- Update checks throttled to once per 24 hours; manual check bypasses throttle.
13+
- Fault-tolerant — all network calls are fire-and-forget with 5-second timeouts.
14+
315
## V1.2.0.0
416

517
### MahApps.Metro Removal

0 commit comments

Comments
 (0)