fix(install): resolve latest without the rate-limited API, and test the installer
`install.sh` asked the release API for the latest tag. That API allows 60 requests an hour per IP without a token, which one office behind a NAT or a CI runner exhausts — and a throttled response has no `tag_name`, so the installer reported "could not resolve latest release tag" and gave no hint that rate limiting was the cause. It now follows the `/releases/latest` redirect, which carries no such limit and which Gitea implements identically, and keeps the API as the fallback for the wget path that cannot read the effective URL. Verified against the real release: resolves v26.8.0-beta.0, verifies the checksum, and the installed binary runs. Releases with a hyphen in the tag are now flagged as prereleases. Nothing set the flag, so every beta answered `/releases/latest` — the very thing the installer resolves by default. That is harmless while every release is a beta and wrong the moment a stable one exists, because the next beta published after it would silently displace it for everyone installing without MATCHA_VERSION. `test_install.sh` has existed since the installer landed and no workflow ever ran it — the same shape as the starter gap: a check that exists, passes, and guards nothing. CI runs it now on Linux and macOS with shellcheck alongside, and it covers a third case, since the branch this commit changes fails by producing a message: an unresolvable `latest` must name MATCHA_VERSION and must leave no binary behind. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
6 files changed
+78
-4
No files matched your search
@@ -75,3 +75,19 @@ jobs:
|
||||
echo "Bump CORE_VERSION in src/template.rs and let the starter job prove it still boots."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# install.sh has had a test since the installer landed, and no workflow ever
|
||||
# ran it. It exercises the script against a file:// fixture — no network — and
|
||||
# checks both halves that matter: a good archive installs, and a bad checksum
|
||||
# aborts without leaving a binary behind.
|
||||
installer:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-14]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: shellcheck install.sh test_install.sh
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
- run: ./test_install.sh
|
||||
@@ -78,6 +78,11 @@ jobs:
|
||||
- name: Upload to release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
# A tag with a hyphen is a prerelease (26.9.0-beta.1). Unflagged, it
|
||||
# would answer /releases/latest — which is what install.sh resolves
|
||||
# with no MATCHA_VERSION — so the first stable release would be
|
||||
# displaced by the next beta published after it.
|
||||
prerelease: ${{ contains(github.ref_name, '-') }}
|
||||
files: |
|
||||
matcha-${{ matrix.target }}.tar.gz
|
||||
matcha-${{ matrix.target }}.tar.gz.sha256
|
||||
|
||||
Reference in new issue
Block a user