Resolve ARM variant in the value of the environment variable
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Elara 2022-11-20 13:57:59 -08:00
parent da7830d0e3
commit 24c807a941
1 changed files with 7 additions and 1 deletions

View File

@ -462,6 +462,12 @@ func buildPackage(ctx context.Context, script string, mgr manager.Manager) ([]st
func genBuildEnv(info *distro.OSRelease) []string {
env := os.Environ()
arch := runtime.GOARCH
if arch == "arm" {
arch = cpu.ARMVariant()
}
env = append(
env,
"DISTRO_NAME="+info.Name,
@ -469,7 +475,7 @@ func genBuildEnv(info *distro.OSRelease) []string {
"DISTRO_ID="+info.ID,
"DISTRO_VERSION_ID="+info.VersionID,
"ARCH="+runtime.GOARCH,
"ARCH="+arch,
"NCPU="+strconv.Itoa(runtime.NumCPU()),
)