Skip to content

Commit 902c2d7

Browse files
committed
chore(release): prefer tar.gz artifacts for all releases
1 parent 7335992 commit 902c2d7

4 files changed

Lines changed: 35 additions & 40 deletions

File tree

.goreleaser.yaml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,18 @@ builds:
6161

6262
archives:
6363
# default — three-binary bundle. Homebrew's Cask references this and
64-
# it remains the fallback for anything that still expects a tar.gz.
64+
# keep this as the sole package format for releases.
6565
- id: default
6666
formats: [tar.gz]
6767
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
6868
files:
6969
- README.md
7070
- LICENSE*
71-
# Raw per-binary uploads so the release page lists each binary by
72-
# name and install.sh / curl users can pull only what they need.
73-
- id: prosa-bin
74-
ids: [prosa]
75-
formats: [binary]
76-
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
77-
- id: prosa-server-bin
78-
ids: [prosa-server]
79-
formats: [binary]
80-
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
81-
- id: prosa-panel-bin
82-
ids: [prosa-panel]
83-
formats: [binary]
84-
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
8571

8672
homebrew_casks:
8773
- name: prosa
8874
# ids pins the Cask to the tar.gz bundle so it keeps installing all
89-
# three binaries even though we now publish raw per-binary archives.
75+
# three binaries from one artifact.
9076
ids: [default]
9177
binaries:
9278
- prosa

docs/distribution/install-sh.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ GitHub Release, with these exact names:
6868
- `prosa_<version-without-v>_<os>_<arch>.tar.gz`
6969
- `checksums.txt` (lines of `<sha256> <filename>`)
7070

71-
GoReleaser is configured to produce both. If the archive format ever
72-
changes, `install.sh` and `.goreleaser.yaml` must change together.
71+
GoReleaser is configured to produce the tarball and `checksums.txt`. If the
72+
archive format ever changes, `install.sh` and `.goreleaser.yaml` must change
73+
together.
7374

7475
## Behavior when things go wrong
7576

docs/distribution/release.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,8 @@ GitHub Actions runs `.github/workflows/release.yml`. One job, multi-step:
8181
`goreleaser release --clean` runs in the Actions runner.
8282

8383
- Builds the 12 binaries (3 binaries × 2 OS × 2 arch).
84-
- Publishes each binary as a raw release asset
85-
(`prosa_<v>_<os>_<arch>`, `prosa-server_<v>_<os>_<arch>`,
86-
`prosa-panel_<v>_<os>_<arch>` — 12 total).
87-
- Also publishes a three-binary bundle tar.gz per OS/arch
88-
(`prosa_<v>_<os>_<arch>.tar.gz` — 4 total) that the Homebrew Cask
89-
installs and `install.sh` falls back to when raw assets are missing.
84+
- Publishes the three-binary tar.gz bundle per OS/arch
85+
(`prosa_<v>_<os>_<arch>.tar.gz` — 4 total) that the Homebrew Cask installs.
9086
- Computes `checksums.txt` covering every asset.
9187
- Renders the GitHub Release (title = `prosa v0.11.0`, body = grouped
9288
changelog).
@@ -142,10 +138,12 @@ PROSA_VERSION=v0.11.0 \
142138
curl -fsSL https://raw.githubusercontent.com/c3-oss/prosa/master/install.sh | sh
143139
~/.local/bin/prosa --version
144140

145-
# Direct raw binary — one-liner for users who want just one component
146-
curl -fsSL -o ~/.local/bin/prosa-server \
147-
https://github.com/c3-oss/prosa/releases/download/v0.11.0/prosa-server_0.11.0_darwin_arm64
148-
chmod +x ~/.local/bin/prosa-server
141+
# Direct tarball install (or use `install.sh` and set INSTALL_BINS):
142+
mkdir -p /tmp/prosa-install && cd /tmp/prosa-install
143+
curl -fsSL -o prosa_0.11.0_darwin_arm64.tar.gz \
144+
https://github.com/c3-oss/prosa/releases/download/v0.11.0/prosa_0.11.0_darwin_arm64.tar.gz
145+
tar -xzf prosa_0.11.0_darwin_arm64.tar.gz prosa-server
146+
install -m 0755 prosa-server ~/.local/bin/prosa-server
149147

150148
# npm
151149
npm install -g @c3-oss/prosa@0.11.0

install.sh

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
# This script:
55
# 1. Detects your OS (Linux or Darwin) and CPU arch (amd64 or arm64).
66
# 2. Resolves the latest prosa release from GitHub (or honors PROSA_VERSION).
7-
# 3. Downloads each selected binary plus checksums.txt directly from
8-
# the release page (no tar.gz intermediate).
9-
# 4. Verifies each binary's sha256 before writing anything to disk.
7+
# 3. Downloads the per-platform release tarball plus checksums.txt.
8+
# 4. Verifies the release tarball sha256 before writing anything to disk.
109
# 5. Installs the prosa binary (and optionally prosa-server / prosa-panel)
1110
# into $INSTALL_DIR (default ~/.local/bin).
1211
#
@@ -126,21 +125,32 @@ main() {
126125
# shellcheck disable=SC2064 # expand $tmp at trap-registration time
127126
trap "rm -rf '$tmp'" EXIT INT TERM
128127

128+
require_cmd tar
129129
curl -fsSL -o "$tmp/checksums.txt" "$base/checksums.txt"
130130

131131
mkdir -p "$INSTALL_DIR"
132-
for bin in $INSTALL_BINS; do
133-
asset="${bin}_${semver}_${OS}_${ARCH}"
134-
info "downloading $asset ..."
135-
curl -fsSL -o "$tmp/$asset" "$base/$asset"
136132

137-
expected=$(awk -v f="$asset" '$2 == f { print $1 }' "$tmp/checksums.txt")
138-
if [ -z "$expected" ]; then
139-
err "could not find $asset in checksums.txt"
133+
asset="prosa_${semver}_${OS}_${ARCH}.tar.gz"
134+
info "downloading $asset ..."
135+
curl -fsSL -o "$tmp/$asset" "$base/$asset"
136+
137+
expected=$(awk -v f="$asset" '$2 == f { print $1 }' "$tmp/checksums.txt")
138+
if [ -z "$expected" ]; then
139+
err "could not find $asset in checksums.txt"
140+
fi
141+
sha256_verify "$tmp/$asset" "$expected"
142+
143+
unpack="$tmp/unpacked"
144+
mkdir -p "$unpack"
145+
tar -xzf "$tmp/$asset" -C "$unpack"
146+
147+
for bin in $INSTALL_BINS; do
148+
src="$unpack/$bin"
149+
if [ ! -f "$src" ]; then
150+
err "could not find $bin in $asset"
140151
fi
141-
sha256_verify "$tmp/$asset" "$expected"
142152

143-
install -m 0755 "$tmp/$asset" "$INSTALL_DIR/$bin"
153+
install -m 0755 "$src" "$INSTALL_DIR/$bin"
144154
info "installed $bin -> $INSTALL_DIR/$bin"
145155
done
146156

0 commit comments

Comments
 (0)