Skip to content

Commit 8687ec4

Browse files
committed
build: version-prefix binaries and individual checksums
- Add version to binary names (ctx-0.1.0-linux-amd64 instead of ctx-linux-amd64) - Generate individual .sha256 files per binary instead of single checksums.txt - Update docs with new binary names and checksum verification instructions - Fix release workflow to use ctx-* pattern (was amem-*) - Rebuild site with updated installation instructions Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
1 parent b009b82 commit 8687ec4

6 files changed

Lines changed: 144 additions & 82 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ jobs:
3737
uses: softprops/action-gh-release@v2
3838
with:
3939
files: |
40-
dist/amem-*
41-
dist/checksums.txt
40+
dist/ctx-*
4241
draft: false
4342
prerelease: false
4443
generate_release_notes: true

docs/index.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,38 +60,52 @@ Download pre-built binaries from the
6060
=== "Linux (x86_64)"
6161

6262
```bash
63-
curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-linux-amd64
64-
chmod +x ctx-linux-amd64
65-
sudo mv ctx-linux-amd64 /usr/local/bin/ctx
63+
curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-0.1.0-linux-amd64
64+
chmod +x ctx-0.1.0-linux-amd64
65+
sudo mv ctx-0.1.0-linux-amd64 /usr/local/bin/ctx
6666
```
6767

6868
=== "Linux (ARM64)"
6969

7070
```bash
71-
curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-linux-arm64
72-
chmod +x ctx-linux-arm64
73-
sudo mv ctx-linux-arm64 /usr/local/bin/ctx
71+
curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-0.1.0-linux-arm64
72+
chmod +x ctx-0.1.0-linux-arm64
73+
sudo mv ctx-0.1.0-linux-arm64 /usr/local/bin/ctx
7474
```
7575

7676
=== "macOS (Apple Silicon)"
7777

7878
```bash
79-
curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-darwin-arm64
80-
chmod +x ctx-darwin-arm64
81-
sudo mv ctx-darwin-arm64 /usr/local/bin/ctx
79+
curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-0.1.0-darwin-arm64
80+
chmod +x ctx-0.1.0-darwin-arm64
81+
sudo mv ctx-0.1.0-darwin-arm64 /usr/local/bin/ctx
8282
```
8383

8484
=== "macOS (Intel)"
8585

8686
```bash
87-
curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-darwin-amd64
88-
chmod +x ctx-darwin-amd64
89-
sudo mv ctx-darwin-amd64 /usr/local/bin/ctx
87+
curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-0.1.0-darwin-amd64
88+
chmod +x ctx-0.1.0-darwin-amd64
89+
sudo mv ctx-0.1.0-darwin-amd64 /usr/local/bin/ctx
9090
```
9191

9292
=== "Windows"
9393

94-
Download `ctx-windows-amd64.exe` from the releases page and add it to your `PATH`.
94+
Download `ctx-0.1.0-windows-amd64.exe` from the releases page and add it to your `PATH`.
95+
96+
### Verifying Checksums
97+
98+
Each binary has a corresponding `.sha256` checksum file. To verify your download:
99+
100+
```bash
101+
# Download the checksum file
102+
curl -LO https://github.com/ActiveMemory/ctx/releases/download/v0.1.0/ctx-0.1.0-linux-amd64.sha256
103+
104+
# Verify the binary
105+
sha256sum -c ctx-0.1.0-linux-amd64.sha256
106+
```
107+
108+
On macOS, use `shasum -a 256 -c` instead of `sha256sum -c`.
95109

96110
### Build from Source
97111

hack/build-all.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ for target in "${TARGETS[@]}"; do
4343
GOOS="${target%/*}"
4444
GOARCH="${target#*/}"
4545

46-
output_name="${BINARY_NAME}-${GOOS}-${GOARCH}"
46+
output_name="${BINARY_NAME}-${VERSION}-${GOOS}-${GOARCH}"
4747
if [ "${GOOS}" = "windows" ]; then
4848
output_name="${output_name}.exe"
4949
fi
@@ -60,15 +60,19 @@ echo ""
6060
echo "Build complete. Binaries:"
6161
ls -lh "${OUTPUT_DIR}/"
6262

63-
# Create checksums
63+
# Create individual checksum files
6464
echo ""
6565
echo "Creating checksums..."
6666
cd "${OUTPUT_DIR}"
67-
if command -v sha256sum &> /dev/null; then
68-
sha256sum ctx-* > checksums.txt
69-
elif command -v shasum &> /dev/null; then
70-
shasum -a 256 ctx-* > checksums.txt
71-
fi
67+
for binary in ctx-*; do
68+
# Skip if it's already a checksum file
69+
[[ "${binary}" == *.sha256 ]] && continue
70+
if command -v sha256sum &> /dev/null; then
71+
sha256sum "${binary}" > "${binary}.sha256"
72+
elif command -v shasum &> /dev/null; then
73+
shasum -a 256 "${binary}" > "${binary}.sha256"
74+
fi
75+
done
7276
cd ..
7377

7478
echo ""

hack/release.sh

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
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"
@@ -46,8 +46,7 @@
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
@@ -60,9 +59,17 @@
6059
set -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.
180194
NOTES_HEADER
181195

182196
echo "Release notes written to ${RELEASE_NOTES}"
@@ -197,7 +211,7 @@ echo "=============================================="
197211
echo ""
198212
echo "Created:"
199213
echo " - Binaries in dist/"
200-
echo " - Checksums in dist/checksums.txt"
214+
echo " - Checksums (.sha256 per binary) in dist/"
201215
echo " - Release notes in dist/RELEASE_NOTES.md"
202216
echo " - Signed tag: ${TAG_NAME}"
203217
echo ""
@@ -213,7 +227,7 @@ echo " 3. Create GitHub release at:"
213227
echo " https://github.com/ActiveMemory/ctx/releases/new"
214228
echo ""
215229
echo " 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/^/ /'
217231
echo ""
218232
echo " 5. (Optional) Update 'latest' tag:"
219233
echo " git tag -d latest 2>/dev/null || true"

0 commit comments

Comments
 (0)