feat: support riscv64 (#9925)

* feat: add riscv64

* feat: correct arch related codes
This commit is contained in:
chiichen 2025-08-09 18:00:56 +08:00 committed by GitHub
parent 2be7054b40
commit 1759c2c81e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 1 deletions

View file

@ -32,6 +32,7 @@ builds:
- arm
- ppc64le
- s390x
- riscv64
hooks:
post:
- ./ci/script.sh compress_binary {{ .Path }} {{ .Arch }}
@ -57,6 +58,7 @@ builds:
- arm
- ppc64le
- s390x
- riscv64
hooks:
post:
- ./ci/script.sh compress_binary {{ .Path }} {{ .Arch }}

View file

@ -169,7 +169,8 @@ func hasOs(name string) bool {
strings.Contains(name, "arm64") ||
strings.Contains(name, "armv7") ||
strings.Contains(name, "ppc64le") ||
strings.Contains(name, "s390x")
strings.Contains(name, "s390x") ||
strings.Contains(name, "riscv64")
}
func loadOs() string {

View file

@ -403,5 +403,8 @@ func loadArch() (string, error) {
if strings.Contains(std, "s390x") {
return "s390x", nil
}
if strings.Contains(std, "riscv64") {
return "riscv64", nil
}
return "", fmt.Errorf("unsupported such arch: %s", std)
}

View file

@ -150,6 +150,9 @@ func LoadArchWithStdout(std string) (string, error) {
if strings.Contains(std, "s390x") {
return "s390x", nil
}
if strings.Contains(std, "riscv64") {
return "riscv64", nil
}
return "", fmt.Errorf("unsupported such arch: %s", std)
}