2222#
2323# Before running this script:
2424#
25- # 1. UPDATE THE VERSION below (currently hardcoded as v0.1.0)
25+ # 1. UPDATE THE VERSION in the VERSION file at the repository root
2626#
2727# 2. UPDATE DOCUMENTATION with new version:
2828# - docs/index.md: Change download URLs from "latest" to "v0.1.0"
4646# - Go to https://github.com/ActiveMemory/ctx/releases/new
4747# - Select the tag v0.1.0
4848# - Copy release notes from dist/RELEASE_NOTES.md
49- # - Upload all binaries from dist/
50- # - Upload dist/checksums.txt
49+ # - Upload all binaries and .sha256 files from dist/
5150#
5251# 3. UPDATE the "latest" tag (optional, for docs compatibility):
5352# git tag -d latest 2>/dev/null || true
6059set -e
6160
6261# -----------------------------------------------------------------------------
63- # CONFIGURATION - Update this for each release
62+ # CONFIGURATION - Read from VERSION file
6463# -----------------------------------------------------------------------------
65- VERSION=" v0.1.0"
64+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
65+ ROOT_DIR=" $( dirname " $SCRIPT_DIR " ) "
66+
67+ if [ ! -f " $ROOT_DIR /VERSION" ]; then
68+ echo " ERROR: VERSION file not found"
69+ exit 1
70+ fi
71+
72+ VERSION=" v$( cat " $ROOT_DIR /VERSION" | tr -d ' [:space:]' ) "
6673# -----------------------------------------------------------------------------
6774
6875# Derived values
@@ -128,34 +135,41 @@ This is the first stable release of `ctx`, providing:
128135
129136### Linux (x86_64)
130137```bash
131- curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-linux-amd64
132- chmod +x ctx-linux-amd64
133- sudo mv ctx-linux-amd64 /usr/local/bin/ctx
138+ curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-0.1.0- linux-amd64
139+ chmod +x ctx-0.1.0- linux-amd64
140+ sudo mv ctx-0.1.0- linux-amd64 /usr/local/bin/ctx
134141```
135142
136143### Linux (ARM64)
137144```bash
138- curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-linux-arm64
139- chmod +x ctx-linux-arm64
140- sudo mv ctx-linux-arm64 /usr/local/bin/ctx
145+ curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-0.1.0- linux-arm64
146+ chmod +x ctx-0.1.0- linux-arm64
147+ sudo mv ctx-0.1.0- linux-arm64 /usr/local/bin/ctx
141148```
142149
143150### macOS (Apple Silicon)
144151```bash
145- curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-darwin-arm64
146- chmod +x ctx-darwin-arm64
147- sudo mv ctx-darwin-arm64 /usr/local/bin/ctx
152+ curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-0.1.0- darwin-arm64
153+ chmod +x ctx-0.1.0- darwin-arm64
154+ sudo mv ctx-0.1.0- darwin-arm64 /usr/local/bin/ctx
148155```
149156
150157### macOS (Intel)
151158```bash
152- curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-darwin-amd64
153- chmod +x ctx-darwin-amd64
154- sudo mv ctx-darwin-amd64 /usr/local/bin/ctx
159+ curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-0.1.0- darwin-amd64
160+ chmod +x ctx-0.1.0- darwin-amd64
161+ sudo mv ctx-0.1.0- darwin-amd64 /usr/local/bin/ctx
155162```
156163
157164### Windows
158- Download `ctx-windows-amd64.exe` or `ctx-windows-arm64.exe` and add to your PATH.
165+ Download `ctx-0.1.0-windows-amd64.exe` or `ctx-0.1.0-windows-arm64.exe` and add to your PATH.
166+
167+ ### Verifying Checksums
168+ Each binary has a `.sha256` file. Verify with:
169+ ```bash
170+ curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-0.1.0-linux-amd64.sha256
171+ sha256sum -c ctx-0.1.0-linux-amd64.sha256
172+ ```
159173
160174## Quick Start
161175
@@ -176,7 +190,7 @@ Full documentation available at [ctx.ist](https://ctx.ist)
176190
177191## Checksums
178192
179- See `checksums.txt` for SHA256 checksums of all binaries .
193+ Each binary has a corresponding `.sha256` file for verification .
180194NOTES_HEADER
181195
182196echo " Release notes written to ${RELEASE_NOTES} "
@@ -197,7 +211,7 @@ echo "=============================================="
197211echo " "
198212echo " Created:"
199213echo " - Binaries in dist/"
200- echo " - Checksums in dist/checksums.txt "
214+ echo " - Checksums (.sha256 per binary) in dist/"
201215echo " - Release notes in dist/RELEASE_NOTES.md"
202216echo " - Signed tag: ${TAG_NAME} "
203217echo " "
@@ -213,7 +227,7 @@ echo " 3. Create GitHub release at:"
213227echo " https://github.com/ActiveMemory/ctx/releases/new"
214228echo " "
215229echo " 4. Upload these files to the release:"
216- ls -1 dist/ctx-* dist/checksums.txt 2> /dev/null | sed ' s/^/ /'
230+ ls -1 dist/ctx-* 2> /dev/null | sed ' s/^/ /'
217231echo " "
218232echo " 5. (Optional) Update 'latest' tag:"
219233echo " git tag -d latest 2>/dev/null || true"
0 commit comments