mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-21 15:10:27 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7491b90053 | ||
|
|
036b36b819 | ||
|
|
0f35150a34 | ||
|
|
4fedbddde8 | ||
|
|
20f466fa6b | ||
|
|
0fc560009a | ||
|
|
8eb922d4a7 | ||
|
|
689459d9ff | ||
|
|
c9ca4b7c7b | ||
|
|
68c5e86b83 | ||
|
|
d722dd2b73 |
22
CHANGELOG.md
22
CHANGELOG.md
@@ -10,6 +10,22 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2.33.29] - 2024-05-23
|
||||
|
||||
- Update `protoc@latest` to 3.27.0.
|
||||
|
||||
## [2.33.28] - 2024-05-22
|
||||
|
||||
- Update `wasmtime@latest` to 21.0.1.
|
||||
|
||||
## [2.33.27] - 2024-05-21
|
||||
|
||||
- Update `wasmtime@latest` to 21.0.0.
|
||||
|
||||
## [2.33.26] - 2024-05-19
|
||||
|
||||
- Update `cargo-careful@latest` to 0.4.2.
|
||||
|
||||
## [2.33.25] - 2024-05-18
|
||||
|
||||
- Update `cargo-binstall@latest` to 1.6.7.
|
||||
@@ -2181,7 +2197,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.33.25...HEAD
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.33.29...HEAD
|
||||
[2.33.29]: https://github.com/taiki-e/install-action/compare/v2.33.28...v2.33.29
|
||||
[2.33.28]: https://github.com/taiki-e/install-action/compare/v2.33.27...v2.33.28
|
||||
[2.33.27]: https://github.com/taiki-e/install-action/compare/v2.33.26...v2.33.27
|
||||
[2.33.26]: https://github.com/taiki-e/install-action/compare/v2.33.25...v2.33.26
|
||||
[2.33.25]: https://github.com/taiki-e/install-action/compare/v2.33.24...v2.33.25
|
||||
[2.33.24]: https://github.com/taiki-e/install-action/compare/v2.33.23...v2.33.24
|
||||
[2.33.23]: https://github.com/taiki-e/install-action/compare/v2.33.22...v2.33.23
|
||||
|
||||
@@ -27,6 +27,7 @@ borrow_as_ptr = { level = "allow", priority = 1 } # https://github.com/rust-lang
|
||||
declare_interior_mutable_const = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/7665
|
||||
doc_markdown = { level = "allow", priority = 1 }
|
||||
float_cmp = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/7725
|
||||
lint_groups_priority = { level = "allow", priority = 1 } # clippy bug: https://github.com/rust-lang/rust-clippy/issues/12270
|
||||
manual_assert = { level = "allow", priority = 1 }
|
||||
manual_range_contains = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/6455#issuecomment-1225966395
|
||||
missing_errors_doc = { level = "allow", priority = 1 }
|
||||
|
||||
15
manifests/cargo-careful.json
generated
15
manifests/cargo-careful.json
generated
@@ -12,10 +12,21 @@
|
||||
}
|
||||
},
|
||||
"latest": {
|
||||
"version": "0.4.1"
|
||||
"version": "0.4.2"
|
||||
},
|
||||
"0.4": {
|
||||
"version": "0.4.1"
|
||||
"version": "0.4.2"
|
||||
},
|
||||
"0.4.2": {
|
||||
"x86_64_linux_musl": {
|
||||
"checksum": "ee14c5796acab604714e358de11bf5204055410ae8fd4891df7f5d62461402c3"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"checksum": "480efaf0a577161332b27ea13c8703ead1b6355b5c6541f5bd61d440440b4bde"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"checksum": "ac374b7799a37e3ef21c6bfe409583c3acbc57242fbb32e8534269b5e97b8ee9"
|
||||
}
|
||||
},
|
||||
"0.4.1": {
|
||||
"x86_64_linux_musl": {
|
||||
|
||||
29
manifests/protoc.json
generated
29
manifests/protoc.json
generated
@@ -2,10 +2,35 @@
|
||||
"rust_crate": null,
|
||||
"template": null,
|
||||
"latest": {
|
||||
"version": "3.26.1"
|
||||
"version": "3.27.0"
|
||||
},
|
||||
"3": {
|
||||
"version": "3.26.1"
|
||||
"version": "3.27.0"
|
||||
},
|
||||
"3.27": {
|
||||
"version": "3.27.0"
|
||||
},
|
||||
"3.27.0": {
|
||||
"x86_64_linux_gnu": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protoc-27.0-linux-x86_64.zip",
|
||||
"checksum": "e2bdce49564dbad4676023d174d9cdcf932238bc0b56a8349a5cb27bbafc26b0"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protoc-27.0-osx-x86_64.zip",
|
||||
"checksum": "d956cf3a9e91a687aa4d1026e9261e5a587e4e0b545db0174509f6c448b8ce21"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protoc-27.0-win64.zip",
|
||||
"checksum": "80888b2a38786861c7b3aaf4e0bd5b933a51d750219ee8c61093655fc2924926"
|
||||
},
|
||||
"aarch64_linux_gnu": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protoc-27.0-linux-aarch_64.zip",
|
||||
"checksum": "1e4b2d8b145afe99a36602f305165761e46d2525aa94cbb907e2e983be6717ac"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protoc-27.0-osx-aarch_64.zip",
|
||||
"checksum": "2cf59e3e3463bede1f10b7517efdddd97a3bd8cfd9cacc286407b657290dc781"
|
||||
}
|
||||
},
|
||||
"3.26": {
|
||||
"version": "3.26.1"
|
||||
|
||||
42
manifests/wasmtime.json
generated
42
manifests/wasmtime.json
generated
@@ -23,7 +23,47 @@
|
||||
}
|
||||
},
|
||||
"latest": {
|
||||
"version": "20.0.2"
|
||||
"version": "21.0.1"
|
||||
},
|
||||
"21": {
|
||||
"version": "21.0.1"
|
||||
},
|
||||
"21.0": {
|
||||
"version": "21.0.1"
|
||||
},
|
||||
"21.0.1": {
|
||||
"x86_64_linux_gnu": {
|
||||
"checksum": "d49619e38c660196a048e80d34292e458a11af010ab1780e7b3ae9a42df6e33b"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"checksum": "8452dc6e865553cc7027d45a961f86440fd9459de7a48117236c386e4ceb2a1f"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"checksum": "c2a1e23e2ab49f3f942e6a47aba8c60c863fd66166c3940fa3dd1f9a0286a4b6"
|
||||
},
|
||||
"aarch64_linux_gnu": {
|
||||
"checksum": "77e8a381bbc54f39399c71ee305b6ce5b6807e7c088846ea1e406a3a62b38146"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"checksum": "816a4a50c875de0804c316fc3171fb20a45fb82e4bf3e3313dec4f6d819df688"
|
||||
}
|
||||
},
|
||||
"21.0.0": {
|
||||
"x86_64_linux_gnu": {
|
||||
"checksum": "605efdd4d073a7574b6d42ef0c9037c6c4e3933ed80615eab84f2d57cfeb3b28"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"checksum": "7beb9f1b6789af74beef8354b675d5cab6477be708bf45aa86f411c4afe55dfd"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"checksum": "e57345a2bd644e7f4d0a013617d64a3e16966b9483fee72bad2ab1eebabce59b"
|
||||
},
|
||||
"aarch64_linux_gnu": {
|
||||
"checksum": "0fa42c4555617cb4a602216ec45b8dc43686733653ec07f9488ab5e2e3bf5ec8"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"checksum": "b4a09d69c2cb4655e68895156a1de713b27a6e64796d9073108d20f55b8d5d5c"
|
||||
}
|
||||
},
|
||||
"20": {
|
||||
"version": "20.0.2"
|
||||
|
||||
@@ -31,6 +31,7 @@ fn main() -> Result<()> {
|
||||
std::process::exit(1);
|
||||
}
|
||||
let package = &args[0];
|
||||
let skip_existing_manifest_versions = std::env::var("SKIP_EXISTING_MANIFEST_VERSIONS").is_ok();
|
||||
|
||||
let workspace_root = &workspace_root();
|
||||
let manifest_path = &workspace_root.join("manifests").join(format!("{package}.json"));
|
||||
@@ -53,7 +54,7 @@ fn main() -> Result<()> {
|
||||
// is greater than 100, multiple fetches are needed.
|
||||
for page in 1.. {
|
||||
let per_page = 100;
|
||||
let mut r: github::Releases = download(&format!(
|
||||
let mut r: github::Releases = download_github(&format!(
|
||||
"https://api.github.com/repos/{repo}/releases?per_page={per_page}&page={page}"
|
||||
))?
|
||||
.into_json()?;
|
||||
@@ -179,6 +180,13 @@ fn main() -> Result<()> {
|
||||
continue;
|
||||
}
|
||||
|
||||
let reverse_semver = Reverse(semver_version.clone().into());
|
||||
|
||||
if skip_existing_manifest_versions && manifests.map.contains_key(&reverse_semver) {
|
||||
eprintln!("Skipping {semver_version} already in manifest");
|
||||
continue;
|
||||
};
|
||||
|
||||
let mut download_info = BTreeMap::new();
|
||||
let mut pubkey = None;
|
||||
for (&platform, base_download_info) in &base_info.platform {
|
||||
@@ -224,7 +232,7 @@ fn main() -> Result<()> {
|
||||
eprintln!("already downloaded");
|
||||
fs::File::open(download_cache)?.read_to_end(&mut buf)?;
|
||||
} else {
|
||||
download(&url)?.into_reader().read_to_end(&mut buf)?;
|
||||
download_github(&url)?.into_reader().read_to_end(&mut buf)?;
|
||||
eprintln!("download complete");
|
||||
fs::write(download_cache, &buf)?;
|
||||
}
|
||||
@@ -246,7 +254,7 @@ fn main() -> Result<()> {
|
||||
eprintln!("already downloaded");
|
||||
minisign_verify::Signature::from_file(sig_download_cache)?
|
||||
} else {
|
||||
let buf = download(&url)?.into_string()?;
|
||||
let buf = download_github(&url)?.into_string()?;
|
||||
eprintln!("download complete");
|
||||
fs::write(sig_download_cache, &buf)?;
|
||||
minisign_verify::Signature::decode(&buf)?
|
||||
@@ -357,10 +365,7 @@ fn main() -> Result<()> {
|
||||
if semver_version.pre.is_empty() {
|
||||
semver_versions.insert(semver_version.clone());
|
||||
}
|
||||
manifests.map.insert(
|
||||
Reverse(semver_version.clone().into()),
|
||||
ManifestRef::Real(Manifest { download_info }),
|
||||
);
|
||||
manifests.map.insert(reverse_semver, ManifestRef::Real(Manifest { download_info }));
|
||||
}
|
||||
if has_build_metadata {
|
||||
eprintln!(
|
||||
@@ -527,7 +532,9 @@ fn replace_vars(
|
||||
Ok(s)
|
||||
}
|
||||
|
||||
fn download(url: &str) -> Result<ureq::Response> {
|
||||
/// Download using GITHUB_TOKEN.
|
||||
#[allow(clippy::missing_panics_doc)]
|
||||
fn download_github(url: &str) -> Result<ureq::Response> {
|
||||
let mut token = env::var("GITHUB_TOKEN").ok().filter(|v| !v.is_empty());
|
||||
let mut retry = 0;
|
||||
let max_retry = 6;
|
||||
@@ -554,6 +561,28 @@ fn download(url: &str) -> Result<ureq::Response> {
|
||||
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())
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
struct Version {
|
||||
major: Option<u64>,
|
||||
|
||||
Reference in New Issue
Block a user