Skip to content

Commit 033dd93

Browse files
authored
Complete v0.1.0 release readiness (#12)
1 parent 88da351 commit 033dd93

7 files changed

Lines changed: 219 additions & 31 deletions

File tree

.github/workflows/ci.yml

Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Check out repository
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v7
2626

2727
- name: Set up Go
2828
uses: actions/setup-go@v6
@@ -33,21 +33,66 @@ jobs:
3333
- name: Run checks
3434
run: make check
3535

36-
- name: Validate release archives
37-
if: runner.os == 'Linux'
36+
release-archives:
37+
name: Build release archives
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Check out repository
42+
uses: actions/checkout@v7
43+
44+
- name: Set up Go
45+
uses: actions/setup-go@v6
46+
with:
47+
go-version-file: go.mod
48+
cache: true
49+
50+
- name: Build release archives
3851
run: |
39-
commit=$(git rev-parse HEAD)
4052
./scripts/build-release.sh \
4153
v0.0.0-test \
42-
"$commit" \
54+
"$GITHUB_SHA" \
4355
1970-01-01T00:00:00Z \
4456
0 \
4557
"$RUNNER_TEMP/release-dist"
46-
(
47-
cd "$RUNNER_TEMP/release-dist"
48-
sha256sum --check checksums.txt
49-
test "$(find . -name 'bible-terminal_*.tar.gz' | wc -l)" -eq 4
50-
mkdir smoke
51-
tar -xzf bible-terminal_0.0.0-test_linux_amd64.tar.gz -C smoke
52-
smoke/bible version | grep -F 'bible v0.0.0-test'
53-
)
58+
59+
- name: Validate checksums and archive count
60+
run: |
61+
cd "$RUNNER_TEMP/release-dist"
62+
sha256sum --check checksums.txt
63+
test "$(find . -name 'bible-terminal_*.tar.gz' | wc -l)" -eq 4
64+
65+
- name: Upload release archives
66+
uses: actions/upload-artifact@v7
67+
with:
68+
name: release-dist
69+
path: ${{ runner.temp }}/release-dist
70+
if-no-files-found: error
71+
72+
package-smoke:
73+
name: Package smoke (${{ matrix.os }})
74+
needs: release-archives
75+
runs-on: ${{ matrix.os }}
76+
strategy:
77+
fail-fast: false
78+
matrix:
79+
os:
80+
- ubuntu-latest
81+
- macos-latest
82+
83+
steps:
84+
- name: Check out repository
85+
uses: actions/checkout@v7
86+
87+
- name: Download release archives
88+
uses: actions/download-artifact@v8
89+
with:
90+
name: release-dist
91+
path: ${{ runner.temp }}/release-dist
92+
93+
- name: Exercise packaged binary
94+
run: |
95+
./scripts/smoke-release.sh \
96+
v0.0.0-test \
97+
"$GITHUB_SHA" \
98+
"$RUNNER_TEMP/release-dist"

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- name: Check out repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v7
1919
with:
2020
fetch-depth: 0
2121

@@ -28,6 +28,9 @@ jobs:
2828
- name: Run checks
2929
run: make check
3030

31+
- name: Validate release notes
32+
run: test -f "docs/releases/$GITHUB_REF_NAME.md"
33+
3134
- name: Build release archives
3235
run: |
3336
build_date=$(git show -s --format=%cI "$GITHUB_SHA")
@@ -47,5 +50,5 @@ jobs:
4750
dist/bible-terminal_*.tar.gz \
4851
dist/checksums.txt \
4952
--verify-tag \
50-
--generate-notes \
53+
--notes-file "docs/releases/$GITHUB_REF_NAME.md" \
5154
--title "Bible Terminal $GITHUB_REF_NAME"

CONTRIBUTING.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,14 @@ write data to standard output and diagnostics to standard error.
2929

3030
## Releases
3131

32+
Follow the complete checklist in [docs/RELEASING.md](docs/RELEASING.md).
3233
Pushing a semantic-version tag such as `v0.1.0` runs the release workflow. It
3334
reruns the full validation suite, cross-builds CGO-free macOS and Linux binaries
3435
for AMD64 and ARM64, creates deterministic `tar.gz` archives, writes
3536
`checksums.txt`, and publishes a GitHub release.
3637

37-
Create a release only from a reviewed, green commit on `main`:
38-
39-
```console
40-
git tag -a v0.1.0 -m "Bible Terminal v0.1.0"
41-
git push origin v0.1.0
42-
```
43-
44-
Do not reuse or move a published release tag.
38+
Create a release only from a reviewed, green commit on `main`, and do not reuse
39+
or move a published release tag.
4540

4641
## Bible text and licensing
4742

docs/PLAN.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,17 @@ returns results within an agreed performance budget.
157157

158158
### M4 — Preferences and distribution
159159

160-
Progress: tagged release automation builds checksummed macOS and Linux archives
161-
for AMD64 and ARM64, installation instructions are documented, and the CLI
162-
generates Bash, Zsh, Fish, and PowerShell completion scripts. macOS and Linux
163-
share an XDG-compatible configuration path, and versioned persistent
164-
preferences remember translation and display defaults. Release validation is
165-
the remaining work.
160+
Progress: complete. Tagged release automation builds checksummed macOS and
161+
Linux archives for AMD64 and ARM64, installation and release procedures are
162+
documented, and native macOS/Linux CI executes the matching packaged binary.
163+
The CLI generates Bash, Zsh, Fish, and PowerShell completion scripts. macOS and
164+
Linux share an XDG-compatible configuration path, and versioned persistent
165+
preferences remember translation and display defaults.
166166

167167
- Add a consistent, documented configuration path. (complete)
168168
- Remember the preferred translation and optional display preferences. (complete)
169-
- Produce checksummed release binaries.
170-
- Add installation documentation and shell completion.
169+
- Produce checksummed release binaries. (complete)
170+
- Add installation documentation and shell completion. (complete)
171171

172172
**Exit criteria:** a new user can install a release artifact and read a verse
173173
without installing Go or downloading data separately.

docs/RELEASING.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Releasing Bible Terminal
2+
3+
Release tags publish checksummed, self-contained archives through GitHub
4+
Actions. A release must come from a reviewed commit on `main`.
5+
6+
## Prepare
7+
8+
1. Confirm `main` is clean, synchronized with `origin/main`, and green in CI.
9+
2. Choose a semantic version that has never been used.
10+
3. Add `docs/releases/<version>.md` with user-facing release notes.
11+
4. Confirm the installation examples and supported platforms are still
12+
accurate.
13+
5. Run `make check` locally.
14+
15+
Pull-request CI builds all four archives once and executes the matching packaged
16+
binary on native macOS and Linux runners. The smoke test verifies checksums,
17+
embedded version metadata, isolated persistent configuration, reading, search,
18+
and shell completion.
19+
20+
## Publish
21+
22+
Create and push an annotated tag from the reviewed `main` commit:
23+
24+
```console
25+
git tag -a v0.1.0 -m "Bible Terminal v0.1.0"
26+
git push origin v0.1.0
27+
```
28+
29+
The release workflow reruns `make check`, creates deterministic archives, and
30+
publishes them with `checksums.txt` and the matching release-notes file.
31+
32+
## Verify
33+
34+
1. Wait for the release workflow to complete successfully.
35+
2. Confirm the GitHub release contains four archives and `checksums.txt`.
36+
3. Download the archive for the current machine and verify its checksum.
37+
4. Run `bible version` and confirm the version, commit, and build date.
38+
5. Run `bible read "John 3:16"` without network access.
39+
40+
Never move or reuse a published tag. If publishing fails after a release becomes
41+
visible, preserve the tag and diagnose the workflow before taking further
42+
action.

docs/releases/v0.1.0.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Bible Terminal v0.1.0
2+
3+
Bible Terminal's first release provides a fast, offline-first way to read and
4+
search Scripture without leaving the terminal.
5+
6+
## Highlights
7+
8+
- Read chapters, individual verses, and same-chapter verse ranges.
9+
- Navigate to the previous or next chapter across book boundaries.
10+
- Search the complete bundled translation offline with highlighted matches.
11+
- Discover canonical books, translation provenance, and random verses.
12+
- Use stable plain output in pipelines and restrained color in interactive
13+
terminals.
14+
- Persist translation and display defaults through a consistent configuration
15+
path on macOS and Linux.
16+
- Generate completion scripts for Bash, Zsh, Fish, and PowerShell.
17+
18+
The release embeds the public-domain World English Bible Protestant Edition
19+
(WEBP), so reading and search need no separate download, account, API key, or
20+
network connection.
21+
22+
See [the installation guide](https://github.com/vmrocha/bible-terminal/blob/v0.1.0/docs/INSTALL.md)
23+
for archive verification and setup.

scripts/smoke-release.sh

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
if [[ $# -ne 3 ]]; then
6+
echo "usage: $0 <version> <commit> <archive-directory>" >&2
7+
exit 2
8+
fi
9+
10+
version=$1
11+
commit=$2
12+
archive_directory=$3
13+
14+
case "$(uname -s)/$(uname -m)" in
15+
Darwin/x86_64) target=darwin_amd64 ;;
16+
Darwin/arm64) target=darwin_arm64 ;;
17+
Linux/x86_64) target=linux_amd64 ;;
18+
Linux/aarch64 | Linux/arm64) target=linux_arm64 ;;
19+
*)
20+
echo "unsupported smoke-test platform: $(uname -s)/$(uname -m)" >&2
21+
exit 2
22+
;;
23+
esac
24+
25+
archive="bible-terminal_${version#v}_${target}.tar.gz"
26+
archive_path="$archive_directory/$archive"
27+
checksums_path="$archive_directory/checksums.txt"
28+
if [[ ! -f $archive_path || ! -f $checksums_path ]]; then
29+
echo "release archive or checksum file is missing for $target" >&2
30+
exit 1
31+
fi
32+
33+
(
34+
cd "$archive_directory"
35+
checksum_line=$(
36+
awk -v archive="$archive" '
37+
$2 == archive { print; found = 1 }
38+
END { if (!found) exit 1 }
39+
' checksums.txt
40+
)
41+
if command -v sha256sum >/dev/null 2>&1; then
42+
printf '%s\n' "$checksum_line" | sha256sum --check -
43+
else
44+
printf '%s\n' "$checksum_line" | shasum -a 256 --check -
45+
fi
46+
)
47+
48+
temp_root=${TMPDIR:-/tmp}
49+
temp_root=${temp_root%/}
50+
work=$(mktemp -d "$temp_root/bible-terminal-smoke.XXXXXX")
51+
trap 'rm -rf "$work"' EXIT
52+
tar -xzf "$archive_path" -C "$work"
53+
bible="$work/bible"
54+
config_home="$work/config"
55+
56+
test -x "$bible"
57+
version_output=$("$bible" version)
58+
grep -F "bible $version" <<<"$version_output"
59+
grep -F "commit: $commit" <<<"$version_output"
60+
61+
config_path=$(BIBLE_TERMINAL_CONFIG_HOME="$config_home" "$bible" config path)
62+
test "$config_path" = "$config_home/config.json"
63+
BIBLE_TERMINAL_CONFIG_HOME="$config_home" "$bible" config set plain true
64+
BIBLE_TERMINAL_CONFIG_HOME="$config_home" "$bible" config set color false
65+
BIBLE_TERMINAL_CONFIG_HOME="$config_home" "$bible" --plain config show |
66+
grep -F $'translation\tengwebp'
67+
BIBLE_TERMINAL_CONFIG_HOME="$config_home" "$bible" --plain config show |
68+
grep -F $'plain\ttrue'
69+
BIBLE_TERMINAL_CONFIG_HOME="$config_home" "$bible" --plain config show |
70+
grep -F $'color\tfalse'
71+
72+
BIBLE_TERMINAL_CONFIG_HOME="$config_home" "$bible" read "John 3:16" |
73+
grep -F "For God so loved the world"
74+
BIBLE_TERMINAL_CONFIG_HOME="$config_home" "$bible" search "God loved world" --limit 1 |
75+
grep -F "John 3:16"
76+
BIBLE_TERMINAL_CONFIG_HOME="$config_home" "$bible" completion bash |
77+
grep -F "__start_bible"
78+
79+
BIBLE_TERMINAL_CONFIG_HOME="$config_home" "$bible" config reset
80+
test ! -e "$config_home/config.json"

0 commit comments

Comments
 (0)