mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-23 06:38:52 +01:00
Add support for arm7 for #63 to support raspberry pis
This commit is contained in:
parent
f2298def32
commit
27cd544524
15
.github/slsa/.slsa-goreleaser-linux-arm7.yml
vendored
Normal file
15
.github/slsa/.slsa-goreleaser-linux-arm7.yml
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
version: 1
|
||||
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
|
||||
flags:
|
||||
- -trimpath
|
||||
|
||||
goos: linux
|
||||
goarch: arm
|
||||
|
||||
binary: hishtory-{{ .Os }}-{{ .Arch }}
|
||||
|
||||
ldflags:
|
||||
- '{{ .Env.VERSION_LDFLAGS }}'
|
12
.github/workflows/slsa-releaser.yml
vendored
12
.github/workflows/slsa-releaser.yml
vendored
@ -47,6 +47,18 @@ jobs:
|
||||
go-version: 1.18
|
||||
evaluated-envs: "VERSION_LDFLAGS:${{needs.args.outputs.ldflags}}"
|
||||
compile-builder: true # See github.com/slsa-framework/slsa-github-generator/issues/942
|
||||
build-linux-arm7:
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
actions: read
|
||||
needs: args
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@v1.2.1
|
||||
with:
|
||||
config-file: .github/slsa/.slsa-goreleaser-linux-arm7.yml
|
||||
go-version: 1.18
|
||||
evaluated-envs: "VERSION_LDFLAGS:${{needs.args.outputs.ldflags}}"
|
||||
compile-builder: true # See github.com/slsa-framework/slsa-github-generator/issues/942
|
||||
build-freebsd-amd64:
|
||||
permissions:
|
||||
id-token: write
|
||||
|
@ -648,6 +648,7 @@ func decrementVersionIfInvalid(initialVersion string) string {
|
||||
|
||||
func assertValidUpdate(updateInfo shared.UpdateInfo) error {
|
||||
urls := []string{updateInfo.LinuxAmd64Url, updateInfo.LinuxAmd64AttestationUrl, updateInfo.LinuxArm64Url, updateInfo.LinuxArm64AttestationUrl,
|
||||
updateInfo.LinuxArm7Url, updateInfo.LinuxArm7AttestationUrl,
|
||||
updateInfo.DarwinAmd64Url, updateInfo.DarwinAmd64UnsignedUrl, updateInfo.DarwinAmd64AttestationUrl,
|
||||
updateInfo.DarwinArm64Url, updateInfo.DarwinArm64UnsignedUrl, updateInfo.DarwinArm64AttestationUrl}
|
||||
for _, url := range urls {
|
||||
@ -706,6 +707,8 @@ func buildUpdateInfo(version string) shared.UpdateInfo {
|
||||
LinuxAmd64AttestationUrl: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-linux-amd64.intoto.jsonl", version),
|
||||
LinuxArm64Url: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-linux-arm64", version),
|
||||
LinuxArm64AttestationUrl: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-linux-arm64.intoto.jsonl", version),
|
||||
LinuxArm7Url: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-linux-arm7", version),
|
||||
LinuxArm7AttestationUrl: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-linux-arm7.intoto.jsonl", version),
|
||||
DarwinAmd64Url: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-darwin-amd64", version),
|
||||
DarwinAmd64UnsignedUrl: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-darwin-amd64-unsigned", version),
|
||||
DarwinAmd64AttestationUrl: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-darwin-amd64.intoto.jsonl", version),
|
||||
|
@ -18,6 +18,8 @@ if platform.system() == 'Linux' and platform.machine() == "x86_64":
|
||||
download_url = download_options['linux_amd_64_url']
|
||||
elif platform.system() == 'Linux' and platform.machine() == "aarch64":
|
||||
download_url = download_options['linux_arm_64_url']
|
||||
elif platform.system() == 'Linux' and platform.machine() == "armv7l":
|
||||
download_url = download_options['linux_arm_64_url']
|
||||
elif platform.system() == 'Darwin' and platform.machine() == 'arm64':
|
||||
download_url = download_options['darwin_arm_64_url']
|
||||
elif platform.system() == 'Darwin' and platform.machine() == 'x86_64':
|
||||
|
@ -820,6 +820,9 @@ func downloadFiles(updateInfo shared.UpdateInfo) error {
|
||||
} else if runtime.GOOS == "linux" && runtime.GOARCH == "arm64" {
|
||||
clientUrl = updateInfo.LinuxArm64Url
|
||||
clientProvenanceUrl = updateInfo.LinuxArm64AttestationUrl
|
||||
} else if runtime.GOOS == "linux" && runtime.GOARCH == "arm" {
|
||||
clientUrl = updateInfo.LinuxArm7Url
|
||||
clientProvenanceUrl = updateInfo.LinuxArm7AttestationUrl
|
||||
} else if runtime.GOOS == "darwin" && runtime.GOARCH == "amd64" {
|
||||
clientUrl = updateInfo.DarwinAmd64Url
|
||||
clientProvenanceUrl = updateInfo.DarwinAmd64AttestationUrl
|
||||
|
@ -46,6 +46,8 @@ type UpdateInfo struct {
|
||||
LinuxAmd64AttestationUrl string `json:"linux_amd_64_attestation_url"`
|
||||
LinuxArm64Url string `json:"linux_arm_64_url"`
|
||||
LinuxArm64AttestationUrl string `json:"linux_arm_64_attestation_url"`
|
||||
LinuxArm7Url string `json:"linux_arm_7_url"`
|
||||
LinuxArm7AttestationUrl string `json:"linux_arm_7_attestation_url"`
|
||||
DarwinAmd64Url string `json:"darwin_amd_64_url"`
|
||||
DarwinAmd64UnsignedUrl string `json:"darwin_amd_64_unsigned_url"`
|
||||
DarwinAmd64AttestationUrl string `json:"darwin_amd_64_attestation_url"`
|
||||
|
Loading…
Reference in New Issue
Block a user