Compare commits

...

11 Commits

Author SHA1 Message Date
Taiki Endo
c25f50bacd Release 2.13.6 2023-08-04 22:58:42 +09:00
Taiki Endo
94d8a59049 codegen: Clean up rust crate handling 2023-08-04 21:58:05 +09:00
Taiki Endo
8e67e37b45 Update mdbook@latest to 0.4.33 (#181) 2023-08-04 06:07:57 +00:00
Taiki Endo
26fe17aa20 codegen: Prevent yanked version from being selected as candidate for latest or omitted version 2023-08-03 22:00:35 +09:00
Taiki Endo
0825c0beeb Release 2.13.5 2023-08-03 11:50:09 +09:00
Taiki Endo
0e33aaec49 Update cargo-nextest@latest to 0.9.57 (#179) 2023-08-03 10:49:36 +10:00
Taiki Endo
30c32b7a1e Release 2.13.4 2023-08-03 05:40:49 +09:00
Taiki Endo
eabcafb863 Update cargo-nextest@latest to 0.9.56 2023-08-03 05:40:15 +09:00
Taiki Endo
f879cd58b6 Update cargo-deny@latest to 0.14.1 2023-08-03 05:40:15 +09:00
Taiki Endo
991b1ec814 Release 2.13.3 2023-08-01 12:06:13 +09:00
Taiki Endo
d26809b823 Update dprint@latest to 0.40.2 (#176) 2023-08-01 03:05:12 +00:00
57 changed files with 245 additions and 71 deletions

View File

@@ -10,6 +10,24 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
## [Unreleased] ## [Unreleased]
## [2.13.6] - 2023-08-04
- Update `mdbook@latest` to 0.4.33.
## [2.13.5] - 2023-08-03
- Update `cargo-nextest@latest` to 0.9.57.
## [2.13.4] - 2023-08-02
- Update `cargo-nextest@latest` to 0.9.56.
- Update `cargo-deny@latest` to 0.14.1.
## [2.13.3] - 2023-08-01
- Update `dprint@latest` to 0.40.2.
## [2.13.2] - 2023-08-01 ## [2.13.2] - 2023-08-01
- Update `syft@latest` to 0.86.1. - Update `syft@latest` to 0.86.1.
@@ -1013,7 +1031,11 @@ 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.13.2...HEAD [Unreleased]: https://github.com/taiki-e/install-action/compare/v2.13.6...HEAD
[2.13.6]: https://github.com/taiki-e/install-action/compare/v2.13.5...v2.13.6
[2.13.5]: https://github.com/taiki-e/install-action/compare/v2.13.4...v2.13.5
[2.13.4]: https://github.com/taiki-e/install-action/compare/v2.13.3...v2.13.4
[2.13.3]: https://github.com/taiki-e/install-action/compare/v2.13.2...v2.13.3
[2.13.2]: https://github.com/taiki-e/install-action/compare/v2.13.1...v2.13.2 [2.13.2]: https://github.com/taiki-e/install-action/compare/v2.13.1...v2.13.2
[2.13.1]: https://github.com/taiki-e/install-action/compare/v2.13.0...v2.13.1 [2.13.1]: https://github.com/taiki-e/install-action/compare/v2.13.0...v2.13.1
[2.13.0]: https://github.com/taiki-e/install-action/compare/v2.12.23...v2.13.0 [2.13.0]: https://github.com/taiki-e/install-action/compare/v2.12.23...v2.13.0

15
main.sh
View File

@@ -152,6 +152,7 @@ read_manifest() {
local tool="$1" local tool="$1"
local version="$2" local version="$2"
local manifest local manifest
rust_crate=$(jq -r ".rust_crate" "${manifest_dir}/${tool}.json")
manifest=$(jq -r ".\"${version}\"" "${manifest_dir}/${tool}.json") manifest=$(jq -r ".\"${version}\"" "${manifest_dir}/${tool}.json")
if [[ "${manifest}" == "null" ]]; then if [[ "${manifest}" == "null" ]]; then
download_info="null" download_info="null"
@@ -220,15 +221,14 @@ read_download_info() {
template=$(jq -r ".template.${host_platform}" "${manifest_dir}/${tool}.json") template=$(jq -r ".template.${host_platform}" "${manifest_dir}/${tool}.json")
url=$(jq <<<"${template}" -r '.url') url=$(jq <<<"${template}" -r '.url')
url="${url//\$\{version\}/${exact_version}}" url="${url//\$\{version\}/${exact_version}}"
bin_dir=$(jq <<<"${template}" -r '.bin_dir')
bin_dir="${bin_dir//\$\{version\}/${exact_version}}"
bin_in_archive=$(jq <<<"${template}" -r '.bin') bin_in_archive=$(jq <<<"${template}" -r '.bin')
bin_in_archive="${bin_in_archive//\$\{version\}/${exact_version}}" bin_in_archive="${bin_in_archive//\$\{version\}/${exact_version}}"
else else
bin_dir=$(jq <<<"${download_info}" -r '.bin_dir')
bin_in_archive=$(jq <<<"${download_info}" -r '.bin') bin_in_archive=$(jq <<<"${download_info}" -r '.bin')
fi fi
if [[ "${bin_dir}" == "null" ]]; then if [[ "${rust_crate}" == "null" ]]; then
bin_dir="/usr/local/bin"
else
bin_dir="${cargo_bin}" bin_dir="${cargo_bin}"
fi fi
if [[ "${bin_in_archive}" == "null" ]]; then if [[ "${bin_in_archive}" == "null" ]]; then
@@ -563,10 +563,13 @@ for tool in "${tools[@]}"; do
# Use cargo-binstall fallback if tool is available but the specified version not available. # Use cargo-binstall fallback if tool is available but the specified version not available.
read_manifest "${tool}" "${version}" read_manifest "${tool}" "${version}"
if [[ "${download_info}" == "null" ]]; then if [[ "${download_info}" == "null" ]]; then
if [[ "${rust_crate}" == "null" ]]; then
bail "${tool}@${version} for '${host_os}' is not supported"
fi
warn "${tool}@${version} for '${host_os}' is not supported; fallback to cargo-binstall" warn "${tool}@${version} for '${host_os}' is not supported; fallback to cargo-binstall"
case "${version}" in case "${version}" in
latest) unsupported_tools+=("${tool}") ;; latest) unsupported_tools+=("${rust_crate}") ;;
*) unsupported_tools+=("${tool}@${version}") ;; *) unsupported_tools+=("${rust_crate}@${version}") ;;
esac esac
continue continue
fi fi

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cargo-binstall",
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/cargo-bins/cargo-binstall/releases/download/v${version}/cargo-binstall-x86_64-unknown-linux-musl.tgz" "url": "https://github.com/cargo-bins/cargo-binstall/releases/download/v${version}/cargo-binstall-x86_64-unknown-linux-musl.tgz"

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cargo-careful",
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/RalfJung/cargo-careful/releases/download/v${version}/cargo-careful.x86_64-unknown-linux-musl" "url": "https://github.com/RalfJung/cargo-careful/releases/download/v${version}/cargo-careful.x86_64-unknown-linux-musl"

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cargo-deny",
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/EmbarkStudios/cargo-deny/releases/download/${version}/cargo-deny-${version}-x86_64-unknown-linux-musl.tar.gz", "url": "https://github.com/EmbarkStudios/cargo-deny/releases/download/${version}/cargo-deny-${version}-x86_64-unknown-linux-musl.tar.gz",
@@ -18,10 +19,24 @@
} }
}, },
"latest": { "latest": {
"version": "0.14.0" "version": "0.14.1"
}, },
"0.14": { "0.14": {
"version": "0.14.0" "version": "0.14.1"
},
"0.14.1": {
"x86_64_linux_musl": {
"checksum": "913928cabbf80d2a237de6ffe47bdcba49434f8f08f9680f8a3a27b4ebc30832"
},
"x86_64_macos": {
"checksum": "ea59c1045d05f0afe9d53cb5677cbbedd858e02132fc4414f92a5f81e943a5dc"
},
"x86_64_windows": {
"checksum": "15e59617863b89040b52d67b79eaaa137fe7fe73eacab2ef01aef1cdb45195f9"
},
"aarch64_macos": {
"checksum": "f1651d37cb991c96cd9cc96c00cee2ddb470e7dd490a83896664ce50b2238e59"
}
}, },
"0.14.0": { "0.14.0": {
"x86_64_linux_musl": { "x86_64_linux_musl": {

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cargo-dinghy",
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/sonos/dinghy/releases/download/${version}/cargo-dinghy-linux-${version}.tgz", "url": "https://github.com/sonos/dinghy/releases/download/${version}/cargo-dinghy-linux-${version}.tgz",

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cargo-hack",
"template": null, "template": null,
"latest": { "latest": {
"version": "0.5.28" "version": "0.5.28"

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cargo-llvm-cov",
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/taiki-e/cargo-llvm-cov/releases/download/v${version}/cargo-llvm-cov-x86_64-unknown-linux-musl.tar.gz" "url": "https://github.com/taiki-e/cargo-llvm-cov/releases/download/v${version}/cargo-llvm-cov-x86_64-unknown-linux-musl.tar.gz"

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cargo-make",
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/sagiegurari/cargo-make/releases/download/${version}/cargo-make-v${version}-x86_64-unknown-linux-musl.zip", "url": "https://github.com/sagiegurari/cargo-make/releases/download/${version}/cargo-make-v${version}-x86_64-unknown-linux-musl.zip",

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cargo-minimal-versions",
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/taiki-e/cargo-minimal-versions/releases/download/v${version}/cargo-minimal-versions-x86_64-unknown-linux-musl.tar.gz" "url": "https://github.com/taiki-e/cargo-minimal-versions/releases/download/v${version}/cargo-minimal-versions-x86_64-unknown-linux-musl.tar.gz"

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cargo-nextest",
"template": { "template": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {
"url": "https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-${version}/cargo-nextest-${version}-x86_64-unknown-linux-gnu.tar.gz" "url": "https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-${version}/cargo-nextest-${version}-x86_64-unknown-linux-gnu.tar.gz"
@@ -17,10 +18,44 @@
} }
}, },
"latest": { "latest": {
"version": "0.9.55" "version": "0.9.57"
}, },
"0.9": { "0.9": {
"version": "0.9.55" "version": "0.9.57"
},
"0.9.57": {
"x86_64_linux_gnu": {
"checksum": "5fc2416dd001ec89d904a345465da0b91452896b74621a82fec33e33d4856320"
},
"x86_64_linux_musl": {
"checksum": "c9275cb47f75936ad9a6ff24557f210c7a248d284f9b9d6953e128e907b1a926"
},
"x86_64_macos": {
"checksum": "8a66df687d857f173ca6ac7773c699883beca09ce558852bc620d023336ee3b4"
},
"x86_64_windows": {
"checksum": "75e2b29d49b1b86d15f61051620aeffb159322f9c262cec2646a96ec79bfac85"
},
"aarch64_linux_gnu": {
"checksum": "e567e43446969205fd26da6f09c03f965fce20df3a0c476c4f2f77ed30ff2538"
}
},
"0.9.56": {
"x86_64_linux_gnu": {
"checksum": "914f380306a7216c8b79ca4408cc39073eaaea9e7b2101e2bfe0c123636a478b"
},
"x86_64_linux_musl": {
"checksum": "ec12fa3f52655033aa35581f300bac63cd16b372ca68c85a5621c25255cae759"
},
"x86_64_macos": {
"checksum": "aa748f80fe110e6ea607d5dd264e1fe3513b631a7957605cdd8bb12e5cc878f9"
},
"x86_64_windows": {
"checksum": "185cddb1d347c3b0e9e1cebd919297809491394aaa1b2abe5109a6139be5e400"
},
"aarch64_linux_gnu": {
"checksum": "07bbc36fec9dfbe95b0a2e6fc0446175dfb9d58e24474095768965591625a19c"
}
}, },
"0.9.55": { "0.9.55": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cargo-no-dev-deps",
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/taiki-e/cargo-no-dev-deps/releases/download/v${version}/cargo-no-dev-deps-x86_64-unknown-linux-musl.tar.gz" "url": "https://github.com/taiki-e/cargo-no-dev-deps/releases/download/v${version}/cargo-no-dev-deps-x86_64-unknown-linux-musl.tar.gz"

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cargo-tarpaulin",
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/xd009642/tarpaulin/releases/download/${version}/cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz" "url": "https://github.com/xd009642/tarpaulin/releases/download/${version}/cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz"

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cargo-udeps",
"template": { "template": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {
"url": "https://github.com/est31/cargo-udeps/releases/download/v${version}/cargo-udeps-v${version}-x86_64-unknown-linux-gnu.tar.gz", "url": "https://github.com/est31/cargo-udeps/releases/download/v${version}/cargo-udeps-v${version}-x86_64-unknown-linux-gnu.tar.gz",

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cargo-valgrind",
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/jfrimmel/cargo-valgrind/releases/download/v${version}/cargo-valgrind-${version}-x86_64-unknown-linux-musl.tar.gz" "url": "https://github.com/jfrimmel/cargo-valgrind/releases/download/v${version}/cargo-valgrind-${version}-x86_64-unknown-linux-musl.tar.gz"

1
manifests/cross.json generated
View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "cross",
"template": null, "template": null,
"latest": { "latest": {
"version": "0.2.5" "version": "0.2.5"

22
manifests/dprint.json generated
View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "dprint",
"template": { "template": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {
"url": "https://github.com/dprint/dprint/releases/download/${version}/dprint-x86_64-unknown-linux-gnu.zip" "url": "https://github.com/dprint/dprint/releases/download/${version}/dprint-x86_64-unknown-linux-gnu.zip"
@@ -20,10 +21,27 @@
} }
}, },
"latest": { "latest": {
"version": "0.40.1" "version": "0.40.2"
}, },
"0.40": { "0.40": {
"version": "0.40.1" "version": "0.40.2"
},
"0.40.2": {
"x86_64_linux_musl": {
"checksum": "5c8418466937191f711ce4ba59e9ec28036daec01a08a505a17570a5edaec4c3"
},
"x86_64_macos": {
"checksum": "e4089c699a09ac725337f2f00f1de2798fa93e2cd7c739c81fdd85c3259b61e5"
},
"x86_64_windows": {
"checksum": "ede70ca91ae7983f8365aa59c477246f9595c9f32536c359abf3a706c68801c8"
},
"aarch64_linux_gnu": {
"checksum": "66e51be4b1882f504beca45067fee39226b81c23c7fed0b71de629cafa51b7da"
},
"aarch64_macos": {
"checksum": "d1e7517270c7a04f38ff6659d0a20482c5406e66b2ae8e9c15abd4674e74c127"
}
}, },
"0.40.1": { "0.40.1": {
"x86_64_linux_musl": { "x86_64_linux_musl": {

1
manifests/grcov.json generated
View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "grcov",
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/mozilla/grcov/releases/download/v${version}/grcov-x86_64-unknown-linux-musl.tar.bz2" "url": "https://github.com/mozilla/grcov/releases/download/v${version}/grcov-x86_64-unknown-linux-musl.tar.bz2"

1
manifests/just.json generated
View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "just",
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/casey/just/releases/download/${version}/just-${version}-x86_64-unknown-linux-musl.tar.gz" "url": "https://github.com/casey/just/releases/download/${version}/just-${version}-x86_64-unknown-linux-musl.tar.gz"

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "mdbook-linkcheck",
"template": { "template": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {
"url": "https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v${version}/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip" "url": "https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v${version}/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip"

19
manifests/mdbook.json generated
View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "mdbook",
"template": { "template": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {
"url": "https://github.com/rust-lang/mdBook/releases/download/v${version}/mdbook-v${version}-x86_64-unknown-linux-gnu.tar.gz" "url": "https://github.com/rust-lang/mdBook/releases/download/v${version}/mdbook-v${version}-x86_64-unknown-linux-gnu.tar.gz"
@@ -17,10 +18,24 @@
} }
}, },
"latest": { "latest": {
"version": "0.4.32" "version": "0.4.33"
}, },
"0.4": { "0.4": {
"version": "0.4.32" "version": "0.4.33"
},
"0.4.33": {
"x86_64_linux_musl": {
"checksum": "f56043b14b2d554b98aa6cd5e15bcbe81c095cea67a937c6c724300da4fc4005"
},
"x86_64_macos": {
"checksum": "172e83fea640b41afecf46d5bec3b09d0d54c5e6234b9e3777715b6c6a4a58a3"
},
"x86_64_windows": {
"checksum": "573acc650654cca12c77d73f0f7c8d22fdce92d7348c0bd4676579c60ee3c0b9"
},
"aarch64_linux_musl": {
"checksum": "dbafc64ee0bd616ee10ab367686fc7a000d817ddb7c6634e8b878e6c322bb38f"
}
}, },
"0.4.32": { "0.4.32": {
"x86_64_linux_musl": { "x86_64_linux_musl": {

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "parse-changelog",
"template": { "template": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {
"url": "https://github.com/taiki-e/parse-changelog/releases/download/v${version}/parse-changelog-x86_64-unknown-linux-gnu.tar.gz" "url": "https://github.com/taiki-e/parse-changelog/releases/download/v${version}/parse-changelog-x86_64-unknown-linux-gnu.tar.gz"

1
manifests/protoc.json generated
View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": null,
"template": null, "template": null,
"latest": { "latest": {
"version": "3.23.4" "version": "3.23.4"

View File

@@ -1,23 +1,20 @@
{ {
"rust_crate": null,
"template": { "template": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {
"url": "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz", "url": "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz",
"bin_dir": "/usr/local/bin",
"bin": "shellcheck-v${version}/shellcheck" "bin": "shellcheck-v${version}/shellcheck"
}, },
"x86_64_macos": { "x86_64_macos": {
"url": "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.darwin.x86_64.tar.xz", "url": "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.darwin.x86_64.tar.xz",
"bin_dir": "/usr/local/bin",
"bin": "shellcheck-v${version}/shellcheck" "bin": "shellcheck-v${version}/shellcheck"
}, },
"x86_64_windows": { "x86_64_windows": {
"url": "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.zip", "url": "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.zip",
"bin_dir": "/usr/local/bin",
"bin": "shellcheck.exe" "bin": "shellcheck.exe"
}, },
"aarch64_linux_gnu": { "aarch64_linux_gnu": {
"url": "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.aarch64.tar.xz", "url": "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.aarch64.tar.xz",
"bin_dir": "/usr/local/bin",
"bin": "shellcheck-v${version}/shellcheck" "bin": "shellcheck-v${version}/shellcheck"
} }
}, },

16
manifests/shfmt.json generated
View File

@@ -1,24 +1,20 @@
{ {
"rust_crate": null,
"template": { "template": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {
"url": "https://github.com/mvdan/sh/releases/download/v${version}/shfmt_v${version}_linux_amd64", "url": "https://github.com/mvdan/sh/releases/download/v${version}/shfmt_v${version}_linux_amd64"
"bin_dir": "/usr/local/bin"
}, },
"x86_64_macos": { "x86_64_macos": {
"url": "https://github.com/mvdan/sh/releases/download/v${version}/shfmt_v${version}_darwin_amd64", "url": "https://github.com/mvdan/sh/releases/download/v${version}/shfmt_v${version}_darwin_amd64"
"bin_dir": "/usr/local/bin"
}, },
"x86_64_windows": { "x86_64_windows": {
"url": "https://github.com/mvdan/sh/releases/download/v${version}/shfmt_v${version}_windows_amd64.exe", "url": "https://github.com/mvdan/sh/releases/download/v${version}/shfmt_v${version}_windows_amd64.exe"
"bin_dir": "/usr/local/bin"
}, },
"aarch64_linux_gnu": { "aarch64_linux_gnu": {
"url": "https://github.com/mvdan/sh/releases/download/v${version}/shfmt_v${version}_linux_arm64", "url": "https://github.com/mvdan/sh/releases/download/v${version}/shfmt_v${version}_linux_arm64"
"bin_dir": "/usr/local/bin"
}, },
"aarch64_macos": { "aarch64_macos": {
"url": "https://github.com/mvdan/sh/releases/download/v${version}/shfmt_v${version}_darwin_arm64", "url": "https://github.com/mvdan/sh/releases/download/v${version}/shfmt_v${version}_darwin_arm64"
"bin_dir": "/usr/local/bin"
} }
}, },
"latest": { "latest": {

6
manifests/syft.json generated
View File

@@ -1,28 +1,24 @@
{ {
"rust_crate": null,
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/anchore/syft/releases/download/v${version}/syft_${version}_linux_amd64.tar.gz", "url": "https://github.com/anchore/syft/releases/download/v${version}/syft_${version}_linux_amd64.tar.gz",
"bin_dir": "/usr/local/bin",
"bin": "syft" "bin": "syft"
}, },
"x86_64_macos": { "x86_64_macos": {
"url": "https://github.com/anchore/syft/releases/download/v${version}/syft_${version}_darwin_amd64.tar.gz", "url": "https://github.com/anchore/syft/releases/download/v${version}/syft_${version}_darwin_amd64.tar.gz",
"bin_dir": "/usr/local/bin",
"bin": "syft" "bin": "syft"
}, },
"x86_64_windows": { "x86_64_windows": {
"url": "https://github.com/anchore/syft/releases/download/v${version}/syft_${version}_windows_amd64.zip", "url": "https://github.com/anchore/syft/releases/download/v${version}/syft_${version}_windows_amd64.zip",
"bin_dir": "/usr/local/bin",
"bin": "syft.exe" "bin": "syft.exe"
}, },
"aarch64_linux_musl": { "aarch64_linux_musl": {
"url": "https://github.com/anchore/syft/releases/download/v${version}/syft_${version}_linux_arm64.tar.gz", "url": "https://github.com/anchore/syft/releases/download/v${version}/syft_${version}_linux_arm64.tar.gz",
"bin_dir": "/usr/local/bin",
"bin": "syft" "bin": "syft"
}, },
"aarch64_macos": { "aarch64_macos": {
"url": "https://github.com/anchore/syft/releases/download/v${version}/syft_${version}_darwin_arm64.tar.gz", "url": "https://github.com/anchore/syft/releases/download/v${version}/syft_${version}_darwin_arm64.tar.gz",
"bin_dir": "/usr/local/bin",
"bin": "syft" "bin": "syft"
} }
}, },

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "wasm-pack",
"template": { "template": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"url": "https://github.com/rustwasm/wasm-pack/releases/download/v${version}/wasm-pack-v${version}-x86_64-unknown-linux-musl.tar.gz", "url": "https://github.com/rustwasm/wasm-pack/releases/download/v${version}/wasm-pack-v${version}-x86_64-unknown-linux-musl.tar.gz",

View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "wasmtime-cli",
"template": null, "template": null,
"latest": { "latest": {
"version": "11.0.1" "version": "11.0.1"

1
manifests/zola.json generated
View File

@@ -1,4 +1,5 @@
{ {
"rust_crate": "zola",
"template": { "template": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {
"url": "https://github.com/getzola/zola/releases/download/v${version}/zola-v${version}-x86_64-unknown-linux-gnu.tar.gz" "url": "https://github.com/getzola/zola/releases/download/v${version}/zola-v${version}-x86_64-unknown-linux-gnu.tar.gz"

View File

@@ -7,7 +7,7 @@ publish = false
[dependencies] [dependencies]
anyhow = "1" anyhow = "1"
fs-err = "2" fs-err = "2"
semver = "1" semver = { version = "1", features = ["serde"] }
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"
sha2 = "0.10" sha2 = "0.10"

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/cargo-bins/cargo-binstall", "repository": "https://github.com/cargo-bins/cargo-binstall",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": "${package}-${rust_target}.tgz", "asset_name": "${package}-${rust_target}.tgz",
"version_range": "latest", "version_range": "latest",
"platform": { "platform": {

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/RalfJung/cargo-careful", "repository": "https://github.com/RalfJung/cargo-careful",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": "${package}.${rust_target}", "asset_name": "${package}.${rust_target}",
"platform": { "platform": {
"x86_64_linux_musl": {}, "x86_64_linux_musl": {},

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/EmbarkStudios/cargo-deny", "repository": "https://github.com/EmbarkStudios/cargo-deny",
"tag_prefix": "", "tag_prefix": "",
"rust_crate": "${package}",
"asset_name": "${package}-${version}-${rust_target}.tar.gz", "asset_name": "${package}-${version}-${rust_target}.tar.gz",
"bin": "${package}-${version}-${rust_target}/${package}${exe}", "bin": "${package}-${version}-${rust_target}/${package}${exe}",
"platform": { "platform": {

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/sonos/dinghy", "repository": "https://github.com/sonos/dinghy",
"tag_prefix": "", "tag_prefix": "",
"rust_crate": "${package}",
"asset_name": "${package}-${os_name}-${version}.tgz", "asset_name": "${package}-${os_name}-${version}.tgz",
"bin": "${package}-${version}/${package}${exe}", "bin": "${package}-${version}/${package}${exe}",
"platform": { "platform": {

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/taiki-e/cargo-hack", "repository": "https://github.com/taiki-e/cargo-hack",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": [ "asset_name": [
"${package}-${rust_target}.tar.gz", "${package}-${rust_target}.tar.gz",
"${package}-v${version}-${rust_target}.tar.gz" "${package}-v${version}-${rust_target}.tar.gz"

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/taiki-e/cargo-llvm-cov", "repository": "https://github.com/taiki-e/cargo-llvm-cov",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": "${package}-${rust_target}.tar.gz", "asset_name": "${package}-${rust_target}.tar.gz",
"platform": { "platform": {
"x86_64_linux_musl": {}, "x86_64_linux_musl": {},

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/sagiegurari/cargo-make", "repository": "https://github.com/sagiegurari/cargo-make",
"tag_prefix": "", "tag_prefix": "",
"rust_crate": "${package}",
"asset_name": "${package}-v${version}-${rust_target}.zip", "asset_name": "${package}-v${version}-${rust_target}.zip",
"bin": "${package}-v${version}-${rust_target}/${package}${exe}", "bin": "${package}-v${version}-${rust_target}/${package}${exe}",
"platform": { "platform": {

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/taiki-e/cargo-minimal-versions", "repository": "https://github.com/taiki-e/cargo-minimal-versions",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": "${package}-${rust_target}.tar.gz", "asset_name": "${package}-${rust_target}.tar.gz",
"platform": { "platform": {
"x86_64_linux_musl": {}, "x86_64_linux_musl": {},

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/nextest-rs/nextest", "repository": "https://github.com/nextest-rs/nextest",
"tag_prefix": "cargo-nextest-", "tag_prefix": "cargo-nextest-",
"rust_crate": "${package}",
"asset_name": "${package}-${version}-${rust_target}.tar.gz", "asset_name": "${package}-${version}-${rust_target}.tar.gz",
"platform": { "platform": {
"x86_64_linux_gnu": {}, "x86_64_linux_gnu": {},

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/taiki-e/cargo-no-dev-deps", "repository": "https://github.com/taiki-e/cargo-no-dev-deps",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": "${package}-${rust_target}.tar.gz", "asset_name": "${package}-${rust_target}.tar.gz",
"platform": { "platform": {
"x86_64_linux_musl": {}, "x86_64_linux_musl": {},

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/xd009642/tarpaulin", "repository": "https://github.com/xd009642/tarpaulin",
"tag_prefix": "", "tag_prefix": "",
"rust_crate": "${package}",
"asset_name": "${package}-${rust_target}.tar.gz", "asset_name": "${package}-${rust_target}.tar.gz",
"version_range": "> 0.22.0", "version_range": "> 0.22.0",
"platform": { "platform": {

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/est31/cargo-udeps", "repository": "https://github.com/est31/cargo-udeps",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": "${package}-v${version}-${rust_target}.tar.gz", "asset_name": "${package}-v${version}-${rust_target}.tar.gz",
"bin": "./${package}-v${version}-${rust_target}/${package}${exe}", "bin": "./${package}-v${version}-${rust_target}/${package}${exe}",
"platform": { "platform": {

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/jfrimmel/cargo-valgrind", "repository": "https://github.com/jfrimmel/cargo-valgrind",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": "${package}-${version}-${rust_target}.tar.gz", "asset_name": "${package}-${version}-${rust_target}.tar.gz",
"platform": { "platform": {
"x86_64_linux_musl": {}, "x86_64_linux_musl": {},

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/cross-rs/cross", "repository": "https://github.com/cross-rs/cross",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": [ "asset_name": [
"${package}-${rust_target}.tar.gz", "${package}-${rust_target}.tar.gz",
"${package}-v${version}-${rust_target}.tar.gz" "${package}-v${version}-${rust_target}.tar.gz"

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/dprint/dprint", "repository": "https://github.com/dprint/dprint",
"tag_prefix": "", "tag_prefix": "",
"rust_crate": "${package}",
"asset_name": "${package}-${rust_target}.zip", "asset_name": "${package}-${rust_target}.zip",
"platform": { "platform": {
"x86_64_linux_gnu": {}, "x86_64_linux_gnu": {},

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/mozilla/grcov", "repository": "https://github.com/mozilla/grcov",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": "${package}-${rust_target}.tar.bz2", "asset_name": "${package}-${rust_target}.tar.bz2",
"version_range": ">= 0.8.7", "version_range": ">= 0.8.7",
"platform": { "platform": {

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/casey/just", "repository": "https://github.com/casey/just",
"tag_prefix": "", "tag_prefix": "",
"rust_crate": "${package}",
"asset_name": "${package}-${version}-${rust_target}.tar.gz", "asset_name": "${package}-${version}-${rust_target}.tar.gz",
"platform": { "platform": {
"x86_64_linux_musl": {}, "x86_64_linux_musl": {},

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/Michael-F-Bryan/mdbook-linkcheck", "repository": "https://github.com/Michael-F-Bryan/mdbook-linkcheck",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": "${package}.${rust_target}.zip", "asset_name": "${package}.${rust_target}.zip",
"platform": { "platform": {
"x86_64_linux_gnu": {}, "x86_64_linux_gnu": {},

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/rust-lang/mdBook", "repository": "https://github.com/rust-lang/mdBook",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": "${package}-v${version}-${rust_target}.tar.gz", "asset_name": "${package}-v${version}-${rust_target}.tar.gz",
"platform": { "platform": {
"x86_64_linux_musl": {}, "x86_64_linux_musl": {},

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/taiki-e/parse-changelog", "repository": "https://github.com/taiki-e/parse-changelog",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": "${package}-${rust_target}.tar.gz", "asset_name": "${package}-${rust_target}.tar.gz",
"platform": { "platform": {
"x86_64_linux_gnu": {}, "x86_64_linux_gnu": {},

View File

@@ -1,7 +1,6 @@
{ {
"repository": "https://github.com/koalaman/shellcheck", "repository": "https://github.com/koalaman/shellcheck",
"tag_prefix": "v", "tag_prefix": "v",
"bin_dir": "/usr/local/bin",
"bin": "${package}-v${version}/${package}${exe}", "bin": "${package}-v${version}/${package}${exe}",
"platform": { "platform": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {

View File

@@ -1,7 +1,6 @@
{ {
"repository": "https://github.com/mvdan/sh", "repository": "https://github.com/mvdan/sh",
"tag_prefix": "v", "tag_prefix": "v",
"bin_dir": "/usr/local/bin",
"platform": { "platform": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {
"asset_name": "${package}_v${version}_linux_amd64" "asset_name": "${package}_v${version}_linux_amd64"

View File

@@ -1,7 +1,6 @@
{ {
"repository": "https://github.com/anchore/syft", "repository": "https://github.com/anchore/syft",
"tag_prefix": "v", "tag_prefix": "v",
"bin_dir": "/usr/local/bin",
"bin": "${package}${exe}", "bin": "${package}${exe}",
"version_range": ">= 0.83.0", "version_range": ">= 0.83.0",
"platform": { "platform": {

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/rustwasm/wasm-pack", "repository": "https://github.com/rustwasm/wasm-pack",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": "${package}-v${version}-${rust_target}.tar.gz", "asset_name": "${package}-v${version}-${rust_target}.tar.gz",
"bin": "${package}-v${version}-${rust_target}/${package}${exe}", "bin": "${package}-v${version}-${rust_target}/${package}${exe}",
"platform": { "platform": {

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/bytecodealliance/wasmtime", "repository": "https://github.com/bytecodealliance/wasmtime",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "wasmtime-cli",
"platform": { "platform": {
"x86_64_linux_gnu": { "x86_64_linux_gnu": {
"asset_name": "${package}-v${version}-x86_64-linux.tar.xz", "asset_name": "${package}-v${version}-x86_64-linux.tar.xz",

View File

@@ -1,6 +1,7 @@
{ {
"repository": "https://github.com/getzola/zola", "repository": "https://github.com/getzola/zola",
"tag_prefix": "v", "tag_prefix": "v",
"rust_crate": "${package}",
"asset_name": "${package}-v${version}-${rust_target}.tar.gz", "asset_name": "${package}-v${version}-${rust_target}.tar.gz",
"platform": { "platform": {
"x86_64_linux_gnu": {}, "x86_64_linux_gnu": {},

View File

@@ -31,7 +31,7 @@ fn main() -> Result<()> {
fs::create_dir_all(manifest_path.parent().unwrap())?; fs::create_dir_all(manifest_path.parent().unwrap())?;
fs::create_dir_all(download_cache_dir)?; fs::create_dir_all(download_cache_dir)?;
let base_info: BaseManifest = serde_json::from_slice(&fs::read( let mut base_info: BaseManifest = serde_json::from_slice(&fs::read(
workspace_root workspace_root
.join("tools/codegen/base") .join("tools/codegen/base")
.join(format!("{package}.json")), .join(format!("{package}.json")),
@@ -74,6 +74,20 @@ fn main() -> Result<()> {
}) })
.collect(); .collect();
let mut crates_io_info = None;
base_info.rust_crate = base_info
.rust_crate
.as_ref()
.map(|s| replace_vars(s, package, None, None))
.transpose()?;
if let Some(crate_name) = &base_info.rust_crate {
eprintln!("downloading crate info from https://crates.io/api/v1/crates/{crate_name}");
crates_io_info = Some(
download(&format!("https://crates.io/api/v1/crates/{crate_name}"))?
.into_json::<crates_io::Crate>()?,
);
}
let mut manifests: Manifests = Manifests::default(); let mut manifests: Manifests = Manifests::default();
let mut semver_versions = BTreeSet::new(); let mut semver_versions = BTreeSet::new();
let mut has_build_metadata = false; let mut has_build_metadata = false;
@@ -97,10 +111,6 @@ fn main() -> Result<()> {
for (platform, d) in &mut manifest.download_info { for (platform, d) in &mut manifest.download_info {
let template = &template.download_info[platform]; let template = &template.download_info[platform];
d.url = Some(template.url.replace("${version}", version)); d.url = Some(template.url.replace("${version}", version));
d.bin_dir = template
.bin_dir
.as_ref()
.map(|s| s.replace("${version}", version));
d.bin = template d.bin = template
.bin .bin
.as_ref() .as_ref()
@@ -177,7 +187,7 @@ fn main() -> Result<()> {
.with_context(|| format!("asset_name is needed for {package} on {platform:?}"))? .with_context(|| format!("asset_name is needed for {package} on {platform:?}"))?
.as_slice() .as_slice()
.iter() .iter()
.map(|asset_name| replace_vars(asset_name, package, version, platform)) .map(|asset_name| replace_vars(asset_name, package, Some(version), Some(platform)))
.collect::<Result<Vec<_>>>()?; .collect::<Result<Vec<_>>>()?;
let (url, asset_name) = match asset_names.iter().find_map(|asset_name| { let (url, asset_name) = match asset_names.iter().find_map(|asset_name| {
release release
@@ -218,16 +228,11 @@ fn main() -> Result<()> {
ManifestDownloadInfo { ManifestDownloadInfo {
url: Some(url), url: Some(url),
checksum: hash, checksum: hash,
bin_dir: base_download_info
.bin_dir
.as_ref()
.or(base_info.bin_dir.as_ref())
.cloned(),
bin: base_download_info bin: base_download_info
.bin .bin
.as_ref() .as_ref()
.or(base_info.bin.as_ref()) .or(base_info.bin.as_ref())
.map(|s| replace_vars(s, package, version, platform)) .map(|s| replace_vars(s, package, Some(version), Some(platform)))
.transpose()?, .transpose()?,
}, },
); );
@@ -250,6 +255,14 @@ fn main() -> Result<()> {
download_info.remove(&HostPlatform::aarch64_linux_gnu); download_info.remove(&HostPlatform::aarch64_linux_gnu);
} }
} }
if download_info.contains_key(&HostPlatform::x86_64_macos)
&& download_info.contains_key(&HostPlatform::aarch64_macos)
&& download_info[&HostPlatform::x86_64_macos].url
== download_info[&HostPlatform::aarch64_macos].url
{
// macOS universal binary or x86_64 binary that works on both x86_64 and aarch64 (rosetta).
download_info.remove(&HostPlatform::aarch64_macos);
}
has_build_metadata |= !semver_version.build.is_empty(); has_build_metadata |= !semver_version.build.is_empty();
if semver_version.pre.is_empty() { if semver_version.pre.is_empty() {
semver_versions.insert(semver_version.clone()); semver_versions.insert(semver_version.clone());
@@ -266,6 +279,13 @@ fn main() -> Result<()> {
} else if !semver_versions.is_empty() { } else if !semver_versions.is_empty() {
let mut prev_version = semver_versions.iter().next().unwrap(); let mut prev_version = semver_versions.iter().next().unwrap();
for version in &semver_versions { for version in &semver_versions {
if let Some(crates_io_info) = &crates_io_info {
if let Some(v) = crates_io_info.versions.iter().find(|v| v.num == *version) {
if v.yanked {
continue;
}
}
}
if !(version.major == 0 && version.minor == 0) { if !(version.major == 0 && version.minor == 0) {
manifests.map.insert( manifests.map.insert(
Reverse(Version::omitted(version.major, Some(version.minor))), Reverse(Version::omitted(version.major, Some(version.minor))),
@@ -345,10 +365,9 @@ fn main() -> Result<()> {
let t = template.as_mut().unwrap(); let t = template.as_mut().unwrap();
for (platform, d) in &mut manifest.download_info { for (platform, d) in &mut manifest.download_info {
let template_url = d.url.take().unwrap().replace(version, "${version}"); let template_url = d.url.take().unwrap().replace(version, "${version}");
let template_bin_dir = d.bin_dir.take().map(|s| s.replace(version, "${version}"));
let template_bin = d.bin.take().map(|s| s.replace(version, "${version}")); let template_bin = d.bin.take().map(|s| s.replace(version, "${version}"));
if let Some(d) = t.download_info.get(platform) { if let Some(d) = t.download_info.get(platform) {
if template_url != d.url || template_bin_dir != d.bin_dir || template_bin != d.bin { if template_url != d.url || template_bin != d.bin {
template = None; template = None;
break 'outer; break 'outer;
} }
@@ -357,7 +376,6 @@ fn main() -> Result<()> {
*platform, *platform,
ManifestTemplateDownloadInfo { ManifestTemplateDownloadInfo {
url: template_url, url: template_url,
bin_dir: template_bin_dir,
bin: template_bin, bin: template_bin,
}, },
); );
@@ -370,6 +388,8 @@ fn main() -> Result<()> {
manifests.template = template; manifests.template = template;
} }
manifests.rust_crate = base_info.rust_crate;
let mut buf = serde_json::to_vec_pretty(&manifests)?; let mut buf = serde_json::to_vec_pretty(&manifests)?;
buf.push(b'\n'); buf.push(b'\n');
fs::write(manifest_path, buf)?; fs::write(manifest_path, buf)?;
@@ -384,14 +404,22 @@ fn workspace_root() -> PathBuf {
dir dir
} }
fn replace_vars(s: &str, package: &str, version: &str, platform: HostPlatform) -> Result<String> { fn replace_vars(
let s = s s: &str,
.replace("${package}", package) package: &str,
.replace("${tool}", package) version: Option<&str>,
.replace("${rust_target}", platform.rust_target()) platform: Option<HostPlatform>,
.replace("${os_name}", platform.os_name()) ) -> Result<String> {
.replace("${version}", version) let mut s = s.replace("${package}", package).replace("${tool}", package);
.replace("${exe}", platform.exe_suffix()); if let Some(platform) = platform {
s = s
.replace("${rust_target}", platform.rust_target())
.replace("${os_name}", platform.os_name())
.replace("${exe}", platform.exe_suffix());
}
if let Some(version) = version {
s = s.replace("${version}", version);
}
if s.contains('$') { if s.contains('$') {
bail!("variable not fully replaced: '{s}'"); bail!("variable not fully replaced: '{s}'");
} }
@@ -563,6 +591,7 @@ impl<'de> Deserialize<'de> for Version {
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[derive(Debug, Clone, Default, Serialize, Deserialize)]
struct Manifests { struct Manifests {
rust_crate: Option<String>,
template: Option<ManifestTemplate>, template: Option<ManifestTemplate>,
#[serde(flatten)] #[serde(flatten)]
map: BTreeMap<Reverse<Version>, ManifestRef>, map: BTreeMap<Reverse<Version>, ManifestRef>,
@@ -586,9 +615,6 @@ struct ManifestDownloadInfo {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
url: Option<String>, url: Option<String>,
checksum: String, checksum: String,
/// Default to ${cargo_bin}
#[serde(skip_serializing_if = "Option::is_none")]
bin_dir: Option<String>,
/// Default to ${tool}${exe} /// Default to ${tool}${exe}
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
bin: Option<String>, bin: Option<String>,
@@ -603,9 +629,6 @@ struct ManifestTemplate {
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
struct ManifestTemplateDownloadInfo { struct ManifestTemplateDownloadInfo {
url: String, url: String,
/// Default to ${cargo_bin}
#[serde(skip_serializing_if = "Option::is_none")]
bin_dir: Option<String>,
/// Default to ${tool}${exe} /// Default to ${tool}${exe}
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
bin: Option<String>, bin: Option<String>,
@@ -618,11 +641,11 @@ struct BaseManifest {
repository: String, repository: String,
/// Prefix of release tag. /// Prefix of release tag.
tag_prefix: String, tag_prefix: String,
/// Crate name, if this is Rust crate.
rust_crate: Option<String>,
default_major_version: Option<String>, default_major_version: Option<String>,
/// Asset name patterns. /// Asset name patterns.
asset_name: Option<StringOrArray>, asset_name: Option<StringOrArray>,
/// Directory where binary is installed. Default to `${cargo_bin}`.
bin_dir: Option<String>,
/// Path to binary in archive. Default to `${tool}${exe}`. /// Path to binary in archive. Default to `${tool}${exe}`.
bin: Option<String>, bin: Option<String>,
platform: BTreeMap<HostPlatform, BaseManifestPlatformInfo>, platform: BTreeMap<HostPlatform, BaseManifestPlatformInfo>,
@@ -637,8 +660,6 @@ struct BaseManifest {
struct BaseManifestPlatformInfo { struct BaseManifestPlatformInfo {
/// Asset name patterns. Default to the value at `BaseManifest::asset_name`. /// Asset name patterns. Default to the value at `BaseManifest::asset_name`.
asset_name: Option<StringOrArray>, asset_name: Option<StringOrArray>,
/// Directory where binary is installed. Default to the value at `BaseManifest::bin_dir`.
bin_dir: Option<String>,
/// Path to binary in archive. Default to the value at `BaseManifest::bin`. /// Path to binary in archive. Default to the value at `BaseManifest::bin`.
bin: Option<String>, bin: Option<String>,
} }
@@ -741,3 +762,19 @@ mod github {
pub browser_download_url: String, pub browser_download_url: String,
} }
} }
mod crates_io {
use serde::Deserialize;
// https://crates.io/api/v1/crates/<crate>
#[derive(Debug, Deserialize)]
pub struct Crate {
pub versions: Vec<Version>,
}
#[derive(Debug, Deserialize)]
pub struct Version {
pub num: semver::Version,
pub yanked: bool,
}
}