feat: basic support riscv64 (#8369)

* feat: add riscv64

* feat: correct arch related codes
This commit is contained in:
chiichen 2025-04-17 10:24:04 +08:00 committed by GitHub
parent 91675c69e9
commit 83ef41cf1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 2 deletions

View file

@ -10,7 +10,7 @@ before:
- ./ci/script.sh
- sed -i 's@ORIGINAL_VERSION=.*@ORIGINAL_VERSION=v{{ .Version }}@g' 1pctl
- go mod tidy
builds:
- main: ./cmd/server/main.go
binary: 1panel
@ -31,6 +31,7 @@ builds:
- arm
- ppc64le
- s390x
- riscv64
archives:
- formats: [ 'tar.gz' ]

View file

@ -503,7 +503,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

@ -357,5 +357,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)
}