mirror of
https://github.com/LowderPlay/cheburcheck.git
synced 2026-10-09 06:59:50 +03:00
feat: update Docker build for armv7 and refactor architecture detection (#103)
This commit is contained in:
@@ -169,7 +169,7 @@ jobs:
|
||||
|
||||
docker:
|
||||
needs: validate
|
||||
name: Docker image amd64/arm64
|
||||
name: Docker image amd64/arm64/armv7
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -242,7 +242,7 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
file: ./probe/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
+11
-5
@@ -227,11 +227,7 @@ fn detect_platform() -> Result<(PackageKind, String, bool)> {
|
||||
.any(|line| line.split_whitespace().next() == Some("luci-app-cheburprobe"));
|
||||
Ok((PackageKind::Opkg, architecture.to_owned(), luci_installed))
|
||||
} else {
|
||||
let architecture = match env::consts::ARCH {
|
||||
"x86_64" => "amd64",
|
||||
"aarch64" => "arm64",
|
||||
architecture => bail!("unsupported standalone Linux architecture: {architecture}"),
|
||||
};
|
||||
let architecture = standalone_linux_architecture(env::consts::ARCH)?;
|
||||
Ok((PackageKind::Linux, architecture.to_owned(), false))
|
||||
}
|
||||
|
||||
@@ -239,6 +235,16 @@ fn detect_platform() -> Result<(PackageKind, String, bool)> {
|
||||
bail!("updates are not supported on this operating system")
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
fn standalone_linux_architecture(architecture: &str) -> Result<&'static str> {
|
||||
match architecture {
|
||||
"x86_64" => Ok("amd64"),
|
||||
"aarch64" => Ok("arm64"),
|
||||
"arm" => Ok("armv7"),
|
||||
architecture => bail!("unsupported standalone Linux architecture: {architecture}"),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
fn openwrt_apk_arch() -> Result<String> {
|
||||
if let Ok(architecture) = std::fs::read_to_string("/etc/apk/arch") {
|
||||
|
||||
Reference in New Issue
Block a user