Compare commits

...

11 Commits

Author SHA1 Message Date
Taiki Endo
7f737c1056 Release 2.42.23 2024-08-13 06:45:47 +09:00
Taiki Endo
44a62c1085 Update wasmtime@latest to 23.0.2 2024-08-13 06:14:38 +09:00
Taiki Endo
66b16da49c codegen: Use LazyLock again 2024-08-12 05:02:13 +09:00
Taiki Endo
c995477ff1 Update TOOLS.md 2024-08-12 04:35:43 +09:00
Taiki Endo
abb8763b52 Simplify script in DEVELOPMENT.md 2024-08-12 04:32:15 +09:00
Taiki Endo
e1d57be4e5 Use here-string for shasum 2024-08-12 04:31:50 +09:00
Taiki Endo
8abecff737 Fix typos in logs 2024-08-12 04:27:46 +09:00
Taiki Endo
0b99f81025 ci: Re-enable opensuse containers tests
This reverts a43f23de26.
2024-08-12 04:27:19 +09:00
Taiki Endo
1f2c038e5d Retry on apk add failure 2024-08-12 04:26:20 +09:00
Taiki Endo
8efaa9bb37 Release 2.42.22 2024-08-10 20:34:45 +09:00
Taiki Endo
ea794731ca Update cargo-careful@latest to 0.4.3 2024-08-10 20:34:24 +09:00
10 changed files with 90 additions and 47 deletions

View File

@@ -132,18 +132,17 @@ jobs:
- debian:10-slim # glibc 2.28 - debian:10-slim # glibc 2.28
- debian:11-slim # glibc 2.31 - debian:11-slim # glibc 2.31
- debian:12-slim # glibc 2.36 - 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 # glibc 2.28
- almalinux:8-minimal # glibc 2.28 - almalinux:8-minimal # glibc 2.28
- almalinux:9 # glibc 2.34 - almalinux:9 # glibc 2.34
- almalinux:9-minimal # glibc 2.34 - almalinux:9-minimal # glibc 2.34
- centos:6 # glibc 2.12 - centos:6 # glibc 2.12
- centos:7 # glibc 2.17 - centos:7 # glibc 2.17
# TODO: broken: Repository 'Update repository of openSUSE Backports' is invalid. - opensuse/leap:latest # glibc 2.38 (as of leap 15.6)
# - opensuse/leap:latest # glibc 2.31 (as of leap 15.5) - opensuse/tumbleweed:latest # glibc 2.39 (as of 2024-07-19)
# - opensuse/tumbleweed:latest # glibc 2.39 (as of 2024-04-18) - archlinux:latest # glibc 2.39 (as of 2024-07-19)
- archlinux:latest # glibc 2.38 (as of 2024-04-18) - alpine:latest # musl 1.2.5 (as of alpine 3.20)
- alpine:latest # musl 1.2.4 (as of alpine 3.19)
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 60 timeout-minutes: 60
container: ${{ matrix.container }} container: ${{ matrix.container }}

View File

@@ -10,6 +10,14 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
## [Unreleased] ## [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 ## [2.42.21] - 2024-08-10
- Update `cargo-binstall@latest` to 1.10.0. - 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 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.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.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 [2.42.19]: https://github.com/taiki-e/install-action/compare/v2.42.18...v2.42.19

View File

@@ -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'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: > If you have `Github CLI` installed (the command `gh`), you can:
> >
> ```shell > ```sh
> GITHUB_TOKEN=$(gh auth status --show-token 2>&1 | sed -n 's/^.*Token: \(.*\)$/\1/p') ./tools/manifest.sh <tool> > GITHUB_TOKEN=$(gh auth status --show-token 2>&1 | sed -n 's/^.*Token: //p') ./tools/manifest.sh <tool>
> ``` > ```
## Refresh TOOLS.md ## Refresh TOOLS.md

View File

