mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-27 09:30:29 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d7ff60c81 | ||
|
|
cccd9d5fc0 | ||
|
|
ab4b96101a | ||
|
|
864785ef4d | ||
|
|
52fe51e612 | ||
|
|
4f13fb6244 | ||
|
|
8915f28247 | ||
|
|
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 }}
|
||||
|
||||
28
CHANGELOG.md
28
CHANGELOG.md
@@ -10,6 +10,28 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2.42.25] - 2024-08-17
|
||||
|
||||
- Update `shfmt@latest` to 3.9.0.
|
||||
|
||||
- Update `zola@latest` to 0.19.2.
|
||||
|
||||
- Update `cargo-semver-checks@latest` to 0.34.0.
|
||||
|
||||
- Update `cargo-binstall@latest` to 1.10.2.
|
||||
|
||||
## [2.42.24] - 2024-08-13
|
||||
|
||||
- Update `wasm-bindgen@latest` to 0.2.93.
|
||||
|
||||
## [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 +2608,11 @@ 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.25...HEAD
|
||||
[2.42.25]: https://github.com/taiki-e/install-action/compare/v2.42.24...v2.42.25
|
||||
[2.42.24]: https://github.com/taiki-e/install-action/compare/v2.42.23...v2.42.24
|
||||
[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() {
|
||||
|
||||
28
manifests/cargo-binstall.json
generated
28
manifests/cargo-binstall.json
generated
@@ -22,32 +22,32 @@
|
||||
},
|
||||
"license_markdown": "[GPL-3.0](https://github.com/cargo-bins/cargo-binstall/blob/HEAD/crates/bin/LICENSE)",
|
||||
"latest": {
|
||||
"version": "1.10.0"
|
||||
"version": "1.10.2"
|
||||
},
|
||||
"1.10.0": {
|
||||
"1.10.2": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DCB9185281E8CE",
|
||||
"checksum": "25e1f5eb019b06f273207c6dd1e2b7ac36b86660d2cd740e152cb99e33715178"
|
||||
"etag": "0x8DCBB7AB213ADBF",
|
||||
"checksum": "fd6363b26c6ac2a52a6b5b2b37563b75a48971eb78e9300737e978b9fb5478a3"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DCB91807B7C5DD",
|
||||
"checksum": "8ab17e8037ea697f25c8ce6a4e5d05f55fed98ad27e44e69916b21ab576dc253"
|
||||
"etag": "0x8DCBB7A97BA9B45",
|
||||
"checksum": "fe4ce102872f4b61e4f1786e07225fa8041457a9171593537ad686766e07b631"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DCB918FC8D1D60",
|
||||
"checksum": "f880eb5f96f2221e1d5f42072e64aba0df11eca64d12a50277afddbfe10ceb8d"
|
||||
"etag": "0x8DCBB7B76D83688",
|
||||
"checksum": "e63cd05aa7e4705e48bf401f00b86543ee294ad0bce1a398a75997b48022daf8"
|
||||
},
|
||||
"aarch64_linux_musl": {
|
||||
"etag": "0x8DCB918038BEDE5",
|
||||
"checksum": "a7bfc49f91e31a03ff09ed6e8f8eb2cefe414dd357c5d057713e80afd4d7bb0a"
|
||||
"etag": "0x8DCBB7A742FFE12",
|
||||
"checksum": "2eac2871acb50f377de6e4a2113a28b9bc5d278e692abbd2f09c3d966d117749"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DCB91842167176",
|
||||
"checksum": "d5fc3006c6bf7d0f9d7f7f32fd1b0fedec6da834273d5098dea309b501ace1ce"
|
||||
"etag": "0x8DCBB7AC648D69B",
|
||||
"checksum": "feb4992ad7c91a36a6fa51b188f594ac7ac1a8c50f8c8a6d6c0a5e0da369843d"
|
||||
},
|
||||
"aarch64_windows": {
|
||||
"etag": "0x8DCB918DAF9CEAF",
|
||||
"checksum": "1018864440e32a4053f8134e88623519bee969538acc4bc177d683f86215d531"
|
||||
"etag": "0x8DCBB7B016AB019",
|
||||
"checksum": "bd7c761acb022bf5b1b710d0111172fa5f7297059e79cc03cd7c050506cc2a2e"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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": {
|
||||
|
||||
23
manifests/cargo-semver-checks.json
generated
23
manifests/cargo-semver-checks.json
generated
@@ -16,7 +16,28 @@
|
||||
},
|
||||
"license_markdown": "[Apache-2.0](https://github.com/obi1kenobi/cargo-semver-checks/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/obi1kenobi/cargo-semver-checks/blob/main/LICENSE-MIT)",
|
||||
"latest": {
|
||||
"version": "0.33.0"
|
||||
"version": "0.34.0"
|
||||
},
|
||||
"0.34": {
|
||||
"version": "0.34.0"
|
||||
},
|
||||
"0.34.0": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DCBC8C02E363D5",
|
||||
"checksum": "e7cd8ef842b916bbfafe062fe1d59a337234c29e3651cfd9f2dd51a5cd17f0b3"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DCBC8BF63EE693",
|
||||
"checksum": "efe6230000458a1bf2ea091a54c38cd6815d629ca5a063d88be2a4287aa95289"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DCBC8CA673BA3E",
|
||||
"checksum": "5c5ea443dc5a2149b2abcaaa19ab7738932eb81ee6335771bfef4d075465f006"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DCBC8BED140D01",
|
||||
"checksum": "2d4bf3931b952e4a6071f88f5d186a64b414f75e5da37299e746dc68b54110f0"
|
||||
}
|
||||
},
|
||||
"0.33": {
|
||||
"version": "0.33.0"
|
||||
|
||||
29
manifests/shfmt.json
generated
29
manifests/shfmt.json
generated
@@ -19,10 +19,35 @@
|
||||
},
|
||||
"license_markdown": "[BSD-3-Clause](https://github.com/mvdan/sh/blob/master/LICENSE)",
|
||||
"latest": {
|
||||
"version": "3.8.0"
|
||||
"version": "3.9.0"
|
||||
},
|
||||
"3": {
|
||||
"version": "3.8.0"
|
||||
"version": "3.9.0"
|
||||
},
|
||||
"3.9": {
|
||||
"version": "3.9.0"
|
||||
},
|
||||
"3.9.0": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DCBE426554DD75",
|
||||
"checksum": "d99b06506aee2ac9113daec3049922e70dc8cffb84658e3ae512c6a6cbe101b6"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DCBE4264D5DC15",
|
||||
"checksum": "3e1ac72e91ba88ce483766e57a1aa41fa502a0f9d5a47f5f5cd3663badcecee4"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DCBE4263C7BEAF",
|
||||
"checksum": "4ea136134248ac8ebbf9103370ddcd951b515a9e9bfba903252f12fd067bb5e9"
|
||||
},
|
||||
"aarch64_linux_musl": {
|
||||
"etag": "0x8DCBE42651535DC",
|
||||
"checksum": "5e511463068f3d27ae1b087fb597fb9e8ad865be2ac501964a222a834fc1c463"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DCBE4265985163",
|
||||
"checksum": "7d89694369a516b2d5a68b31f8be2da04c91f50fb7cdd8e41003081b814ba3e8"
|
||||
}
|
||||
},
|
||||
"3.8": {
|
||||
"version": "3.8.0"
|
||||
|
||||
26
manifests/wasm-bindgen.json
generated
26
manifests/wasm-bindgen.json
generated
@@ -44,10 +44,32 @@
|
||||
},
|
||||
"license_markdown": "[MIT](https://github.com/rustwasm/wasm-bindgen/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/rustwasm/wasm-bindgen/blob/main/LICENSE-APACHE)",
|
||||
"latest": {
|
||||
"version": "0.2.92"
|
||||
"version": "0.2.93"
|
||||
},
|
||||
"0.2": {
|
||||
"version": "0.2.92"
|
||||
"version": "0.2.93"
|
||||
},
|
||||
"0.2.93": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DCBB2A6E8E759C",
|
||||
"checksum": "61f3ae807f402dfe5fbfe1250e97e802cbb7ca35172843286a26bb1149e38b7a"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DCBB73A832BA2F",
|
||||
"checksum": "840cabd18d734c8ccfa75f7dc83a5fab6530101dfa712c4ee0f785b76bcac1c7"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DCBB2A6E8CA2DF",
|
||||
"checksum": "99f02b203b973fb737fbca66c6791350eee7ee5aa7ad4e340c1f92bf4965c81c"
|
||||
},
|
||||
"aarch64_linux_gnu": {
|
||||
"etag": "0x8DCBB2A6EAB2C00",
|
||||
"checksum": "050479b30456a77e1f4a891ed99f989870f488097f5d78b13a216cf2953f7a03"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DCBB2A6E811726",
|
||||
"checksum": "a10193139082886d773f635a3144494eb5934a5a15a98fea18bcc154c6b80dd5"
|
||||
}
|
||||
},
|
||||
"0.2.92": {
|
||||
"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": {
|
||||
|
||||
22
manifests/zola.json
generated
22
manifests/zola.json
generated
@@ -16,10 +16,28 @@
|
||||
},
|
||||
"license_markdown": "[MIT](https://github.com/getzola/zola/blob/master/LICENSE)",
|
||||
"latest": {
|
||||
"version": "0.19.1"
|
||||
"version": "0.19.2"
|
||||
},
|
||||
"0.19": {
|
||||
"version": "0.19.1"
|
||||
"version": "0.19.2"
|
||||
},
|
||||
"0.19.2": {
|
||||
"x86_64_linux_gnu": {
|
||||
"etag": "0x8DCBD5AA740E4E7",
|
||||
"checksum": "0798e69b86c628ddcb264ebd86c8cc8dce7670b9049060bf94faa73f6857cd9c"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DCBD5A34CF43E5",
|
||||
"checksum": "38194f1d424bb4303c190fec149d90134ab33dd2d329831309deb409bcf416f8"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DCBD5BF68E3434",
|
||||
"checksum": "969cb24c2dfa21427690252e95bf92f0065f8582f1679f23ede67a865266b780"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DCBD5AA4166589",
|
||||
"checksum": "82c173381aced5edb28394c3202417e6dce31f0a5941ae58dd4e5e9969f5f375"
|
||||
}
|
||||
},
|
||||
"0.19.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