Skip to content

fix: handle v-prefix in installer.sh for GoReleaser asset filenames#24

Merged
miguelsanchez-upsun merged 5 commits intomainfrom
cli-112-fix-installersh-v-prefix-mismatch
Mar 11, 2026
Merged

fix: handle v-prefix in installer.sh for GoReleaser asset filenames#24
miguelsanchez-upsun merged 5 commits intomainfrom
cli-112-fix-installersh-v-prefix-mismatch

Conversation

@pjcdawkins
Copy link
Contributor

Summary

GoReleaser strips the v prefix from asset filenames but keeps it in the tag/release URL path. The installer was using the raw tag name for both, producing URLs like:

.../download/v5.10.0-alpha1/upsun_v5.10.0-alpha1_linux_amd64.tar.gz
                             ^^^ wrong, actual file has no v
  • Introduce separate tag (v-prefixed, for release path) and version (no prefix, for filenames) variables
  • Normalize user-supplied VERSION to handle both 5.10.0 and v5.10.0

Found during the first pre-release on the new repo (v5.10.0-alpha1).

🤖 Generated with Claude Code

GoReleaser strips the v prefix from asset filenames but keeps it in
the tag/release path. The installer was using the tag name (with v)
for both, causing 404s when downloading.

Introduce a `tag` variable (always v-prefixed, for release URLs) and
a `version` variable (without v, for asset filenames). Handles both
`VERSION=5.10.0` and `VERSION=v5.10.0` from users.

Closes CLI-112

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 11, 2026 15:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the installer’s GitHub download URL construction so it uses a v-prefixed tag for the release path while using a non-prefixed version string for GoReleaser asset filenames.

Changes:

  • Split tag (v-prefixed) vs version (no v) in check_version().
  • Normalize user-provided VERSION to accept both 5.x.y and v5.x.y.
  • Update raw install download URL to use ${tag} for the release directory and ${version} for the asset filename.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

pjcdawkins and others added 3 commits March 11, 2026 15:28
If /releases/latest returns nothing and no VERSION is specified,
the installer would proceed with an empty version and fail later
with a confusing error. Fail early with a clear message instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The version lookup now uses the GitHub API via github_curl, which
supports GITHUB_TOKEN authentication. This avoids rate limiting on
shared hosting where many users may run the installer.

If no stable release exists (404), the tag will be empty and the
existing version check will fail gracefully with a clear error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@miguelsanchez-upsun miguelsanchez-upsun merged commit b51d9d1 into main Mar 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants