Release Assets
Platform detection, expected asset naming, GitHub API client behavior, download, and safe tar.gz extraction.
Release Assets
A3S Updater expects GitHub Release assets to follow a strict naming convention.
Platform Detection
platform_target() normalizes the host to:
| Host | Normalized value |
|---|---|
| macOS | darwin |
| Linux | linux |
| aarch64 | arm64 |
| x86_64 | x86_64 |
Other operating systems or architectures return an unsupported-platform error.
Asset Naming
Assets are matched exactly:
<binary>-<version>-<os>-<arch>.tar.gzFor example, a binary named a3s-tool at version 0.3.0 on Linux x86_64 would
look for:
a3s-tool-0.3.0-linux-x86_64.tar.gzThe version comes from the parsed GitHub release tag, so both v0.3.0 and
0.3.0 tags normalize to 0.3.0.
GitHub Client
fetch_latest_release(owner, repo) calls the GitHub Releases API with an
Accept: application/vnd.github+json header and a stable updater user agent.
Non-success responses include the response body in the error for diagnostics.
Download And Extract
download_and_extract(url, binary_name):
- Downloads the asset with a 300-second timeout.
- Creates a unique temporary directory.
- Decompresses the gzip stream.
- Reads tar entries.
- Extracts only regular files.
- Selects only the file whose final file name equals
binary_name. - Returns the extracted binary path plus the
TempDirthat keeps it alive.
Symlinks and hardlinks are ignored during extraction to avoid crafted archive path issues.