Repository navigation
Fix the quick install scripts, and test them on Linux, macOS and Windows - #245
Merged
Merged
Conversation
install.sh and install.bat read the latest version from data/releases.yml on the website, which the website no longer has, so both stopped at "Can't get the latest version". - Both take the version from the latest GitHub release, whose URL redirects to .../releases/tag/<version>; no API rate limit and no JSON to parse, in bash or cmd. - Both download from downloads.apache.org, falling back to archive.apache.org, which has every release but picks up a new one later. Downloads go to a temporary directory that is removed afterwards. - install.sh installs the binary for the machine's architecture (amd64, arm64, 386) instead of always amd64, also under Rosetta 2, accepts sha512sum or shasum, and uses sudo only when /usr/local/bin is not writable. - install.bat picks windows-386 on 32-bit Windows, checks the sha512 with Get-FileHash instead of parsing CertUtil output, and adds the install directory to the system PATH once. setx wrote the merged user and system PATH into the system PATH, cut it at 1024 characters, and added the directory again on every run. - A new Install Scripts workflow runs install.sh on ubuntu x64, ubuntu arm64 and macOS, and install.bat on Windows, twice each, when the scripts change and every Monday, since an outside change broke them last time.
kezhenxu94
approved these changes
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The README's quick install commands fail:
scripts/install.shandscripts/install.batread the latest version fromdata/releases.ymlon the website, which the website no longer has (apache/skywalking-website#928), so both stop at "Can't get the latest version".Changes
https://github.com/apache/skywalking-cli/releases/latestredirects to.../releases/tag/<version>, so there is no API rate limit and no JSON to parse, in bash or cmd.downloads.apache.org, falling back toarchive.apache.org, which has every release but picks up a new one later. Files go to a temporary directory that is removed afterwards, instead of the current directory.install.sh:amd64,arm64,386) instead of alwaysamd64, so Apple silicon and Linux arm64 get native binaries, also from a Rosetta 2 shell.sha512sumorshasum. Minimal Linux images have noshasum.sudoonly when/usr/local/binis not writable.install.bat:windows-386on 32-bit Windows.Get-FileHashinstead of parsing CertUtil output.PATHonce.setx Path "...;%path%" /mwrote the merged user and systemPATHinto the system one, cut it at 1024 characters, and added the directory again on every run.install.shon ubuntu x64, ubuntu arm64 and macOS, andinstall.baton Windows.PATHhas the directory exactly once.Requiredcheck.Tested locally (macOS, bash 3.2)
install.shwas run against afile://mirror of the 0.16.0 release, with the install directory pointed at a scratch directory:darwin-arm64(also from anarch -x86_64shell), and leaves no temporary files.shellcheck,actionlintandlicense-eyeare clean.install.batis tested only by the Windows job here.