mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-28 10:00:26 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6c7481b70 | ||
|
|
8a2a11266f | ||
|
|
77774d839c | ||
|
|
481510ca72 | ||
|
|
bb478bb090 | ||
|
|
4558bb807b | ||
|
|
315e996a95 |
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@@ -83,6 +83,8 @@ jobs:
|
||||
- uses: ./
|
||||
with:
|
||||
tool: ${{ steps.tool-list.outputs.tool }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
|
||||
- name: Test bash
|
||||
run: just --version && shfmt --version && protoc --version
|
||||
@@ -151,6 +153,8 @@ jobs:
|
||||
- uses: ./
|
||||
with:
|
||||
tool: ${{ steps.tool-list.outputs.tool }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
manifest:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -161,7 +165,12 @@ jobs:
|
||||
steps:
|
||||
- uses: taiki-e/checkout-action@v1
|
||||
- name: Install Rust
|
||||
run: rustup toolchain add nightly --no-self-update && rustup default nightly
|
||||
run: rustup update stable --no-self-update
|
||||
- name: Generate Cargo.lock
|
||||
run: cargo update
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-all-crates: 'true'
|
||||
- run: tools/manifest.sh
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
17
CHANGELOG.md
17
CHANGELOG.md
@@ -10,6 +10,18 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2.41.3] - 2024-06-24
|
||||
|
||||
- Update `cargo-binstall@latest` to 1.7.3.
|
||||
|
||||
## [2.41.2] - 2024-06-23
|
||||
|
||||
- Update `typos@latest` to 1.22.9.
|
||||
|
||||
## [2.41.1] - 2024-06-22
|
||||
|
||||
- Update `typos@latest` to 1.22.8.
|
||||
|
||||
## [2.41.0] - 2024-06-21
|
||||
|
||||
- Support `knope`. ([#553](https://github.com/taiki-e/install-action/pull/553), thanks @jayvdb)
|
||||
@@ -2376,7 +2388,10 @@ Note: This release is considered a breaking change because installing on version
|
||||
|
||||
Initial release
|
||||
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.41.0...HEAD
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.41.3...HEAD
|
||||
[2.41.3]: https://github.com/taiki-e/install-action/compare/v2.41.2...v2.41.3
|
||||
[2.41.2]: https://github.com/taiki-e/install-action/compare/v2.41.1...v2.41.2
|
||||
[2.41.1]: https://github.com/taiki-e/install-action/compare/v2.41.0...v2.41.1
|
||||
[2.41.0]: https://github.com/taiki-e/install-action/compare/v2.40.2...v2.41.0
|
||||
[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
|
||||
|
||||
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.7.2"
|
||||
"version": "1.7.3"
|
||||
},
|
||||
"1.7.2": {
|
||||
"1.7.3": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DC9117B0D35BB5",
|
||||
"checksum": "08b6969c86471ecd1b9b6fbbd6508014d22dadda29fdd47ffb871d297ac49a8b"
|
||||
"etag": "0x8DC9395574A8C69",
|
||||
"checksum": "1dda17f293757b9f22b0669ca4471db3315ce01252ec6025f5859adbe00a77cf"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DC911760808EC8",
|
||||
"checksum": "7fa85fd3fda3c9e4962f16f8b9400e97ff2773e0481fc63a9cb882fe80115b7f"
|
||||
"etag": "0x8DC9395170D1071",
|
||||
"checksum": "5f899d270f78fd7798b4aa847a28fbb4eb6fddaa7209abb82fc2452ffbd85d2d"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DC9118FAF6A549",
|
||||
"checksum": "ee4da8bfaf25c84f0b67d5fd8e96f1243df4379f8dad64ffe2f82416198b7b35"
|
||||
"etag": "0x8DC9396630C249A",
|
||||
"checksum": "5f68171fdcbc96f7647ca6585ae4a94149a3abf84f9504146991c2d8f834350e"
|
||||
},
|
||||
"aarch64_linux_musl": {
|
||||
"etag": "0x8DC9117827C4F23",
|
||||
"checksum": "4342cfa8dc1033d2942270e8c4f7a63ef6953632ec3dbfacd7bebd4894e2ece8"
|
||||
"etag": "0x8DC93952A779501",
|
||||
"checksum": "52b5bda4920965a56b9936afa9cb5e90d2081799ad23f4a63f79b82baa0d70b8"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DC9117A4F64EA0",
|
||||
"checksum": "68157004ca95c2c3d4fae16246751317d2d6be32911cbdb04a06580d0c3aa43e"
|
||||
"etag": "0x8DC93954D97DFC2",
|
||||
"checksum": "ff87036ee1ae98bc953cfda9d30cdd7ab37357e82adbe0108bab09454224f172"
|
||||
},
|
||||
"aarch64_windows": {
|
||||
"etag": "0x8DC9118BFC4D5AC",
|
||||
"checksum": "baf1c6d5729b629015e199e7739a4f76bd40d9c4a90883ecb1d2c33c16240190"
|
||||
"etag": "0x8DC939621E46FDD",
|
||||
"checksum": "66d6252f41233962d00d196935b98974975ae4a62a6b0ca26e98d0b2ddc25fb8"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
42
manifests/typos.json
generated
42
manifests/typos.json
generated
@@ -16,13 +16,49 @@
|
||||
},
|
||||
"license_markdown": "[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)",
|
||||
"latest": {
|
||||
"version": "1.22.7"
|
||||
"version": "1.22.9"
|
||||
},
|
||||
"1": {
|
||||
"version": "1.22.7"
|
||||
"version": "1.22.9"
|
||||
},
|
||||
"1.22": {
|
||||
"version": "1.22.7"
|
||||
"version": "1.22.9"
|
||||
},
|
||||
"1.22.9": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DC92DF1EA8F56F",
|
||||
"checksum": "01e336ec8fa9b15a35ecb899e7175bb69956272840e28daeeeea3d56de73f39a"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DC92DF2CCE194B",
|
||||
"checksum": "7bf1cb6710601519d3fb860db2f613e5f652693f42590739eaa0e2826e3ebf3e"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DC92DF4F04D52B",
|
||||
"checksum": "0f28edc8c5d611dc6eb773958a553a411d4728d8f14af77152926da5eedb5f05"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DC92DF5CDB6DFA",
|
||||
"checksum": "b7b742b28bab6b2022557a7fb9e2d9af9b78f131ea700cd3615cdfda0dda7b53"
|
||||
}
|
||||
},
|
||||
"1.22.8": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DC9221550C37C8",
|
||||
"checksum": "4f919cc3a8ce9d0290e0d7923893dcdc37f3e5c7e29ed1f360484e35c2ec560b"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DC92217C08D7BD",
|
||||
"checksum": "bfc6d0369c4ec8e5d24a58d7ee0f4fd05c14f5de7506cf1cbd2c3d0742ff06fa"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DC9221705C4AA4",
|
||||
"checksum": "a0e1a80c2d6bf6226a20648cb82a58b0b272a0f414491d93b3a18a692f5b8d42"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DC922172FCD647",
|
||||
"checksum": "4a5677d83d72a93a25f426fab39ec9c747d47b8de25323bd2cf8fcad90a49ce1"
|
||||
}
|
||||
},
|
||||
"1.22.7": {
|
||||
"x86_64_linux_musl": {
|
||||
|
||||
@@ -7,7 +7,7 @@ use std::{
|
||||
ffi::OsStr,
|
||||
io::Read,
|
||||
path::Path,
|
||||
sync::{LazyLock, RwLock},
|
||||
sync::{OnceLock, RwLock},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
@@ -649,38 +649,43 @@ struct GitHubTokens {
|
||||
other: RwLock<Option<String>>,
|
||||
}
|
||||
impl GitHubTokens {
|
||||
fn get(&self, url: &str) -> Option<String> {
|
||||
// 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> {
|
||||
if url.starts_with("https://raw.githubusercontent.com/") {
|
||||
self.raw.read().unwrap().clone()
|
||||
Self::get_github_tokens().raw.read().unwrap().clone()
|
||||
} else if url.starts_with("https://api.github.com/") {
|
||||
self.api.read().unwrap().clone()
|
||||
Self::get_github_tokens().api.read().unwrap().clone()
|
||||
} else if url.starts_with("https://github.com/") {
|
||||
self.other.read().unwrap().clone()
|
||||
Self::get_github_tokens().other.read().unwrap().clone()
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
fn clear(&self, url: &str) {
|
||||
fn clear(url: &str) {
|
||||
if url.starts_with("https://raw.githubusercontent.com/") {
|
||||
*self.raw.write().unwrap() = None;
|
||||
*Self::get_github_tokens().raw.write().unwrap() = None;
|
||||
} else if url.starts_with("https://api.github.com/") {
|
||||
*self.api.write().unwrap() = None;
|
||||
*Self::get_github_tokens().api.write().unwrap() = None;
|
||||
} else if url.starts_with("https://github.com/") {
|
||||
*self.other.write().unwrap() = None;
|
||||
*Self::get_github_tokens().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 token = GitHubTokens::get(url);
|
||||
let mut retry = 0;
|
||||
let mut retry_time = 0;
|
||||
let mut max_retry = 6;
|
||||
@@ -702,7 +707,7 @@ fn download(url: &str) -> Result<ureq::Response> {
|
||||
retry_time = 0;
|
||||
token = None;
|
||||
// rate limit
|
||||
GITHUB_TOKENS.clear(url);
|
||||
GitHubTokens::clear(url);
|
||||
}
|
||||
retry += 1;
|
||||
if retry > max_retry {
|
||||
@@ -716,7 +721,7 @@ fn download(url: &str) -> Result<ureq::Response> {
|
||||
|
||||
fn github_head(url: &str) -> Result<()> {
|
||||
eprintln!("fetching head of {url} ..");
|
||||
let mut token = GITHUB_TOKENS.get(url);
|
||||
let mut token = GitHubTokens::get(url);
|
||||
let mut retry = 0;
|
||||
let mut retry_time = 0;
|
||||
let mut max_retry = 2;
|
||||
@@ -739,7 +744,7 @@ fn github_head(url: &str) -> Result<()> {
|
||||
if token.is_some() && retry == max_retry / 2 {
|
||||
retry_time = 0;
|
||||
token = None;
|
||||
GITHUB_TOKENS.clear(url);
|
||||
GitHubTokens::clear(url);
|
||||
}
|
||||
retry += 1;
|
||||
if retry > max_retry {
|
||||
|
||||
@@ -10,11 +10,11 @@ cd "$(dirname "$0")"/..
|
||||
# ./tools/manifest.sh [PACKAGE [VERSION_REQ]]
|
||||
|
||||
if [[ $# -gt 0 ]]; then
|
||||
cargo +nightly run --manifest-path tools/codegen/Cargo.toml --release -- "$@"
|
||||
cargo run --manifest-path tools/codegen/Cargo.toml --release -- "$@"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for manifest in tools/codegen/base/*.json; do
|
||||
package=$(basename "${manifest%.*}")
|
||||
cargo +nightly run --manifest-path tools/codegen/Cargo.toml --release -- "${package}" latest
|
||||
cargo run --manifest-path tools/codegen/Cargo.toml --release -- "${package}" latest
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user