mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-27 09:30:29 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f737c1056 | ||
|
|
44a62c1085 | ||
|
|
66b16da49c | ||
|
|
c995477ff1 | ||
|
|
abb8763b52 | ||
|
|
e1d57be4e5 | ||
|
|
8abecff737 | ||
|
|
0b99f81025 | ||
|
|
1f2c038e5d | ||
|
|
8efaa9bb37 | ||
|
|
ea794731ca |
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@@ -132,18 +132,17 @@ jobs:
|
||||
- debian:10-slim # glibc 2.28
|
||||
- debian:11-slim # glibc 2.31
|
||||
- debian:12-slim # glibc 2.36
|
||||
- fedora:latest # glibc 2.38 (as of fedora 39)
|
||||
- fedora:latest # glibc 2.39 (as of fedora 40)
|
||||
- almalinux:8 # glibc 2.28
|
||||
- almalinux:8-minimal # glibc 2.28
|
||||
- almalinux:9 # glibc 2.34
|
||||
- almalinux:9-minimal # glibc 2.34
|
||||
- centos:6 # glibc 2.12
|
||||
- centos:7 # glibc 2.17
|
||||
# TODO: broken: Repository 'Update repository of openSUSE Backports' is invalid.
|
||||
# - opensuse/leap:latest # glibc 2.31 (as of leap 15.5)
|
||||
# - opensuse/tumbleweed:latest # glibc 2.39 (as of 2024-04-18)
|
||||
- archlinux:latest # glibc 2.38 (as of 2024-04-18)
|
||||
- alpine:latest # musl 1.2.4 (as of alpine 3.19)
|
||||
- opensuse/leap:latest # glibc 2.38 (as of leap 15.6)
|
||||
- opensuse/tumbleweed:latest # glibc 2.39 (as of 2024-07-19)
|
||||
- archlinux:latest # glibc 2.39 (as of 2024-07-19)
|
||||
- alpine:latest # musl 1.2.5 (as of alpine 3.20)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
container: ${{ matrix.container }}
|
||||
|
||||
12
CHANGELOG.md
12
CHANGELOG.md
@@ -10,6 +10,14 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2.42.23] - 2024-08-12
|
||||
|
||||
- Update `wasmtime@latest` to 23.0.2.
|
||||
|
||||
## [2.42.22] - 2024-08-10
|
||||
|
||||
- Update `cargo-careful@latest` to 0.4.3.
|
||||
|
||||
## [2.42.21] - 2024-08-10
|
||||
|
||||
- Update `cargo-binstall@latest` to 1.10.0.
|
||||
@@ -2586,7 +2594,9 @@ Note: This release is considered a breaking change because installing on version
|
||||
|
||||
Initial release
|
||||
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.42.21...HEAD
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.42.23...HEAD
|
||||
[2.42.23]: https://github.com/taiki-e/install-action/compare/v2.42.22...v2.42.23
|
||||
[2.42.22]: https://github.com/taiki-e/install-action/compare/v2.42.21...v2.42.22
|
||||
[2.42.21]: https://github.com/taiki-e/install-action/compare/v2.42.20...v2.42.21
|
||||
[2.42.20]: https://github.com/taiki-e/install-action/compare/v2.42.19...v2.42.20
|
||||
[2.42.19]: https://github.com/taiki-e/install-action/compare/v2.42.18...v2.42.19
|
||||
|
||||
@@ -17,8 +17,8 @@ See JSON files in `tools/codegen/base` directory for examples of the manifest.
|
||||
> If you're having problem with github api rate limit, you can use your GITHUB_TOKEN to increase the rate limit.
|
||||
> If you have `Github CLI` installed (the command `gh`), you can:
|
||||
>
|
||||
> ```shell
|
||||
> GITHUB_TOKEN=$(gh auth status --show-token 2>&1 | sed -n 's/^.*Token: \(.*\)$/\1/p') ./tools/manifest.sh <tool>
|
||||
> ```sh
|
||||
> GITHUB_TOKEN=$(gh auth status --show-token 2>&1 | sed -n 's/^.*Token: //p') ./tools/manifest.sh <tool>
|
||||
> ```
|
||||
|
||||
## Refresh TOOLS.md
|
||||
|
||||
1
TOOLS.md
1
TOOLS.md
@@ -45,6 +45,7 @@ See the [Supported tools section in README.md](README.md#supported-tools) for ho
|
||||
| [**hyperfine**](https://github.com/sharkdp/hyperfine) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/sharkdp/hyperfine/releases) | Linux, macOS, Windows | [MIT](https://github.com/sharkdp/hyperfine/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/sharkdp/hyperfine/blob/master/LICENSE-APACHE) |
|
||||
| [**jaq**](https://github.com/01mf02/jaq) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/01mf02/jaq/releases) | Linux, macOS, Windows | [MIT](https://github.com/01mf02/jaq/blob/main/LICENSE-MIT) |
|
||||
| [**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) |
|
||||
| [**knope**](https://github.com/knope-dev/knope) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/knope-dev/knope/releases) | Linux, macOS, Windows | [MIT](https://github.com/knope-dev/knope/blob/main/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) |
|
||||
| [**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) |
|
||||
|
||||
@@ -25,7 +25,7 @@ runs:
|
||||
set -eu
|
||||
if ! command -v bash >/dev/null; then
|
||||
if grep -Eq '^ID=alpine' /etc/os-release; then
|
||||
printf '::group::Install packages required for checkout-action (bash)\n'
|
||||
printf '::group::Install packages required for install-action (bash)\n'
|
||||
# NB: sync with apk_install in main.sh
|
||||
if command -v sudo >/dev/null; then
|
||||
sudo apk --no-cache add bash
|
||||
@@ -36,7 +36,7 @@ runs:
|
||||
fi
|
||||
printf '::endgroup::\n'
|
||||
else
|
||||
printf '::error::checkout-action requires bash\n'
|
||||
printf '::error::install-action requires bash\n'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
10
main.sh
10
main.sh
@@ -49,11 +49,11 @@ download_and_checksum() {
|
||||
if [[ -n "${checksum}" ]]; then
|
||||
info "verifying sha256 checksum for $(basename "${url}")"
|
||||
if type -P sha256sum &>/dev/null; then
|
||||
echo "${checksum} *tmp" | sha256sum -c - >/dev/null
|
||||
sha256sum -c - >/dev/null <<<"${checksum} *tmp"
|
||||
elif type -P shasum &>/dev/null; then
|
||||
# GitHub-hosted macOS runner does not install GNU Coreutils by default.
|
||||
# https://github.com/actions/runner-images/issues/90
|
||||
echo "${checksum} *tmp" | shasum -a 256 -c - >/dev/null
|
||||
shasum -a 256 -c - >/dev/null <<<"${checksum} *tmp"
|
||||
else
|
||||
bail "checksum requires 'sha256sum' or 'shasum' command; consider installing one of them or setting 'checksum' input option to 'false'"
|
||||
fi
|
||||
@@ -367,11 +367,11 @@ pacman_install() {
|
||||
}
|
||||
apk_install() {
|
||||
if type -P sudo &>/dev/null; then
|
||||
sudo apk --no-cache add "$@"
|
||||
retry sudo apk --no-cache add "$@"
|
||||
elif type -P doas &>/dev/null; then
|
||||
doas apk --no-cache add "$@"
|
||||
retry doas apk --no-cache add "$@"
|
||||
else
|
||||
apk --no-cache add "$@"
|
||||
retry apk --no-cache add "$@"
|
||||
fi
|
||||
}
|
||||
sys_install() {
|
||||
|
||||
18
manifests/cargo-careful.json
generated
18
manifests/cargo-careful.json
generated
@@ -13,10 +13,24 @@
|
||||
},
|
||||
"license_markdown": "[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)",
|
||||
"latest": {
|
||||
"version": "0.4.2"
|
||||
"version": "0.4.3"
|
||||
},
|
||||
"0.4": {
|
||||
"version": "0.4.2"
|
||||
"version": "0.4.3"
|
||||
},
|
||||
"0.4.3": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DCB92F10570A48",
|
||||
"checksum": "8a39c7c88744b7dec49fdedd08588e75343aabd466c9ec811832b65680c64e6d"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DCB92F104F71BD",
|
||||
"checksum": "c4d1b19bc243bd1d8ed5d99413d9a625b852e394e614b7871d71deb9557940e9"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DCB92F104F4AD5",
|
||||
"checksum": "1a3bb682553c48cef478609a377e8f845929efad8c4c903ae4ad66348ac5b0c3"
|
||||
}
|
||||
},
|
||||
"0.4.2": {
|
||||
"x86_64_linux_musl": {
|
||||
|
||||
28
manifests/wasmtime.json
generated
28
manifests/wasmtime.json
generated
@@ -24,13 +24,35 @@
|
||||
},
|
||||
"license_markdown": "[Apache-2.0 WITH LLVM-exception](https://github.com/bytecodealliance/wasmtime/blob/main/LICENSE)",
|
||||
"latest": {
|
||||
"version": "23.0.1"
|
||||
"version": "23.0.2"
|
||||
},
|
||||
"23": {
|
||||
"version": "23.0.1"
|
||||
"version": "23.0.2"
|
||||
},
|
||||
"23.0": {
|
||||
"version": "23.0.1"
|
||||
"version": "23.0.2"
|
||||
},
|
||||
"23.0.2": {
|
||||
"x86_64_linux_gnu": {
|
||||
"etag": "0x8DCBAFB6BC03CF7",
|
||||
"checksum": "78708a332c97ec764515f93ae480f5b31abb167b7c534817ce282a8571e0c426"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DCBAFB6CB96324",
|
||||
"checksum": "3f43858533e730dcb36304665622362bd91479f2ac8ffdbae95c7ca91d41d038"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DCBAFB700EB903",
|
||||
"checksum": "fab87dbb0a104b0e25dc4dbf10f1a856ab30079371b4b68d024e3f15a79c48c7"
|
||||
},
|
||||
"aarch64_linux_gnu": {
|
||||
"etag": "0x8DCBAFB657DA1DE",
|
||||
"checksum": "54edf90126a58dc7fe269fb25699346242e8648fc9a414011432e29415d2e52b"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DCBAFB6661D0FF",
|
||||
"checksum": "dcfe805271e8872e3025f3bfc1404de6efa13ad87fe9132ff8d27aa42caf7068"
|
||||
}
|
||||
},
|
||||
"23.0.1": {
|
||||
"x86_64_linux_gnu": {
|
||||
|
||||
@@ -7,7 +7,7 @@ use std::{
|
||||
ffi::OsStr,
|
||||
io::Read,
|
||||
path::Path,
|
||||
sync::{OnceLock, RwLock},
|
||||
sync::{LazyLock, RwLock},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
@@ -649,43 +649,38 @@ struct GitHubTokens {
|
||||
other: RwLock<Option<String>>,
|
||||
}
|
||||
impl GitHubTokens {
|
||||
// TODO: Use std::sync::LazyLock once 1.80 is released
|
||||
fn get_github_tokens() -> &'static GitHubTokens {
|
||||
static GITHUB_TOKENS: OnceLock<GitHubTokens> = OnceLock::new();
|
||||
GITHUB_TOKENS.get_or_init(|| {
|
||||
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 get(url: &str) -> Option<String> {
|
||||
fn get(&self, url: &str) -> Option<String> {
|
||||
if url.starts_with("https://raw.githubusercontent.com/") {
|
||||
Self::get_github_tokens().raw.read().unwrap().clone()
|
||||
self.raw.read().unwrap().clone()
|
||||
} else if url.starts_with("https://api.github.com/") {
|
||||
Self::get_github_tokens().api.read().unwrap().clone()
|
||||
self.api.read().unwrap().clone()
|
||||
} else if url.starts_with("https://github.com/") {
|
||||
Self::get_github_tokens().other.read().unwrap().clone()
|
||||
self.other.read().unwrap().clone()
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
fn clear(url: &str) {
|
||||
fn clear(&self, url: &str) {
|
||||
if url.starts_with("https://raw.githubusercontent.com/") {
|
||||
*Self::get_github_tokens().raw.write().unwrap() = None;
|
||||
*self.raw.write().unwrap() = None;
|
||||
} else if url.starts_with("https://api.github.com/") {
|
||||
*Self::get_github_tokens().api.write().unwrap() = None;
|
||||
*self.api.write().unwrap() = None;
|
||||
} else if url.starts_with("https://github.com/") {
|
||||
*Self::get_github_tokens().other.write().unwrap() = None;
|
||||
*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 = GitHubTokens::get(url);
|
||||
let mut token = GITHUB_TOKENS.get(url);
|
||||
let mut retry = 0;
|
||||
let mut retry_time = 0;
|
||||
let mut max_retry = 6;
|
||||
@@ -707,7 +702,7 @@ fn download(url: &str) -> Result<ureq::Response> {
|
||||
retry_time = 0;
|
||||
token = None;
|
||||
// rate limit
|
||||
GitHubTokens::clear(url);
|
||||
GITHUB_TOKENS.clear(url);
|
||||
}
|
||||
retry += 1;
|
||||
if retry > max_retry {
|
||||
@@ -721,7 +716,7 @@ fn download(url: &str) -> Result<ureq::Response> {
|
||||
|
||||
fn github_head(url: &str) -> Result<()> {
|
||||
eprintln!("fetching head of {url} ..");
|
||||
let mut token = GitHubTokens::get(url);
|
||||
let mut token = GITHUB_TOKENS.get(url);
|
||||
let mut retry = 0;
|
||||
let mut retry_time = 0;
|
||||
let mut max_retry = 2;
|
||||
@@ -744,7 +739,7 @@ fn github_head(url: &str) -> Result<()> {
|
||||
if token.is_some() && retry == max_retry / 2 {
|
||||
retry_time = 0;
|
||||
token = None;
|
||||
GitHubTokens::clear(url);
|
||||
GITHUB_TOKENS.clear(url);
|
||||
}
|
||||
retry += 1;
|
||||
if retry > max_retry {
|
||||
|
||||
@@ -12,6 +12,8 @@ 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.
|
||||
|
||||
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 `$HOME/.cargo/bin` is not available, Rust-related binaries will be installed to `$HOME/.install-action/bin`.<br>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user