mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-26 17:10:48 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
100e23f1d0 | ||
|
|
ee46a3debe | ||
|
|
5729c89463 | ||
|
|
b572a9de6f | ||
|
|
abf895aa42 | ||
|
|
f3e04cf24a | ||
|
|
bcdb46af7d | ||
|
|
a5ddc5a290 | ||
|
|
e2ceb8a503 | ||
|
|
4222c00e29 | ||
|
|
dd4a3046d3 | ||
|
|
e02c98b988 | ||
|
|
881201d335 |
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@@ -42,6 +42,7 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-20.04
|
- os: ubuntu-20.04
|
||||||
- os: ubuntu-22.04
|
- os: ubuntu-22.04
|
||||||
|
- os: ubuntu-24.04
|
||||||
- os: ubuntu-22.04
|
- os: ubuntu-22.04
|
||||||
tool: major.minor.patch
|
tool: major.minor.patch
|
||||||
- os: ubuntu-22.04
|
- os: ubuntu-22.04
|
||||||
|
|||||||
23
CHANGELOG.md
23
CHANGELOG.md
@@ -10,6 +10,24 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [2.40.2] - 2024-06-21
|
||||||
|
|
||||||
|
- Update `zola@latest` to 0.19.0.
|
||||||
|
|
||||||
|
- Update `wasmtime@latest` to 22.0.0.
|
||||||
|
|
||||||
|
## [2.40.1] - 2024-06-20
|
||||||
|
|
||||||
|
- Update `cargo-zigbuild@latest` to 0.19.0.
|
||||||
|
|
||||||
|
- Update `cargo-binstall@latest` to 1.7.2.
|
||||||
|
|
||||||
|
- Update `biome@latest` to 1.8.2.
|
||||||
|
|
||||||
|
## [2.40.0] - 2024-06-19
|
||||||
|
|
||||||
|
- Fix an installation issue on some container environments. ([#545](https://github.com/taiki-e/install-action/pull/545))
|
||||||
|
|
||||||
## [2.39.2] - 2024-06-18
|
## [2.39.2] - 2024-06-18
|
||||||
|
|
||||||
- Update `dprint@latest` to 0.46.3.
|
- Update `dprint@latest` to 0.46.3.
|
||||||
@@ -2352,7 +2370,10 @@ Note: This release is considered a breaking change because installing on version
|
|||||||
|
|
||||||
Initial release
|
Initial release
|
||||||
|
|
||||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.39.2...HEAD
|
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.40.2...HEAD
|
||||||
|
[2.40.2]: https://github.com/taiki-e/install-action/compare/v2.40.1...v2.40.2
|
||||||
|
[2.40.1]: https://github.com/taiki-e/install-action/compare/v2.40.0...v2.40.1
|
||||||
|
[2.40.0]: https://github.com/taiki-e/install-action/compare/v2.39.2...v2.40.0
|
||||||
[2.39.2]: https://github.com/taiki-e/install-action/compare/v2.39.1...v2.39.2
|
[2.39.2]: https://github.com/taiki-e/install-action/compare/v2.39.1...v2.39.2
|
||||||
[2.39.1]: https://github.com/taiki-e/install-action/compare/v2.39.0...v2.39.1
|
[2.39.1]: https://github.com/taiki-e/install-action/compare/v2.39.0...v2.39.1
|
||||||
[2.39.0]: https://github.com/taiki-e/install-action/compare/v2.38.7...v2.39.0
|
[2.39.0]: https://github.com/taiki-e/install-action/compare/v2.38.7...v2.39.0
|
||||||
|
|||||||
23
TOOLS.md
23
TOOLS.md
@@ -7,12 +7,11 @@ If a tool not included in the list below is specified, this action uses [cargo-b
|
|||||||
See the [Supported tools section in README.md](README.md#supported-tools) for how to ensure that fallback is not used.
|
See the [Supported tools section in README.md](README.md#supported-tools) for how to ensure that fallback is not used.
|
||||||
|
|
||||||
> If `$CARGO_HOME/bin` is not available, Rust-related binaries will be installed to `$HOME/.cargo/bin`.<br>
|
> If `$CARGO_HOME/bin` is not available, Rust-related binaries will be installed to `$HOME/.cargo/bin`.<br>
|
||||||
> If `$HOME/.cargo/bin` is not available, Rust-related binaries will be installed to `/usr/local/bin`.<br>
|
> If `$HOME/.cargo/bin` is not available, Rust-related binaries will be installed to `$HOME/.install-action/bin`.<br>
|
||||||
> If `/usr/local/bin` is not available, binaries will be installed to `$HOME/.install-action/bin`.<br>
|
|
||||||
|
|
||||||
| Name | Where binaries will be installed | Where will it be installed from | Supported platform | License |
|
| Name | Where binaries will be installed | Where will it be installed from | Supported platform | License |
|
||||||
| ---- | -------------------------------- | ------------------------------- | ------------------ | ------- |
|
| ---- | -------------------------------- | ------------------------------- | ------------------ | ------- |
|
||||||
| [**biome**](https://biomejs.dev) | `/usr/local/bin` | [GitHub Releases](https://github.com/biomejs/biome/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/biomejs/biome/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/biomejs/biome/blob/main/LICENSE-MIT) |
|
| [**biome**](https://biomejs.dev) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/biomejs/biome/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/biomejs/biome/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/biomejs/biome/blob/main/LICENSE-MIT) |
|
||||||
| [**cargo-audit**](https://github.com/rustsec/rustsec/tree/HEAD/cargo-audit) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rustsec/rustsec/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/rustsec/rustsec/blob/HEAD/cargo-audit/LICENSE-APACHE) OR [MIT](https://github.com/rustsec/rustsec/blob/HEAD/cargo-audit/LICENSE-MIT) |
|
| [**cargo-audit**](https://github.com/rustsec/rustsec/tree/HEAD/cargo-audit) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rustsec/rustsec/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/rustsec/rustsec/blob/HEAD/cargo-audit/LICENSE-APACHE) OR [MIT](https://github.com/rustsec/rustsec/blob/HEAD/cargo-audit/LICENSE-MIT) |
|
||||||
| [**cargo-binstall**](https://github.com/cargo-bins/cargo-binstall) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/cargo-bins/cargo-binstall/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/cargo-bins/cargo-binstall/blob/HEAD/crates/bin/LICENSE) |
|
| [**cargo-binstall**](https://github.com/cargo-bins/cargo-binstall) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/cargo-bins/cargo-binstall/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/cargo-bins/cargo-binstall/blob/HEAD/crates/bin/LICENSE) |
|
||||||
| [**cargo-careful**](https://github.com/RalfJung/cargo-careful) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/RalfJung/cargo-careful/releases) | Linux, macOS, Windows | [MIT](https://github.com/RalfJung/cargo-careful/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/RalfJung/cargo-careful/blob/master/LICENSE-APACHE) |
|
| [**cargo-careful**](https://github.com/RalfJung/cargo-careful) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/RalfJung/cargo-careful/releases) | Linux, macOS, Windows | [MIT](https://github.com/RalfJung/cargo-careful/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/RalfJung/cargo-careful/blob/master/LICENSE-APACHE) |
|
||||||
@@ -36,10 +35,10 @@ See the [Supported tools section in README.md](README.md#supported-tools) for ho
|
|||||||
| [**cargo-valgrind**](https://github.com/jfrimmel/cargo-valgrind) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/jfrimmel/cargo-valgrind/releases) | Linux, macOS, Windows | [MIT](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-APACHE) |
|
| [**cargo-valgrind**](https://github.com/jfrimmel/cargo-valgrind) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/jfrimmel/cargo-valgrind/releases) | Linux, macOS, Windows | [MIT](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-APACHE) |
|
||||||
| [**cargo-zigbuild**](https://github.com/rust-cross/cargo-zigbuild) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rust-cross/cargo-zigbuild/releases) | Linux, macOS, Windows | [MIT](https://github.com/rust-cross/cargo-zigbuild/blob/main/LICENSE) |
|
| [**cargo-zigbuild**](https://github.com/rust-cross/cargo-zigbuild) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rust-cross/cargo-zigbuild/releases) | Linux, macOS, Windows | [MIT](https://github.com/rust-cross/cargo-zigbuild/blob/main/LICENSE) |
|
||||||
| [**cross**](https://github.com/cross-rs/cross) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/cross-rs/cross/releases) | Linux, macOS, Windows | [MIT](https://github.com/cross-rs/cross/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/cross-rs/cross/blob/main/LICENSE-APACHE) |
|
| [**cross**](https://github.com/cross-rs/cross) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/cross-rs/cross/releases) | Linux, macOS, Windows | [MIT](https://github.com/cross-rs/cross/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/cross-rs/cross/blob/main/LICENSE-APACHE) |
|
||||||
| [**deepsource**](https://github.com/DeepSourceCorp/cli) | `/usr/local/bin` | [GitHub Releases](https://github.com/DeepSourceCorp/cli/releases) | Linux, macOS, Windows | [BSD-2-Clause](https://github.com/DeepSourceCorp/cli/blob/master/LICENSE) |
|
| [**deepsource**](https://github.com/DeepSourceCorp/cli) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/DeepSourceCorp/cli/releases) | Linux, macOS, Windows | [BSD-2-Clause](https://github.com/DeepSourceCorp/cli/blob/master/LICENSE) |
|
||||||
| [**dprint**](https://github.com/dprint/dprint) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/dprint/dprint/releases) | Linux, macOS, Windows | [MIT](https://github.com/dprint/dprint/blob/main/LICENSE) |
|
| [**dprint**](https://github.com/dprint/dprint) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/dprint/dprint/releases) | Linux, macOS, Windows | [MIT](https://github.com/dprint/dprint/blob/main/LICENSE) |
|
||||||
| [**earthly**](https://github.com/earthly/earthly) | `/usr/local/bin` | [GitHub Releases](https://github.com/earthly/earthly/releases) | Linux, macOS, Windows | [MPL-2.0](https://github.com/earthly/earthly/blob/main/LICENSE) |
|
| [**earthly**](https://github.com/earthly/earthly) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/earthly/earthly/releases) | Linux, macOS, Windows | [MPL-2.0](https://github.com/earthly/earthly/blob/main/LICENSE) |
|
||||||
| [**editorconfig-checker**](https://github.com/editorconfig-checker/editorconfig-checker) | `/usr/local/bin` | [GitHub Releases](https://github.com/editorconfig-checker/editorconfig-checker/releases) | Linux, macOS, Windows | [MIT](https://github.com/editorconfig-checker/editorconfig-checker/blob/main/LICENSE) |
|
| [**editorconfig-checker**](https://github.com/editorconfig-checker/editorconfig-checker) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/editorconfig-checker/editorconfig-checker/releases) | Linux, macOS, Windows | [MIT](https://github.com/editorconfig-checker/editorconfig-checker/blob/main/LICENSE) |
|
||||||
| [**espup**](https://github.com/esp-rs/espup) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/esp-rs/espup/releases) | Linux, macOS, Windows | [MIT](https://github.com/esp-rs/espup/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/esp-rs/espup/blob/main/LICENSE-APACHE) |
|
| [**espup**](https://github.com/esp-rs/espup) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/esp-rs/espup/releases) | Linux, macOS, Windows | [MIT](https://github.com/esp-rs/espup/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/esp-rs/espup/blob/main/LICENSE-APACHE) |
|
||||||
| [**git-cliff**](https://github.com/orhun/git-cliff) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/orhun/git-cliff/releases) | Linux, macOS, Windows | [MIT](https://github.com/orhun/git-cliff/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/orhun/git-cliff/blob/main/LICENSE-APACHE) |
|
| [**git-cliff**](https://github.com/orhun/git-cliff) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/orhun/git-cliff/releases) | Linux, macOS, Windows | [MIT](https://github.com/orhun/git-cliff/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/orhun/git-cliff/blob/main/LICENSE-APACHE) |
|
||||||
| [**grcov**](https://github.com/mozilla/grcov) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/mozilla/grcov/releases) | Linux, macOS, Windows | [MPL-2.0](https://github.com/mozilla/grcov/blob/HEAD/LICENSE-MPL-2.0) |
|
| [**grcov**](https://github.com/mozilla/grcov) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/mozilla/grcov/releases) | Linux, macOS, Windows | [MPL-2.0](https://github.com/mozilla/grcov/blob/HEAD/LICENSE-MPL-2.0) |
|
||||||
@@ -48,14 +47,14 @@ See the [Supported tools section in README.md](README.md#supported-tools) for ho
|
|||||||
| [**just**](https://github.com/casey/just) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/casey/just/releases) | Linux, macOS, Windows | [CC0-1.0](https://github.com/casey/just/blob/master/LICENSE) |
|
| [**just**](https://github.com/casey/just) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/casey/just/releases) | Linux, macOS, Windows | [CC0-1.0](https://github.com/casey/just/blob/master/LICENSE) |
|
||||||
| [**mdbook**](https://github.com/rust-lang/mdBook) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rust-lang/mdBook/releases) | Linux, macOS, Windows | [MPL-2.0](https://github.com/rust-lang/mdBook/blob/master/LICENSE) |
|
| [**mdbook**](https://github.com/rust-lang/mdBook) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rust-lang/mdBook/releases) | Linux, macOS, Windows | [MPL-2.0](https://github.com/rust-lang/mdBook/blob/master/LICENSE) |
|
||||||
| [**mdbook-linkcheck**](https://github.com/Michael-F-Bryan/mdbook-linkcheck) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases) | Linux, macOS, Windows | [MIT](https://github.com/Michael-F-Bryan/mdbook-linkcheck/blob/master/LICENSE) |
|
| [**mdbook-linkcheck**](https://github.com/Michael-F-Bryan/mdbook-linkcheck) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases) | Linux, macOS, Windows | [MIT](https://github.com/Michael-F-Bryan/mdbook-linkcheck/blob/master/LICENSE) |
|
||||||
| [**osv-scanner**](https://github.com/google/osv-scanner) | `/usr/local/bin` | [GitHub Releases](https://github.com/google/osv-scanner/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/google/osv-scanner/blob/main/LICENSE) |
|
| [**osv-scanner**](https://github.com/google/osv-scanner) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/google/osv-scanner/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/google/osv-scanner/blob/main/LICENSE) |
|
||||||
| [**parse-changelog**](https://github.com/taiki-e/parse-changelog) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/taiki-e/parse-changelog/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/parse-changelog/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/parse-changelog/blob/main/LICENSE-MIT) |
|
| [**parse-changelog**](https://github.com/taiki-e/parse-changelog) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/taiki-e/parse-changelog/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/parse-changelog/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/parse-changelog/blob/main/LICENSE-MIT) |
|
||||||
| [**protoc**](https://github.com/protocolbuffers/protobuf) | `/usr/local/bin` | [GitHub Releases](https://github.com/protocolbuffers/protobuf/releases) | Linux, macOS, Windows | [BSD-3-Clause](https://github.com/protocolbuffers/protobuf/blob/HEAD/LICENSE) |
|
| [**protoc**](https://github.com/protocolbuffers/protobuf) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/protocolbuffers/protobuf/releases) | Linux, macOS, Windows | [BSD-3-Clause](https://github.com/protocolbuffers/protobuf/blob/HEAD/LICENSE) |
|
||||||
| [**rclone**](https://github.com/rclone/rclone) | `/usr/local/bin` | [GitHub Releases](https://github.com/rclone/rclone/releases) | Linux, macOS, Windows | [MIT](https://github.com/rclone/rclone/blob/master/COPYING) |
|
| [**rclone**](https://github.com/rclone/rclone) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/rclone/rclone/releases) | Linux, macOS, Windows | [MIT](https://github.com/rclone/rclone/blob/master/COPYING) |
|
||||||
| [**sccache**](https://github.com/mozilla/sccache) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/mozilla/sccache/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/mozilla/sccache/blob/main/LICENSE) |
|
| [**sccache**](https://github.com/mozilla/sccache) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/mozilla/sccache/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/mozilla/sccache/blob/main/LICENSE) |
|
||||||
| [**shellcheck**](https://www.shellcheck.net) | `/usr/local/bin` | [GitHub Releases](https://github.com/koalaman/shellcheck/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/koalaman/shellcheck/blob/master/LICENSE) |
|
| [**shellcheck**](https://www.shellcheck.net) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/koalaman/shellcheck/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/koalaman/shellcheck/blob/master/LICENSE) |
|
||||||
| [**shfmt**](https://github.com/mvdan/sh) | `/usr/local/bin` | [GitHub Releases](https://github.com/mvdan/sh/releases) | Linux, macOS, Windows | [BSD-3-Clause](https://github.com/mvdan/sh/blob/master/LICENSE) |
|
| [**shfmt**](https://github.com/mvdan/sh) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/mvdan/sh/releases) | Linux, macOS, Windows | [BSD-3-Clause](https://github.com/mvdan/sh/blob/master/LICENSE) |
|
||||||
| [**syft**](https://github.com/anchore/syft) | `/usr/local/bin` | [GitHub Releases](https://github.com/anchore/syft/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/anchore/syft/blob/main/LICENSE) |
|
| [**syft**](https://github.com/anchore/syft) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/anchore/syft/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/anchore/syft/blob/main/LICENSE) |
|
||||||
| [**typos**](https://github.com/crate-ci/typos) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/crate-ci/typos/releases) | Linux, macOS, Windows | [MIT](https://github.com/crate-ci/typos/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/crate-ci/typos/blob/master/LICENSE-APACHE) |
|
| [**typos**](https://github.com/crate-ci/typos) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/crate-ci/typos/releases) | Linux, macOS, Windows | [MIT](https://github.com/crate-ci/typos/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/crate-ci/typos/blob/master/LICENSE-APACHE) |
|
||||||
| [**valgrind**](https://valgrind.org/) | `/snap/bin` | [snap](https://snapcraft.io/install/valgrind/ubuntu) | Linux | [GPL-2.0](https://sourceware.org/git/?p=valgrind.git;a=blob;f=COPYING;hb=HEAD) |
|
| [**valgrind**](https://valgrind.org/) | `/snap/bin` | [snap](https://snapcraft.io/install/valgrind/ubuntu) | Linux | [GPL-2.0](https://sourceware.org/git/?p=valgrind.git;a=blob;f=COPYING;hb=HEAD) |
|
||||||
| [**wait-for-them**](https://github.com/shenek/wait-for-them) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/shenek/wait-for-them/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/shenek/wait-for-them/blob/v0.4.0/Cargo.toml#L7) |
|
| [**wait-for-them**](https://github.com/shenek/wait-for-them) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/shenek/wait-for-them/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/shenek/wait-for-them/blob/v0.4.0/Cargo.toml#L7) |
|
||||||
|
|||||||
16
main.sh
16
main.sh
@@ -299,11 +299,8 @@ read_download_info() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "${rust_crate}" == "null" ]]; then
|
if [[ "${rust_crate}" == "null" ]]; then
|
||||||
if [[ "${host_os}" == "windows" ]] || [[ ! -e /usr/local/bin ]]; then
|
# Moving files to /usr/local/bin requires sudo in some environments, so do not use it: https://github.com/taiki-e/install-action/issues/543
|
||||||
bin_dir="${install_action_dir}/bin"
|
bin_dir="${install_action_dir}/bin"
|
||||||
else
|
|
||||||
bin_dir=/usr/local/bin
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
bin_dir="${cargo_bin}"
|
bin_dir="${cargo_bin}"
|
||||||
fi
|
fi
|
||||||
@@ -534,7 +531,7 @@ tmp_dir="${install_action_dir}/tmp"
|
|||||||
cargo_bin="${CARGO_HOME:-"${home}/.cargo"}/bin"
|
cargo_bin="${CARGO_HOME:-"${home}/.cargo"}/bin"
|
||||||
# If $CARGO_HOME does not exist, or cargo installed outside of $CARGO_HOME/bin
|
# If $CARGO_HOME does not exist, or cargo installed outside of $CARGO_HOME/bin
|
||||||
# is used ($CARGO_HOME/bin is most likely not included in the PATH), fallback to
|
# is used ($CARGO_HOME/bin is most likely not included in the PATH), fallback to
|
||||||
# /usr/local/bin or $install_action_dir/bin.
|
# $install_action_dir/bin.
|
||||||
if [[ "${host_os}" == "windows" ]]; then
|
if [[ "${host_os}" == "windows" ]]; then
|
||||||
if type -P cargo &>/dev/null; then
|
if type -P cargo &>/dev/null; then
|
||||||
info "cargo is located at $(type -P cargo)"
|
info "cargo is located at $(type -P cargo)"
|
||||||
@@ -546,11 +543,8 @@ elif [[ ! -e "${cargo_bin}" ]] || [[ "$(type -P cargo || true)" != "${cargo_bin}
|
|||||||
if type -P cargo &>/dev/null; then
|
if type -P cargo &>/dev/null; then
|
||||||
info "cargo is located at $(type -P cargo)"
|
info "cargo is located at $(type -P cargo)"
|
||||||
fi
|
fi
|
||||||
if [[ ! -e /usr/local/bin ]]; then
|
# Moving files to /usr/local/bin requires sudo in some environments, so do not use it: https://github.com/taiki-e/install-action/issues/543
|
||||||
cargo_bin="${install_action_dir}/bin"
|
cargo_bin="${install_action_dir}/bin"
|
||||||
else
|
|
||||||
cargo_bin=/usr/local/bin
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
jq_use_b=''
|
jq_use_b=''
|
||||||
|
|||||||
26
manifests/biome.json
generated
26
manifests/biome.json
generated
@@ -36,13 +36,33 @@
|
|||||||
},
|
},
|
||||||
"license_markdown": "[Apache-2.0](https://github.com/biomejs/biome/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/biomejs/biome/blob/main/LICENSE-MIT)",
|
"license_markdown": "[Apache-2.0](https://github.com/biomejs/biome/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/biomejs/biome/blob/main/LICENSE-MIT)",
|
||||||
"latest": {
|
"latest": {
|
||||||
"version": "1.8.1"
|
"version": "1.8.2"
|
||||||
},
|
},
|
||||||
"1": {
|
"1": {
|
||||||
"version": "1.8.1"
|
"version": "1.8.2"
|
||||||
},
|
},
|
||||||
"1.8": {
|
"1.8": {
|
||||||
"version": "1.8.1"
|
"version": "1.8.2"
|
||||||
|
},
|
||||||
|
"1.8.2": {
|
||||||
|
"x86_64_linux_musl": {
|
||||||
|
"checksum": "0971bc636e1abc6d06ea03b219f6c78488b209f8a623de081a04ce610ae47f10"
|
||||||
|
},
|
||||||
|
"x86_64_macos": {
|
||||||
|
"checksum": "17b1ecae7751c4519135fd4f6d9b7d8cdcf5dbdaa7d586da8776e05ad05209d3"
|
||||||
|
},
|
||||||
|
"x86_64_windows": {
|
||||||
|
"checksum": "cffd0c862eb02b0c574a550ac47c213e0d48121fee23ffcaee4098de08cbdab8"
|
||||||
|
},
|
||||||
|
"aarch64_linux_musl": {
|
||||||
|
"checksum": "4467475395c09442c23efca6bc800f8db14f21791ffc77594f71c11ec9c85aa3"
|
||||||
|
},
|
||||||
|
"aarch64_macos": {
|
||||||
|
"checksum": "659db94f30b4a5ef80995d494c7e7ec9a7fe820d4ef5b07b0684f2a44fe22140"
|
||||||
|
},
|
||||||
|
"aarch64_windows": {
|
||||||
|
"checksum": "ea3c0de73e3f7aa1b95cf5e26694a5427914771e2f47f7b5e5742a16c19088e1"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"1.8.1": {
|
"1.8.1": {
|
||||||
"x86_64_linux_musl": {
|
"x86_64_linux_musl": {
|
||||||
|
|||||||
16
manifests/cargo-binstall.json
generated
16
manifests/cargo-binstall.json
generated
@@ -22,26 +22,26 @@
|
|||||||
},
|
},
|
||||||
"license_markdown": "[GPL-3.0](https://github.com/cargo-bins/cargo-binstall/blob/HEAD/crates/bin/LICENSE)",
|
"license_markdown": "[GPL-3.0](https://github.com/cargo-bins/cargo-binstall/blob/HEAD/crates/bin/LICENSE)",
|
||||||
"latest": {
|
"latest": {
|
||||||
"version": "1.7.1"
|
"version": "1.7.2"
|
||||||
},
|
},
|
||||||
"1.7.1": {
|
"1.7.2": {
|
||||||
"x86_64_linux_musl": {
|
"x86_64_linux_musl": {
|
||||||
"checksum": "3a2f849becb60f070e416cc30d48f366d040c8db38dd7dda714f26cec15f4e2a"
|
"checksum": "08b6969c86471ecd1b9b6fbbd6508014d22dadda29fdd47ffb871d297ac49a8b"
|
||||||
},
|
},
|
||||||
"x86_64_macos": {
|
"x86_64_macos": {
|
||||||
"checksum": "e68cd4c7688ee0378f63c2718c3ff982da02f161f1b9d20d7ecefa26fc463abd"
|
"checksum": "7fa85fd3fda3c9e4962f16f8b9400e97ff2773e0481fc63a9cb882fe80115b7f"
|
||||||
},
|
},
|
||||||
"x86_64_windows": {
|
"x86_64_windows": {
|
||||||
"checksum": "a6abfc2279632c85db91fb49cd11fd3e1cf8bd4bd4e6f64abc6cc22bcef55d4c"
|
"checksum": "ee4da8bfaf25c84f0b67d5fd8e96f1243df4379f8dad64ffe2f82416198b7b35"
|
||||||
},
|
},
|
||||||
"aarch64_linux_musl": {
|
"aarch64_linux_musl": {
|
||||||
"checksum": "93fbed7fb5ec054fb134a8b31a3d0c6e86dd856b85dce5f63dd4438153a20779"
|
"checksum": "4342cfa8dc1033d2942270e8c4f7a63ef6953632ec3dbfacd7bebd4894e2ece8"
|
||||||
},
|
},
|
||||||
"aarch64_macos": {
|
"aarch64_macos": {
|
||||||
"checksum": "76a4f22e19111d9a6393fa1c60131951646067bb37093d7103cecad8d4ac7d14"
|
"checksum": "68157004ca95c2c3d4fae16246751317d2d6be32911cbdb04a06580d0c3aa43e"
|
||||||
},
|
},
|
||||||
"aarch64_windows": {
|
"aarch64_windows": {
|
||||||
"checksum": "46e3050690269ac6b53b8fed4b8828d2acd9ae72da72270b4d1ccb1824b394b4"
|
"checksum": "baf1c6d5729b629015e199e7739a4f76bd40d9c4a90883ecb1d2c33c16240190"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
22
manifests/cargo-zigbuild.json
generated
22
manifests/cargo-zigbuild.json
generated
@@ -19,7 +19,27 @@
|
|||||||
},
|
},
|
||||||
"license_markdown": "[MIT](https://github.com/rust-cross/cargo-zigbuild/blob/main/LICENSE)",
|
"license_markdown": "[MIT](https://github.com/rust-cross/cargo-zigbuild/blob/main/LICENSE)",
|
||||||
"latest": {
|
"latest": {
|
||||||
"version": "0.18.4"
|
"version": "0.19.0"
|
||||||
|
},
|
||||||
|
"0.19": {
|
||||||
|
"version": "0.19.0"
|
||||||
|
},
|
||||||
|
"0.19.0": {
|
||||||
|
"x86_64_linux_musl": {
|
||||||
|
"checksum": "ab2e2f3a22409470ec7d71badc22ab89351a6ddaba5c4785a39689856809404c"
|
||||||
|
},
|
||||||
|
"x86_64_windows": {
|
||||||
|
"checksum": "640b03357f568deb976cd0e0732db04f723498a0d4706d71ebaec05f8fc35db2"
|
||||||
|
},
|
||||||
|
"aarch64_linux_musl": {
|
||||||
|
"checksum": "edc3d0966ed8c80056d36ace8998eb75ed2f3a71342e0825960d98c9eb3398a0"
|
||||||
|
},
|
||||||
|
"aarch64_macos": {
|
||||||
|
"checksum": "9173594204eaacadd62e2f26a3c2365887ec24a4fa15f309023b8d4bbbc09dec"
|
||||||
|
},
|
||||||
|
"aarch64_windows": {
|
||||||
|
"checksum": "6affe535f6d37768cc20be30b8b65a1bcc196ae1efdad71d2a5c44049a081b7e"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"0.18": {
|
"0.18": {
|
||||||
"version": "0.18.4"
|
"version": "0.18.4"
|
||||||
|
|||||||
25
manifests/wasmtime.json
generated
25
manifests/wasmtime.json
generated
@@ -24,7 +24,30 @@
|
|||||||
},
|
},
|
||||||
"license_markdown": "[Apache-2.0 WITH LLVM-exception](https://github.com/bytecodealliance/wasmtime/blob/main/LICENSE)",
|
"license_markdown": "[Apache-2.0 WITH LLVM-exception](https://github.com/bytecodealliance/wasmtime/blob/main/LICENSE)",
|
||||||
"latest": {
|
"latest": {
|
||||||
"version": "21.0.1"
|
"version": "22.0.0"
|
||||||
|
},
|
||||||
|
"22": {
|
||||||
|
"version": "22.0.0"
|
||||||
|
},
|
||||||
|
"22.0": {
|
||||||
|
"version": "22.0.0"
|
||||||
|
},
|
||||||
|
"22.0.0": {
|
||||||
|
"x86_64_linux_gnu": {
|
||||||
|
"checksum": "415d09d77f5375a6c5f6a1fc102bbaf3fe8e830b438690e6ea59a7d690458dea"
|
||||||
|
},
|
||||||
|
"x86_64_macos": {
|
||||||
|
"checksum": "2d39c488e391c1e18875a0aa22db0f2b3c737002beb83712639ff608666fccea"
|
||||||
|
},
|
||||||
|
"x86_64_windows": {
|
||||||
|
"checksum": "87c9d8dd42cc5506edbe9736fb098f8d960606c85d4608d543dd07f79194f35e"
|
||||||
|
},
|
||||||
|
"aarch64_linux_gnu": {
|
||||||
|
"checksum": "0c4bc38070d856a6cfc4b4ec6344b1f5de8cffdde875550c285010d645f24330"
|
||||||
|
},
|
||||||
|
"aarch64_macos": {
|
||||||
|
"checksum": "891552cd21d08f330b872ef462bd7ac3903b668f4461cf0de0d16a175b40f57f"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"21": {
|
"21": {
|
||||||
"version": "21.0.1"
|
"version": "21.0.1"
|
||||||
|
|||||||
19
manifests/zola.json
generated
19
manifests/zola.json
generated
@@ -16,7 +16,24 @@
|
|||||||
},
|
},
|
||||||
"license_markdown": "[MIT](https://github.com/getzola/zola/blob/master/LICENSE)",
|
"license_markdown": "[MIT](https://github.com/getzola/zola/blob/master/LICENSE)",
|
||||||
"latest": {
|
"latest": {
|
||||||
"version": "0.18.0"
|
"version": "0.19.0"
|
||||||
|
},
|
||||||
|
"0.19": {
|
||||||
|
"version": "0.19.0"
|
||||||
|
},
|
||||||
|
"0.19.0": {
|
||||||
|
"x86_64_linux_gnu": {
|
||||||
|
"checksum": "5d26b7c63d36bcfc42a2db41d35cdd7bbde1762571ee936a89d155d7fd600f77"
|
||||||
|
},
|
||||||
|
"x86_64_macos": {
|
||||||
|
"checksum": "96cc5501541cc220c0e3d234f5c8b869afbba90ff6a10923824dfbb51f87f487"
|
||||||
|
},
|
||||||
|
"x86_64_windows": {
|
||||||
|
"checksum": "831adf641d2c691aa95771285f13fdbff8897d481084b360c49a9d933e81cec8"
|
||||||
|
},
|
||||||
|
"aarch64_macos": {
|
||||||
|
"checksum": "c57d5c6b6ed55fa1eb04ed8bc17432bff9d0ca0d96558c0c476edbef7fc77d95"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"0.18": {
|
"0.18": {
|
||||||
"version": "0.18.0"
|
"version": "0.18.0"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use std::{
|
|||||||
ffi::OsStr,
|
ffi::OsStr,
|
||||||
io::Read,
|
io::Read,
|
||||||
path::Path,
|
path::Path,
|
||||||
|
sync::{LazyLock, RwLock},
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -28,6 +29,7 @@ fn main() -> Result<()> {
|
|||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
let package = &args[0];
|
let package = &args[0];
|
||||||
|
let version_req = args.get(1);
|
||||||
let skip_existing_manifest_versions = std::env::var("SKIP_EXISTING_MANIFEST_VERSIONS").is_ok();
|
let skip_existing_manifest_versions = std::env::var("SKIP_EXISTING_MANIFEST_VERSIONS").is_ok();
|
||||||
|
|
||||||
let workspace_root = &workspace_root();
|
let workspace_root = &workspace_root();
|
||||||
@@ -47,22 +49,22 @@ fn main() -> Result<()> {
|
|||||||
.strip_prefix("https://github.com/")
|
.strip_prefix("https://github.com/")
|
||||||
.context("repository must start with https://github.com/")?;
|
.context("repository must start with https://github.com/")?;
|
||||||
|
|
||||||
eprintln!("downloading metadata from https://github.com/{repo}");
|
eprintln!("downloading metadata from https://api.github.com/repos/{repo}");
|
||||||
|
|
||||||
let repo_info: github::RepoMetadata =
|
let repo_info: github::RepoMetadata =
|
||||||
download_github(&format!("https://api.github.com/repos/{repo}"))?.into_json()?;
|
download(&format!("https://api.github.com/repos/{repo}"))?.into_json()?;
|
||||||
|
|
||||||
eprintln!("downloading releases of https://github.com/{repo} from https://api.github.com/repos/{repo}/releases");
|
eprintln!("downloading releases from https://api.github.com/repos/{repo}/releases");
|
||||||
let mut releases: github::Releases = vec![];
|
let mut releases: github::Releases = vec![];
|
||||||
// GitHub API returns up to 100 results at a time. If the number of releases
|
// GitHub API returns up to 100 results at a time. If the number of releases
|
||||||
// is greater than 100, multiple fetches are needed.
|
// is greater than 100, multiple fetches are needed.
|
||||||
for page in 1.. {
|
for page in 1.. {
|
||||||
let per_page = 100;
|
let per_page = 100;
|
||||||
let mut r: github::Releases = download_github(&format!(
|
let mut r: github::Releases = download(&format!(
|
||||||
"https://api.github.com/repos/{repo}/releases?per_page={per_page}&page={page}"
|
"https://api.github.com/repos/{repo}/releases?per_page={per_page}&page={page}"
|
||||||
))?
|
))?
|
||||||
.into_json()?;
|
.into_json()?;
|
||||||
if r.len() < per_page {
|
// If version_req is latest, it is usually sufficient to look at the latest 100 releases.
|
||||||
|
if r.len() < per_page || version_req.map_or(false, |req| req == "latest") {
|
||||||
releases.append(&mut r);
|
releases.append(&mut r);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -172,7 +174,7 @@ fn main() -> Result<()> {
|
|||||||
if let Some(license) = detail.license {
|
if let Some(license) = detail.license {
|
||||||
eprintln!("Trying to using license '{license}' from crates.io ...");
|
eprintln!("Trying to using license '{license}' from crates.io ...");
|
||||||
if let Some(license_markdown) =
|
if let Some(license_markdown) =
|
||||||
get_license_markdown(&license, &repo.to_string(), &repo_info.default_branch)
|
get_license_markdown(&license, repo, &repo_info.default_branch)
|
||||||
{
|
{
|
||||||
manifests.license_markdown = license_markdown;
|
manifests.license_markdown = license_markdown;
|
||||||
}
|
}
|
||||||
@@ -181,7 +183,7 @@ fn main() -> Result<()> {
|
|||||||
if let Some(license) = license.spdx_id {
|
if let Some(license) = license.spdx_id {
|
||||||
eprintln!("Trying to using license '{license}' from github.com ...");
|
eprintln!("Trying to using license '{license}' from github.com ...");
|
||||||
if let Some(license_markdown) =
|
if let Some(license_markdown) =
|
||||||
get_license_markdown(&license, &repo.to_string(), &repo_info.default_branch)
|
get_license_markdown(&license, repo, &repo_info.default_branch)
|
||||||
{
|
{
|
||||||
manifests.license_markdown = license_markdown;
|
manifests.license_markdown = license_markdown;
|
||||||
}
|
}
|
||||||
@@ -192,7 +194,7 @@ fn main() -> Result<()> {
|
|||||||
panic!("Unable to determine license_markdown; set manually")
|
panic!("Unable to determine license_markdown; set manually")
|
||||||
}
|
}
|
||||||
|
|
||||||
let version_req: Option<semver::VersionReq> = match args.get(1) {
|
let version_req: Option<semver::VersionReq> = match version_req {
|
||||||
_ if latest_only => {
|
_ if latest_only => {
|
||||||
let req = format!("={}", releases.first_key_value().unwrap().0 .0).parse()?;
|
let req = format!("={}", releases.first_key_value().unwrap().0 .0).parse()?;
|
||||||
eprintln!("update manifest for versions '{req}'");
|
eprintln!("update manifest for versions '{req}'");
|
||||||
@@ -294,7 +296,7 @@ fn main() -> Result<()> {
|
|||||||
eprintln!("already downloaded");
|
eprintln!("already downloaded");
|
||||||
fs::File::open(download_cache)?.read_to_end(&mut buf)?;
|
fs::File::open(download_cache)?.read_to_end(&mut buf)?;
|
||||||
} else {
|
} else {
|
||||||
download_github(&url)?.into_reader().read_to_end(&mut buf)?;
|
download(&url)?.into_reader().read_to_end(&mut buf)?;
|
||||||
eprintln!("download complete");
|
eprintln!("download complete");
|
||||||
fs::write(download_cache, &buf)?;
|
fs::write(download_cache, &buf)?;
|
||||||
}
|
}
|
||||||
@@ -316,7 +318,7 @@ fn main() -> Result<()> {
|
|||||||
eprintln!("already downloaded");
|
eprintln!("already downloaded");
|
||||||
minisign_verify::Signature::from_file(sig_download_cache)?
|
minisign_verify::Signature::from_file(sig_download_cache)?
|
||||||
} else {
|
} else {
|
||||||
let buf = download_github(&url)?.into_string()?;
|
let buf = download(&url)?.into_string()?;
|
||||||
eprintln!("download complete");
|
eprintln!("download complete");
|
||||||
fs::write(sig_download_cache, &buf)?;
|
fs::write(sig_download_cache, &buf)?;
|
||||||
minisign_verify::Signature::decode(&buf)?
|
minisign_verify::Signature::decode(&buf)?
|
||||||
@@ -606,97 +608,131 @@ fn replace_vars(
|
|||||||
Ok(s)
|
Ok(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Download using GITHUB_TOKEN.
|
struct GitHubTokens {
|
||||||
#[allow(clippy::missing_panics_doc)]
|
// In my experience, only api.github.com have severe rate limit.
|
||||||
fn download_github(url: &str) -> Result<ureq::Response> {
|
// https://api.github.com/
|
||||||
let mut token = env::var("GITHUB_TOKEN").ok().filter(|v| !v.is_empty());
|
// Refs: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api
|
||||||
|
api: RwLock<Option<String>>,
|
||||||
|
// https://raw.githubusercontent.com/
|
||||||
|
// Refs: https://stackoverflow.com/questions/66522261/does-github-rate-limit-access-to-public-raw-files
|
||||||
|
raw: RwLock<Option<String>>,
|
||||||
|
// https://github.com/*/*/releases/download/
|
||||||
|
other: RwLock<Option<String>>,
|
||||||
|
}
|
||||||
|
impl GitHubTokens {
|
||||||
|
fn get(&self, url: &str) -> Option<String> {
|
||||||
|
if url.starts_with("https://raw.githubusercontent.com/") {
|
||||||
|
self.raw.read().unwrap().clone()
|
||||||
|
} else if url.starts_with("https://api.github.com/") {
|
||||||
|
self.api.read().unwrap().clone()
|
||||||
|
} else if url.starts_with("https://github.com/") {
|
||||||
|
self.other.read().unwrap().clone()
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fn clear(&self, url: &str) {
|
||||||
|
if url.starts_with("https://raw.githubusercontent.com/") {
|
||||||
|
*self.raw.write().unwrap() = None;
|
||||||
|
} else if url.starts_with("https://api.github.com/") {
|
||||||
|
*self.api.write().unwrap() = None;
|
||||||
|
} else if url.starts_with("https://github.com/") {
|
||||||
|
*self.other.write().unwrap() = None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static GITHUB_TOKENS: LazyLock<GitHubTokens> = LazyLock::new(|| {
|
||||||
|
let token = env::var("GITHUB_TOKEN").ok().filter(|v| !v.is_empty());
|
||||||
|
GitHubTokens {
|
||||||
|
raw: RwLock::new(token.clone()),
|
||||||
|
api: RwLock::new(token.clone()),
|
||||||
|
other: RwLock::new(token),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
fn download(url: &str) -> Result<ureq::Response> {
|
||||||
|
let mut token = GITHUB_TOKENS.get(url);
|
||||||
let mut retry = 0;
|
let mut retry = 0;
|
||||||
let max_retry = 6;
|
let mut retry_time = 0;
|
||||||
|
let mut max_retry = 6;
|
||||||
|
if token.is_none() {
|
||||||
|
max_retry /= 2;
|
||||||
|
}
|
||||||
let mut last_error;
|
let mut last_error;
|
||||||
loop {
|
loop {
|
||||||
let mut req = ureq::get(url);
|
let mut req = ureq::get(url);
|
||||||
if let Some(token) = &token {
|
if let Some(token) = &token {
|
||||||
req = req.set("Authorization", token);
|
req = req.set("Authorization", &format!("Bearer {token}"));
|
||||||
}
|
}
|
||||||
match req.call() {
|
match req.call() {
|
||||||
Ok(res) => return Ok(res),
|
Ok(res) => return Ok(res),
|
||||||
Err(e) => last_error = Some(e),
|
Err(e) => last_error = Some(e),
|
||||||
}
|
}
|
||||||
if retry == max_retry / 2 && token.is_some() {
|
retry_time += 1;
|
||||||
|
if token.is_some() && retry == max_retry / 2 {
|
||||||
|
retry_time = 0;
|
||||||
token = None;
|
token = None;
|
||||||
|
// rate limit
|
||||||
|
GITHUB_TOKENS.clear(url);
|
||||||
}
|
}
|
||||||
retry += 1;
|
retry += 1;
|
||||||
if retry > max_retry {
|
if retry > max_retry {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
eprintln!("download failed; retrying after {}s ({retry}/{max_retry})", retry * 2);
|
eprintln!("download failed; retrying after {}s ({retry}/{max_retry})", retry_time * 2);
|
||||||
std::thread::sleep(Duration::from_secs(retry * 2));
|
std::thread::sleep(Duration::from_secs(retry_time * 2));
|
||||||
}
|
}
|
||||||
Err(last_error.unwrap().into())
|
Err(last_error.unwrap().into())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::missing_panics_doc)]
|
fn github_head(url: &str) -> Result<()> {
|
||||||
pub fn github_head(url: &str) -> Result<()> {
|
|
||||||
eprintln!("fetching head of {url} ..");
|
eprintln!("fetching head of {url} ..");
|
||||||
let mut token = env::var("GITHUB_TOKEN").ok().filter(|v| !v.is_empty());
|
let mut token = GITHUB_TOKENS.get(url);
|
||||||
let mut retry = 0;
|
let mut retry = 0;
|
||||||
let max_retry = 2;
|
let mut retry_time = 0;
|
||||||
|
let mut max_retry = 2;
|
||||||
|
if token.is_none() {
|
||||||
|
max_retry /= 2;
|
||||||
|
}
|
||||||
let mut last_error;
|
let mut last_error;
|
||||||
loop {
|
loop {
|
||||||
let mut req = ureq::head(url);
|
let mut req = ureq::head(url);
|
||||||
if let Some(token) = &token {
|
if let Some(token) = &token {
|
||||||
req = req.set("Authorization", token);
|
req = req.set("Authorization", &format!("Bearer {token}"));
|
||||||
}
|
}
|
||||||
match req.call() {
|
match req.call() {
|
||||||
Ok(_) => return Ok(()),
|
Ok(_) => return Ok(()),
|
||||||
Err(e) => last_error = Some(e),
|
// rate limit
|
||||||
|
Err(e @ ureq::Error::Status(403, _)) => last_error = Some(e),
|
||||||
|
Err(e) => return Err(e.into()),
|
||||||
}
|
}
|
||||||
if retry == max_retry / 2 && token.is_some() {
|
retry_time += 1;
|
||||||
|
if token.is_some() && retry == max_retry / 2 {
|
||||||
|
retry_time = 0;
|
||||||
token = None;
|
token = None;
|
||||||
|
GITHUB_TOKENS.clear(url);
|
||||||
}
|
}
|
||||||
retry += 1;
|
retry += 1;
|
||||||
if retry > max_retry {
|
if retry > max_retry {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
eprintln!("head of {url} failed; retrying after {}s ({retry}/{max_retry})", retry * 2);
|
eprintln!("head of {url} failed; retrying after {}s ({retry}/{max_retry})", retry_time * 2);
|
||||||
std::thread::sleep(Duration::from_secs(retry * 2));
|
std::thread::sleep(Duration::from_secs(retry_time * 2));
|
||||||
}
|
|
||||||
Err(last_error.unwrap().into())
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Download without using GITHUB_TOKEN.
|
|
||||||
#[allow(clippy::missing_panics_doc)]
|
|
||||||
pub fn download(url: &str) -> Result<ureq::Response> {
|
|
||||||
let mut retry = 0;
|
|
||||||
let max_retry = 6;
|
|
||||||
let mut last_error;
|
|
||||||
loop {
|
|
||||||
let req = ureq::get(url);
|
|
||||||
match req.call() {
|
|
||||||
Ok(res) => return Ok(res),
|
|
||||||
Err(e) => last_error = Some(e),
|
|
||||||
}
|
|
||||||
retry += 1;
|
|
||||||
if retry > max_retry {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
eprintln!("download of {url} failed; retrying after {}s ({retry}/{max_retry})", retry * 2);
|
|
||||||
std::thread::sleep(Duration::from_secs(retry * 2));
|
|
||||||
}
|
}
|
||||||
Err(last_error.unwrap().into())
|
Err(last_error.unwrap().into())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
fn create_github_raw_link(repository: &String, branch: &String, filename: &String) -> String {
|
fn create_github_raw_link(repository: &str, branch: &str, filename: &str) -> String {
|
||||||
format!("https://raw.githubusercontent.com/{repository}/{branch}/{filename}")
|
format!("https://raw.githubusercontent.com/{repository}/{branch}/{filename}")
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
fn create_github_link(repository: &String, branch: &String, filename: &String) -> String {
|
fn create_github_link(repository: &str, branch: &str, filename: &str) -> String {
|
||||||
format!("https://github.com/{repository}/blob/{branch}/{filename}")
|
format!("https://github.com/{repository}/blob/{branch}/{filename}")
|
||||||
}
|
}
|
||||||
#[must_use]
|
#[must_use]
|
||||||
fn get_license_markdown(spdx_expr: &str, repo: &String, default_branch: &String) -> Option<String> {
|
fn get_license_markdown(spdx_expr: &str, repo: &str, default_branch: &str) -> Option<String> {
|
||||||
// TODO: use https://docs.rs/spdx/latest/spdx/expression/struct.Expression.html#method.canonicalize ?
|
// TODO: use https://docs.rs/spdx/latest/spdx/expression/struct.Expression.html#method.canonicalize ?
|
||||||
let expr = spdx::Expression::parse_mode(spdx_expr, spdx::ParseMode::LAX).unwrap();
|
let expr = spdx::Expression::parse_mode(spdx_expr, spdx::ParseMode::LAX).unwrap();
|
||||||
|
|
||||||
@@ -740,14 +776,14 @@ fn get_license_markdown(spdx_expr: &str, repo: &String, default_branch: &String)
|
|||||||
let license_name = if let Some(exception_id) = exception_id {
|
let license_name = if let Some(exception_id) = exception_id {
|
||||||
format!("{} WITH {}", license_id.name, exception_id.name)
|
format!("{} WITH {}", license_id.name, exception_id.name)
|
||||||
} else {
|
} else {
|
||||||
license_id.name.to_string()
|
license_id.name.to_owned()
|
||||||
};
|
};
|
||||||
let name = license_id.name.split('-').next().unwrap().to_ascii_uppercase();
|
let name = license_id.name.split('-').next().unwrap().to_ascii_uppercase();
|
||||||
for filename in [
|
for filename in [
|
||||||
"LICENSE".to_string(),
|
"LICENSE".to_owned(),
|
||||||
format!("LICENSE-{name}"),
|
format!("LICENSE-{name}"),
|
||||||
"LICENSE.md".to_string(),
|
"LICENSE.md".to_owned(),
|
||||||
"COPYING".to_string(),
|
"COPYING".to_owned(),
|
||||||
] {
|
] {
|
||||||
let url = create_github_raw_link(repo, default_branch, &filename);
|
let url = create_github_raw_link(repo, default_branch, &filename);
|
||||||
if github_head(&url).is_ok() {
|
if github_head(&url).is_ok() {
|
||||||
@@ -765,7 +801,7 @@ fn get_license_markdown(spdx_expr: &str, repo: &String, default_branch: &String)
|
|||||||
let license_name = if let Some(exception_id) = exception_id {
|
let license_name = if let Some(exception_id) = exception_id {
|
||||||
format!("{} WITH {}", license_id.name, exception_id.name)
|
format!("{} WITH {}", license_id.name, exception_id.name)
|
||||||
} else {
|
} else {
|
||||||
license_id.name.to_string()
|
license_id.name.to_owned()
|
||||||
};
|
};
|
||||||
if github_head(&url).is_ok() {
|
if github_head(&url).is_ok() {
|
||||||
let url = create_github_link(repo, default_branch, &filename);
|
let url = create_github_link(repo, default_branch, &filename);
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ This is a list of tools that are installed from manifests managed in this action
|
|||||||
If a tool not included in the list below is specified, this action uses [cargo-binstall] as a fallback.
|
If a tool not included in the list below is specified, this action uses [cargo-binstall] as a fallback.
|
||||||
|
|
||||||
> If `$CARGO_HOME/bin` is not available, Rust-related binaries will be installed to `$HOME/.cargo/bin`.<br>
|
> If `$CARGO_HOME/bin` is not available, Rust-related binaries will be installed to `$HOME/.cargo/bin`.<br>
|
||||||
> If `$HOME/.cargo/bin` is not available, Rust-related binaries will be installed to `/usr/local/bin`.<br>
|
> If `$HOME/.cargo/bin` is not available, Rust-related binaries will be installed to `$HOME/.install-action/bin`.<br>
|
||||||
> If `/usr/local/bin` is not available, binaries will be installed to `$HOME/.install-action/bin`.<br>
|
|
||||||
|
|
||||||
| Name | Where binaries will be installed | Where will it be installed from | Supported platform | License |
|
| Name | Where binaries will be installed | Where will it be installed from | Supported platform | License |
|
||||||
| ---- | -------------------------------- | ------------------------------- | ------------------ | ------- |
|
| ---- | -------------------------------- | ------------------------------- | ------------------ | ------- |
|
||||||
@@ -47,16 +46,16 @@ fn main() -> Result<()> {
|
|||||||
paths.sort_by_key(fs_err::DirEntry::path);
|
paths.sort_by_key(fs_err::DirEntry::path);
|
||||||
|
|
||||||
let mut tools = vec"
|
"[GPL-2.0](https://sourceware.org/git/?p=valgrind.git;a=blob;f=COPYING;hb=HEAD)"
|
||||||
.to_string(),
|
.to_owned(),
|
||||||
}];
|
}];
|
||||||
|
|
||||||
for path in paths {
|
for path in paths {
|
||||||
@@ -178,12 +177,10 @@ enum InstalledTo {
|
|||||||
impl fmt::Display for InstalledTo {
|
impl fmt::Display for InstalledTo {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
InstalledTo::Cargo => f.write_str("`$CARGO_HOME/bin`")?,
|
InstalledTo::Cargo => f.write_str("`$CARGO_HOME/bin`"),
|
||||||
InstalledTo::Snap => f.write_str("`/snap/bin`")?,
|
InstalledTo::Snap => f.write_str("`/snap/bin`"),
|
||||||
InstalledTo::UsrLocal => f.write_str("`/usr/local/bin`")?,
|
InstalledTo::UsrLocal => f.write_str("`$HOME/.install-action/bin`"),
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user