Skip to content

Commit ac3b30d

Browse files
authored
Fix v4.0.0 release fallout: install.sh assets, AUR key fail-fast, docs (#194)
* Fix v4.0.0 release fallout: install.sh assets, AUR key fail-fast, docs The v4.0.0 stable release exposed three issues: - scripts/install.sh still fetched the v3 asset scheme (bare fizzy-<os>-<arch> binaries + per-platform SHA256SUMS files), which no longer exists. Rewrite for the GoReleaser layout: download fizzy_<ver>_<os>_<arch>.tar.gz (.zip on Windows), verify against the single checksums.txt, extract the binary. Verified live against v4.0.0 on darwin-arm64, linux-amd64 (container + native Arch). - The aur-publish job failed with SSH "invalid format" because the stored AUR_KEY secret content isn't a parseable key. Harden publish-aur.sh: strip CRs when writing the key and fail fast with ssh-keygen -y and a clear remediation message instead of dying mid-clone. The generated PKGBUILD/.SRCINFO were build-tested with makepkg in an Arch container (package installs, binary and completions land correctly). - Docs: README now points Homebrew installs at the published basecamp/tap/fizzy cask (the robzolkos tap instructions and stale "not yet released" warning are gone). RELEASING.md corrects the secret inventory — all release credentials live in the release environment, not repository level — documents the multi-line secret pitfall that broke AUR_KEY, and adds the stable-release-before- tap-migration ordering runbook. * Address review: exact checksum field match, safer zip extraction Match the archive name as an exact awk field (tolerating the optional binary-mode "*" prefix) instead of an unanchored regex grep, and fail zip extraction with a clear message when neither unzip nor a zip-capable tar is available rather than letting GNU tar error obscurely. * Address review: keep AUR key validation non-interactive Redirect stdin from /dev/null so a passphrase-protected key fails the check immediately instead of blocking CI on a passphrase prompt. * Address review: guard against unset AUR_KEY Fail with the remediation command instead of set -u's unbound-variable error when the secret is missing. * Address review: copy-pasteable remediation commands Include -R basecamp/fizzy-cli in the publish-aur.sh error messages and note that RELEASE_CLIENT_ID is set with gh variable set, not gh secret set. * Address review: include -R in multi-line secret example
1 parent 33eed21 commit ac3b30d

4 files changed

Lines changed: 63 additions & 37 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,11 @@ yay -S fizzy-cli
5050

5151
**Homebrew (macOS):**
5252

53-
Latest stable Fizzy 3.x is available from the original tap:
54-
5553
```bash
56-
brew install robzolkos/fizzy-cli/fizzy-cli
54+
brew install --cask basecamp/tap/fizzy
5755
```
5856

59-
Fizzy 4 release candidates are available from [Releases](https://github.com/basecamp/fizzy-cli/releases).
60-
61-
> [!WARNING]
62-
> The Basecamp Homebrew tap command is for Fizzy 4 stable once it is released. Release candidates are not published to Homebrew.
63-
>
64-
> ```bash
65-
> brew install --cask basecamp/tap/fizzy
66-
> ```
57+
Release candidates are not published to Homebrew; they are available from [Releases](https://github.com/basecamp/fizzy-cli/releases).
6758

6859
**Scoop (Windows):**
6960
```bash

‎RELEASING.md‎

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,20 @@ Technical testers can install prereleases explicitly from the GitHub release ass
5151

5252
## CI Secrets
5353

54-
### Repository level (`Settings > Secrets and variables > Actions`)
54+
All release credentials live in the `release` environment (`Settings > Environments > release`), so they are only exposed to jobs that pass the environment's required-reviewer gate. There are no repository-level release secrets. `HOMEBREW_TAP_TOKEN` does not exist as a stored secret — it is minted per-run from the `cli-release-bot` GitHub App credentials.
5555

5656
| Name | Type | Purpose |
5757
|------|------|---------|
5858
| `RELEASE_CLIENT_ID` | variable | GitHub App client ID for `cli-release-bot` |
5959
| `RELEASE_APP_PRIVATE_KEY` | secret | GitHub App private key for tap push |
6060
| `AUR_KEY` | secret | ed25519 SSH private key for AUR (optional) |
61+
| `MACOS_SIGN_P12` | secret | Base64-encoded Developer ID Application .p12 |
62+
| `MACOS_SIGN_PASSWORD` | secret | Password for the .p12 certificate |
63+
| `MACOS_NOTARY_KEY` | secret | Base64-encoded App Store Connect API key (.p8) |
64+
| `MACOS_NOTARY_KEY_ID` | secret | App Store Connect API key ID (10 chars) |
65+
| `MACOS_NOTARY_ISSUER_ID` | secret | App Store Connect issuer UUID |
6166

62-
### Environment level (`release` environment — `Settings > Environments`)
63-
64-
| Secret | Purpose |
65-
|--------|---------|
66-
| `MACOS_SIGN_P12` | Base64-encoded Developer ID Application .p12 |
67-
| `MACOS_SIGN_PASSWORD` | Password for the .p12 certificate |
68-
| `MACOS_NOTARY_KEY` | Base64-encoded App Store Connect API key (.p8) |
69-
| `MACOS_NOTARY_KEY_ID` | App Store Connect API key ID (10 chars) |
70-
| `MACOS_NOTARY_ISSUER_ID` | App Store Connect issuer UUID |
67+
Set a secret with `gh secret set <NAME> --env release -R basecamp/fizzy-cli`; the `RELEASE_CLIENT_ID` variable uses `gh variable set` instead. For multi-line secrets like SSH keys, pipe the file directly (`gh secret set AUR_KEY --env release -R basecamp/fizzy-cli < keyfile`) so newlines are preserved — pasting a flattened key produces an "invalid format" SSH failure at publish time.
7168

7269
## Distribution Channels
7370

@@ -99,5 +96,18 @@ goreleaser release --snapshot --clean
9996
## AUR Setup
10097

10198
1. Generate ed25519 SSH keypair: `ssh-keygen -t ed25519 -f aur_key`
102-
2. Add public key to your AUR account profile
103-
3. Add private key as `AUR_KEY` secret on the fizzy-cli repo
99+
2. Add public key to the AUR account that maintains `fizzy-cli`
100+
3. Validate the private key parses and authenticates:
101+
`ssh-keygen -y -f aur_key > /dev/null && ssh -T -i aur_key aur@aur.archlinux.org`
102+
(expect "Interactive shell is disabled")
103+
4. Store it in the `release` environment, preserving newlines:
104+
`gh secret set AUR_KEY --env release -R basecamp/fizzy-cli < aur_key`
105+
106+
## Tap Migration Ordering
107+
108+
When moving the Homebrew install path from another tap to `basecamp/tap` (learned during the v4.0.0 release, 2026-07-27):
109+
110+
1. **First** ship a stable release so GoReleaser publishes `Casks/fizzy.rb` to `basecamp/homebrew-tap`. The cask must exist before anything points at it.
111+
2. **Then** land `tap_migrations.json` (mapping the old formula to `basecamp/tap/fizzy`) in the old tap and remove its formula. `brew update` surfaces the migration to existing users.
112+
3. Do **not** transfer the old tap repo into the basecamp org — a repo named `homebrew-*` or matching `basecamp/fizzy-cli` would become a stray implicit tap. Archive it once users have migrated.
113+
4. Update README install instructions last, once `brew install --cask basecamp/tap/fizzy` actually works.

‎scripts/install.sh‎

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,32 @@ if [ -z "$VERSION" ]; then
3434
fi
3535
echo "Latest version: $VERSION"
3636

37-
# Download binary
38-
BINARY_NAME="fizzy-${OS}-${ARCH}"
37+
# Download release archive
38+
EXT="tar.gz"
3939
if [ "$OS" = "windows" ]; then
40-
BINARY_NAME="fizzy-${OS}-${ARCH}.exe"
40+
EXT="zip"
4141
fi
42+
ARCHIVE="fizzy_${VERSION#v}_${OS}_${ARCH}.${EXT}"
4243

43-
DOWNLOAD_URL="https://github.com/$REPO/releases/download/${VERSION}/${BINARY_NAME}"
44-
CHECKSUMS_URL="https://github.com/$REPO/releases/download/${VERSION}/SHA256SUMS-${OS}-${ARCH}.txt"
44+
DOWNLOAD_URL="https://github.com/$REPO/releases/download/${VERSION}/${ARCHIVE}"
45+
CHECKSUMS_URL="https://github.com/$REPO/releases/download/${VERSION}/checksums.txt"
4546

4647
TMPDIR=$(mktemp -d)
4748
trap 'rm -rf "$TMPDIR"' EXIT
4849

49-
echo "Downloading $BINARY_NAME..."
50-
curl -fsSL "$DOWNLOAD_URL" -o "$TMPDIR/$BINARY_NAME"
50+
echo "Downloading $ARCHIVE..."
51+
curl -fsSL "$DOWNLOAD_URL" -o "$TMPDIR/$ARCHIVE"
5152
curl -fsSL "$CHECKSUMS_URL" -o "$TMPDIR/checksums.txt"
5253

5354
# Verify SHA256
5455
echo "Verifying checksum..."
5556
cd "$TMPDIR"
56-
EXPECTED=$(awk '{print $1}' checksums.txt)
57+
EXPECTED=$(awk -v f="$ARCHIVE" '$2 == f || $2 == "*" f {print $1}' checksums.txt)
5758
if [ -z "$EXPECTED" ]; then
58-
echo "ERROR: Checksum not found"
59+
echo "ERROR: Checksum for $ARCHIVE not found in checksums.txt"
5960
exit 1
6061
fi
61-
ACTUAL=$(sha256sum "$BINARY_NAME" 2>/dev/null || shasum -a 256 "$BINARY_NAME" | awk '{print $1}')
62+
ACTUAL=$(sha256sum "$ARCHIVE" 2>/dev/null || shasum -a 256 "$ARCHIVE" | awk '{print $1}')
6263
ACTUAL=$(echo "$ACTUAL" | awk '{print $1}')
6364
if [ "$EXPECTED" != "$ACTUAL" ]; then
6465
echo "ERROR: Checksum mismatch!"
@@ -68,13 +69,27 @@ if [ "$EXPECTED" != "$ACTUAL" ]; then
6869
fi
6970
echo "Checksum verified."
7071

71-
# Install
72-
mkdir -p "$INSTALL_DIR"
72+
# Extract
7373
BINARY="fizzy"
7474
if [ "$OS" = "windows" ]; then
7575
BINARY="fizzy.exe"
7676
fi
77-
cp "$BINARY_NAME" "$INSTALL_DIR/${BINARY}"
77+
if [ "$EXT" = "zip" ]; then
78+
if command -v unzip > /dev/null; then
79+
unzip -q "$ARCHIVE" "$BINARY"
80+
elif tar -xf "$ARCHIVE" "$BINARY" 2>/dev/null && [ -f "$BINARY" ]; then
81+
: # bsdtar (Windows 10+ tar.exe) reads zip archives
82+
else
83+
echo "ERROR: Could not extract $ARCHIVE — install unzip and re-run"
84+
exit 1
85+
fi
86+
else
87+
tar -xzf "$ARCHIVE" "$BINARY"
88+
fi
89+
90+
# Install
91+
mkdir -p "$INSTALL_DIR"
92+
cp "$BINARY" "$INSTALL_DIR/${BINARY}"
7893
chmod +x "$INSTALL_DIR/${BINARY}"
7994

8095
echo ""

‎scripts/publish-aur.sh‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ if [ -z "${GITHUB_REF_NAME:-}" ]; then
88
echo "ERROR: GITHUB_REF_NAME is not set (must run from GitHub Actions release workflow)"
99
exit 1
1010
fi
11+
if [ -z "${AUR_KEY:-}" ]; then
12+
echo "ERROR: AUR_KEY is not set." \
13+
"Store it with: gh secret set AUR_KEY --env release -R basecamp/fizzy-cli < keyfile"
14+
exit 1
15+
fi
1116
VERSION="${GITHUB_REF_NAME#v}"
1217
REPO="basecamp/fizzy-cli"
1318

@@ -86,8 +91,13 @@ EOF
8691

8792
# Clone AUR repo and push
8893
mkdir -p ~/.ssh
89-
echo "$AUR_KEY" > ~/.ssh/aur
94+
printf '%s\n' "$AUR_KEY" | tr -d '\r' > ~/.ssh/aur
9095
chmod 600 ~/.ssh/aur
96+
if ! ssh-keygen -y -f ~/.ssh/aur < /dev/null > /dev/null; then
97+
echo "ERROR: AUR_KEY is not a valid unencrypted SSH private key." \
98+
"Re-store it with newlines intact: gh secret set AUR_KEY --env release -R basecamp/fizzy-cli < keyfile"
99+
exit 1
100+
fi
91101
cat >> ~/.ssh/config << SSHEOF
92102
Host aur.archlinux.org
93103
IdentityFile ~/.ssh/aur

0 commit comments

Comments
 (0)