@@ -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) | | [**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) | | [**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) | | [**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**](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) | `$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) | | [**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) |

View File

@@ -25,7 +25,7 @@ runs:
set -eu set -eu
if ! command -v bash >/dev/null; then if ! command -v bash >/dev/null; then
if grep -Eq '^ID=alpine' /etc/os-release; 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 # NB: sync with apk_install in main.sh
if command -v sudo >/dev/null; then if command -v sudo >/dev/null; then
sudo apk --no-cache add bash sudo apk --no-cache add bash
@@ -36,7 +36,7 @@ runs:
fi fi
printf '::endgroup::\n' printf '::endgroup::\n'
else else
printf '::error::checkout-action requires bash\n' printf '::error::install-action requires bash\n'
exit 1 exit 1
fi fi
fi fi

10
main.sh
View File

@@ -49,11 +49,11 @@ download_and_checksum() {
if [[ -n "${checksum}" ]]; then if [[ -n "${checksum}" ]]; then
info "verifying sha256 checksum for $(basename "${url}")" info "verifying sha256 checksum for $(basename "${url}")"
if type -P sha256sum &>/dev/null; then 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 elif type -P shasum &>/dev/null; then
# GitHub-hosted macOS runner does not install GNU Coreutils by default. # GitHub-hosted macOS runner does not install GNU Coreutils by default.
# https://github.com/actions/runner-images/issues/90 # 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 else
bail "checksum requires 'sha256sum' or 'shasum' command; consider installing one of them or setting 'checksum' input option to 'false'" bail "checksum requires 'sha256sum' or 'shasum' command; consider installing one of them or setting 'checksum' input option to 'false'"
fi fi
@@ -367,11 +367,11 @@ pacman_install() {
} }
apk_install() { apk_install() {
if type -P sudo &>/dev/null; then 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 elif type -P doas &>/dev/null; then
doas apk --no-cache add "$@" retry doas apk --no-cache add "$@"
else else
apk --no-cache add "$@" retry apk --no-cache add "$@"
fi fi
} }
sys_install() { sys_install() {

View File

@@ -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)", "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": { "latest": {
"version": "0.4.2" "version": "0.4.3"
}, },
"0.4": { "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": { "0.4.2": {
"x86_64_linux_musl": { "x86_64_linux_musl": {

View File

@@ -24,13 +24,35 @@
}, },
"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": "23.0.1" "version": "23.0.2"
}, },
"23": { "23": {
"version": "23.0.1" "version": "23.0.2"
}, },
"23.0": { "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": { "23.0.1": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {

View File

@@ -7,7 +7,7 @@ use std::{
ffi::OsStr, ffi::OsStr,
io::Read, io::Read,
path::Path, path::Path,
sync::{OnceLock, RwLock}, sync::{LazyLock, RwLock},
time::Duration, time::Duration,
}; };
@@ -649,43 +649,38 @@ struct GitHubTokens {
other: RwLock<Option<String>>, other: RwLock<Option<String>>,
} }
impl GitHubTokens { impl GitHubTokens {
// TODO: Use std::sync::LazyLock once 1.80 is released fn get(&self, url: &str) -> Option<String> {
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> {
if url.starts_with("https://raw.githubusercontent.com/") { 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/") { } 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/") { } else if url.starts_with("https://github.com/") {
Self::get_github_tokens().other.read().unwrap().clone() self.other.read().unwrap().clone()
} else { } else {
None None
} }
} }
fn clear(url: &str) { fn clear(&self, url: &str) {
if url.starts_with("https://raw.githubusercontent.com/") { 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/") { } 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/") { } 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> { 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 = 0;
let mut retry_time = 0; let mut retry_time = 0;
let mut max_retry = 6; let mut max_retry = 6;
@@ -707,7 +702,7 @@ fn download(url: &str) -> Result<ureq::Response> {
retry_time = 0; retry_time = 0;
token = None; token = None;
// rate limit // rate limit
GitHubTokens::clear(url); GITHUB_TOKENS.clear(url);
} }
retry += 1; retry += 1;
if retry > max_retry { if retry > max_retry {
@@ -721,7 +716,7 @@ fn download(url: &str) -> Result<ureq::Response> {
fn github_head(url: &str) -> Result<()> { fn github_head(url: &str) -> Result<()> {
eprintln!("fetching head of {url} .."); 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 = 0;
let mut retry_time = 0; let mut retry_time = 0;
let mut max_retry = 2; let mut max_retry = 2;
@@ -744,7 +739,7 @@ fn github_head(url: &str) -> Result<()> {
if token.is_some() && retry == max_retry / 2 { if token.is_some() && retry == max_retry / 2 {
retry_time = 0; retry_time = 0;
token = None; token = None;
GitHubTokens::clear(url); GITHUB_TOKENS.clear(url);
} }
retry += 1; retry += 1;
if retry > max_retry { if retry > max_retry {

View File

@@ -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. 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 `$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> > If `$HOME/.cargo/bin` is not available, Rust-related binaries will be installed to `$HOME/.install-action/bin`.<br>