Add cyclonedx (#1000)

Also improve check that gnu binaries are not needed if musl exists.
This commit is contained in:
John Vandenberg
2025-06-19 19:55:47 +08:00
committed by GitHub
parent 5b3d0ef321
commit 7afdc6d42b
15 changed files with 106 additions and 15 deletions

View File

@@ -13,6 +13,7 @@ espup
fastestmirror
grcov
knope
libicu
linkcheck
mdbook
microdnf

View File

@@ -38,6 +38,7 @@ See the [Supported tools section in README.md](README.md#supported-tools) for ho
| [**cargo-valgrind**](https://github.com/jfrimmel/cargo-valgrind) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/jfrimmel/cargo-valgrind/releases) | Linux, macOS, Windows | [MIT](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-APACHE) |
| [**cargo-zigbuild**](https://github.com/rust-cross/cargo-zigbuild) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rust-cross/cargo-zigbuild/releases) | Linux, macOS, Windows | [MIT](https://github.com/rust-cross/cargo-zigbuild/blob/main/LICENSE) |
| [**cross**](https://github.com/cross-rs/cross) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/cross-rs/cross/releases) | Linux, macOS, Windows | [MIT](https://github.com/cross-rs/cross/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/cross-rs/cross/blob/main/LICENSE-APACHE) |
| [**cyclonedx**](https://github.com/CycloneDX/cyclonedx-cli) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/CycloneDX/cyclonedx-cli/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/CycloneDX/cyclonedx-cli/blob/main/LICENSE) |
| [**deepsource**](https://github.com/DeepSourceCorp/cli) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/DeepSourceCorp/cli/releases) | Linux, macOS, Windows | [BSD-2-Clause](https://github.com/DeepSourceCorp/cli/blob/master/LICENSE) |
| [**dprint**](https://github.com/dprint/dprint) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/dprint/dprint/releases) | Linux, macOS, Windows | [MIT](https://github.com/dprint/dprint/blob/main/LICENSE) |
| [**earthly**](https://github.com/earthly/earthly) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/earthly/earthly/releases) | Linux, macOS, Windows | [MPL-2.0](https://github.com/earthly/earthly/blob/main/LICENSE) |

View File

@@ -776,6 +776,13 @@ for tool in "${tools[@]}"; do
;;
esac
;;
cyclonedx)
case "${host_os}" in
linux)
apt_install libicu-dev
;;
esac
;;
esac
download_from_download_info "${tool}" "${version}"

56
manifests/cyclonedx.json generated Normal file
View File

@@ -0,0 +1,56 @@
{
"rust_crate": null,
"template": {
"x86_64_linux_gnu": {
"url": "https://github.com/CycloneDX/cyclonedx-cli/releases/download/v${version}/cyclonedx-linux-x64"
},
"x86_64_macos": {
"url": "https://github.com/CycloneDX/cyclonedx-cli/releases/download/v${version}/cyclonedx-osx-x64"
},
"x86_64_windows": {
"url": "https://github.com/CycloneDX/cyclonedx-cli/releases/download/v${version}/cyclonedx-win-x64.exe"
},
"aarch64_linux_gnu": {
"url": "https://github.com/CycloneDX/cyclonedx-cli/releases/download/v${version}/cyclonedx-linux-arm64"
},
"aarch64_macos": {
"url": "https://github.com/CycloneDX/cyclonedx-cli/releases/download/v${version}/cyclonedx-osx-arm64"
},
"aarch64_windows": {
"url": "https://github.com/CycloneDX/cyclonedx-cli/releases/download/v${version}/cyclonedx-win-arm64.exe"
}
},
"license_markdown": "[Apache-2.0](https://github.com/CycloneDX/cyclonedx-cli/blob/main/LICENSE)",
"latest": {
"version": "0.27.2"
},
"0.27": {
"version": "0.27.2"
},
"0.27.2": {
"x86_64_linux_gnu": {
"etag": "0x8DD0C1D089A2E0C",
"checksum": "5e1595542a6367378a3944bbd3008caab3de65d572345361d3b9597b1dbbaaa0"
},
"x86_64_macos": {
"etag": "0x8DD0C1D112585AB",
"checksum": "331c2245ef7dadf09fa3d2710a2aaab071ff6bea2ba3e5df8f95a4f3f6e825e9"
},
"x86_64_windows": {
"etag": "0x8DD0C1D0CEB17DF",
"checksum": "bb26bb56293ebe6f08fa63d2bf50653fc6b180174fded975c81ac96ac192a7db"
},
"aarch64_linux_gnu": {
"etag": "0x8DD0C1D0BAFB51E",
"checksum": "5b4181f6fd4d8fbe54e55c1b3983d9af66ce2910a263814b290cbd5e351e68a4"
},
"aarch64_macos": {
"etag": "0x8DD0C1D488DD343",
"checksum": "2d24c331c2ccc5e4061722bd4780c8b295041b2569d130bbe80cf7da95b97171"
},
"aarch64_windows": {
"etag": "0x8DD0C1D10099579",
"checksum": "35762d3e1979576f474ffc1c5b2273e19c33cdca44e5f1994c3de5d9cd0e9c1d"
}
}
}

View File

@@ -108,6 +108,9 @@ case "$(uname -s)" in
if ! type -P snap >/dev/null; then
incompat_tools+=(valgrind)
fi
if ! type -P apt-get >/dev/null; then
incompat_tools+=(cyclonedx)
fi
;;
Darwin) host_os=macos ;;
MINGW* | MSYS* | CYGWIN* | Windows_NT) host_os=windows ;;

View File

@@ -5,9 +5,6 @@
"tag_prefix": "cli/v",
"bin": "${package}${exe}",
"platform": {
"x86_64_linux_gnu": {
"asset_name": "${package}-linux-x64"
},
"x86_64_linux_musl": {
"asset_name": "${package}-linux-x64-musl"
},
@@ -17,9 +14,6 @@
"x86_64_windows": {
"asset_name": "${package}-win32-x64${exe}"
},
"aarch64_linux_gnu": {
"asset_name": "${package}-linux-arm64"
},
"aarch64_linux_musl": {
"asset_name": "${package}-linux-arm64-musl"
},

View File

@@ -5,9 +5,6 @@
"bin": "${package}-${rust_target}/${package}${exe}",
"version_range": ">= 0.5.0",
"platform": {
"x86_64_linux_gnu": {
"asset_name": "${package}-linux-amd64.tar.gz"
},
"x86_64_linux_musl": {
"asset_name": "${package}-${rust_target}.tar.xz"
},

View File

@@ -9,7 +9,6 @@
"${package}-v${version}-${rust_target}.zip"
],
"platform": {
"x86_64_linux_gnu": {},
"x86_64_linux_musl": {},
"x86_64_macos": {},
"x86_64_windows": {},

View File

@@ -6,7 +6,6 @@
"asset_name": "${package}-v${version}-${rust_target}.tar.gz",
"bin": "./${package}-v${version}-${rust_target}/${package}${exe}",
"platform": {
"x86_64_linux_gnu": {},
"x86_64_linux_musl": {},
"x86_64_macos": {},
"x86_64_windows": {

View File

@@ -0,0 +1,25 @@
{
"repository": "https://github.com/CycloneDX/cyclonedx-cli",
"tag_prefix": "v",
"version_range": ">= 0.27.2",
"platform": {
"x86_64_linux_gnu": {
"asset_name": "${package}-linux-x64"
},
"x86_64_macos": {
"asset_name": "${package}-osx-x64"
},
"x86_64_windows": {
"asset_name": "${package}-win-x64${exe}"
},
"aarch64_linux_gnu": {
"asset_name": "${package}-linux-arm64"
},
"aarch64_macos": {
"asset_name": "${package}-osx-arm64"
},
"aarch64_windows": {
"asset_name": "${package}-win-arm64${exe}"
}
}
}

View File

@@ -4,7 +4,6 @@
"rust_crate": "${package}",
"asset_name": "${package}-${rust_target}.zip",
"platform": {
"x86_64_linux_gnu": {},
"x86_64_linux_musl": {},
"x86_64_macos": {},
"x86_64_windows": {},

View File

@@ -6,7 +6,6 @@
"version_range": ">= 0.1.0",
"platform": {
"x86_64_linux_musl": {},
"x86_64_linux_gnu": {},
"x86_64_macos": {},
"x86_64_windows": {
"asset_name": "${package}-v${version}-${rust_target}.zip"

View File

@@ -7,7 +7,6 @@
"${package}-${rust_target}.zip"
],
"platform": {
"x86_64_linux_gnu": {},
"x86_64_linux_musl": {},
"x86_64_macos": {},
"x86_64_windows": {},

View File

@@ -562,7 +562,6 @@ fn main() -> Result<()> {
.values()
.any(|m| matches!(m, ManifestRef::Real(m) if m.download_info.contains_key(&p)))
{
// TODO: better error message: https://github.com/taiki-e/install-action/pull/411
bail!(
"platform list in base manifest for {package} contains {p:?}, \
but result manifest doesn't contain it; \

View File

@@ -282,6 +282,19 @@ impl BaseManifest {
}
}
}
if self.platform.is_empty() {
panic!("At least one platform must be specified");
}
if !self.prefer_linux_gnu
&& (self.platform.contains_key(&HostPlatform::x86_64_linux_gnu)
&& self.platform.contains_key(&HostPlatform::x86_64_linux_musl))
&& (self.platform.contains_key(&HostPlatform::aarch64_linux_gnu)
&& self.platform.contains_key(&HostPlatform::aarch64_linux_musl))
{
panic!(
"When *-linux-musl platform is specified, *-linux-gnu for the same architecture will never be used and should not be specified"
);
}
}
}