From ab4037114adede58f63624c82040471deb513dc6 Mon Sep 17 00:00:00 2001 From: Zhiting Zhu Date: Fri, 17 Jan 2025 19:42:36 -0600 Subject: [PATCH] chore(build): support arm64 build for linux (#303) --- .github/workflows/goreleaser.yml | 15 ++++++ .goreleaser_linux_arm64_amzn2.yaml | 65 ++++++++++++++++++++++++ .goreleaser_linux_arm64_amzn2023.yaml | 65 ++++++++++++++++++++++++ .goreleaser_linux_arm64_ubuntu20.04.yaml | 65 ++++++++++++++++++++++++ .goreleaser_linux_arm64_ubuntu22.04.yaml | 65 ++++++++++++++++++++++++ .goreleaser_linux_arm64_ubuntu24.04.yaml | 65 ++++++++++++++++++++++++ 6 files changed, 340 insertions(+) create mode 100644 .goreleaser_linux_arm64_amzn2.yaml create mode 100644 .goreleaser_linux_arm64_amzn2023.yaml create mode 100644 .goreleaser_linux_arm64_ubuntu20.04.yaml create mode 100644 .goreleaser_linux_arm64_ubuntu22.04.yaml create mode 100644 .goreleaser_linux_arm64_ubuntu24.04.yaml diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 453d835f..d92af7a7 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -25,16 +25,31 @@ jobs: target: linux_amd64 goreleaser_suffix: _ubuntu20.04 + - os: ubuntu-20.04 + platform: linux + target: linux_arm64 + goreleaser_suffix: _ubuntu20.04 + - os: ubuntu-22.04 platform: linux target: linux_amd64 goreleaser_suffix: _ubuntu22.04 + - os: ubuntu-22.04 + platform: linux + target: linux_arm64 + goreleaser_suffix: _ubuntu22.04 + - os: ubuntu-24.04 platform: linux target: linux_amd64 goreleaser_suffix: _ubuntu24.04 + - os: ubuntu-24.04 + platform: linux + target: linux_arm64 + goreleaser_suffix: _ubuntu24.04 + - os: macos-latest platform: darwin target: darwin_amd64 diff --git a/.goreleaser_linux_arm64_amzn2.yaml b/.goreleaser_linux_arm64_amzn2.yaml new file mode 100644 index 00000000..e4930988 --- /dev/null +++ b/.goreleaser_linux_arm64_amzn2.yaml @@ -0,0 +1,65 @@ +# https://goreleaser.com/customization/builds/ +builds: + + - id: gpud + binary: gpud + main: ./cmd/gpud + env: + - CGO_ENABLED=1 + flags: + - -v + + # NOTE: the "v" prefix from the git tag is stripped for the {{.Version}} + ldflags: + - -s -w + - -X github.com/leptonai/gpud/version.BuildTimestamp={{.CommitTimestamp}} + - -X github.com/leptonai/gpud/version.Revision={{.Commit}} + - -X github.com/leptonai/gpud/version.Version=v{{.Version}} + + goos: + - linux + goarch: + - arm64 + +# https://goreleaser.com/customization/archive/ +archives: + + - id: gpud + format: tgz + + # "builds" reference which build instances should be archived in this archive + builds: + - gpud + + name_template: >- + {{ .Binary }}_v{{- .Version }}_{{- .Os }}_{{ .Arch }}_amzn2 + + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +# https://goreleaser.com/customization/changelog/ +changelog: + use: github-native + +release: + draft: false + replace_existing_draft: true + make_latest: true + mode: replace + + github: + owner: leptonai + name: gpud + + header: | + ## GPUd release notes ({{ .Date }}) + + Welcome to this new release! + + name_template: "{{.ProjectName}}-v{{.Version}}" + +# ref. https://goreleaser.com/customization/checksum/?h=checksum +checksum: + disable: true diff --git a/.goreleaser_linux_arm64_amzn2023.yaml b/.goreleaser_linux_arm64_amzn2023.yaml new file mode 100644 index 00000000..58af8378 --- /dev/null +++ b/.goreleaser_linux_arm64_amzn2023.yaml @@ -0,0 +1,65 @@ +# https://goreleaser.com/customization/builds/ +builds: + + - id: gpud + binary: gpud + main: ./cmd/gpud + env: + - CGO_ENABLED=1 + flags: + - -v + + # NOTE: the "v" prefix from the git tag is stripped for the {{.Version}} + ldflags: + - -s -w + - -X github.com/leptonai/gpud/version.BuildTimestamp={{.CommitTimestamp}} + - -X github.com/leptonai/gpud/version.Revision={{.Commit}} + - -X github.com/leptonai/gpud/version.Version=v{{.Version}} + + goos: + - linux + goarch: + - arm64 + +# https://goreleaser.com/customization/archive/ +archives: + + - id: gpud + format: tgz + + # "builds" reference which build instances should be archived in this archive + builds: + - gpud + + name_template: >- + {{ .Binary }}_v{{- .Version }}_{{- .Os }}_{{ .Arch }}_amzn2023 + + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +# https://goreleaser.com/customization/changelog/ +changelog: + use: github-native + +release: + draft: false + replace_existing_draft: true + make_latest: true + mode: replace + + github: + owner: leptonai + name: gpud + + header: | + ## GPUd release notes ({{ .Date }}) + + Welcome to this new release! + + name_template: "{{.ProjectName}}-v{{.Version}}" + +# ref. https://goreleaser.com/customization/checksum/?h=checksum +checksum: + disable: true diff --git a/.goreleaser_linux_arm64_ubuntu20.04.yaml b/.goreleaser_linux_arm64_ubuntu20.04.yaml new file mode 100644 index 00000000..fcff7ec5 --- /dev/null +++ b/.goreleaser_linux_arm64_ubuntu20.04.yaml @@ -0,0 +1,65 @@ +# https://goreleaser.com/customization/builds/ +builds: + + - id: gpud + binary: gpud + main: ./cmd/gpud + env: + - CGO_ENABLED=1 + flags: + - -v + + # NOTE: the "v" prefix from the git tag is stripped for the {{.Version}} + ldflags: + - -s -w + - -X github.com/leptonai/gpud/version.BuildTimestamp={{.CommitTimestamp}} + - -X github.com/leptonai/gpud/version.Revision={{.Commit}} + - -X github.com/leptonai/gpud/version.Version=v{{.Version}} + + goos: + - linux + goarch: + - arm64 + +# https://goreleaser.com/customization/archive/ +archives: + + - id: gpud + format: tgz + + # "builds" reference which build instances should be archived in this archive + builds: + - gpud + + name_template: >- + {{ .Binary }}_v{{- .Version }}_{{- .Os }}_{{ .Arch }}_ubuntu20.04 + + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +# https://goreleaser.com/customization/changelog/ +changelog: + use: github-native + +release: + draft: false + replace_existing_draft: true + make_latest: true + mode: replace + + github: + owner: leptonai + name: gpud + + header: | + ## GPUd release notes ({{ .Date }}) + + Welcome to this new release! + + name_template: "{{.ProjectName}}-v{{.Version}}" + +# ref. https://goreleaser.com/customization/checksum/?h=checksum +checksum: + disable: true diff --git a/.goreleaser_linux_arm64_ubuntu22.04.yaml b/.goreleaser_linux_arm64_ubuntu22.04.yaml new file mode 100644 index 00000000..77e03a40 --- /dev/null +++ b/.goreleaser_linux_arm64_ubuntu22.04.yaml @@ -0,0 +1,65 @@ +# https://goreleaser.com/customization/builds/ +builds: + + - id: gpud + binary: gpud + main: ./cmd/gpud + env: + - CGO_ENABLED=1 + flags: + - -v + + # NOTE: the "v" prefix from the git tag is stripped for the {{.Version}} + ldflags: + - -s -w + - -X github.com/leptonai/gpud/version.BuildTimestamp={{.CommitTimestamp}} + - -X github.com/leptonai/gpud/version.Revision={{.Commit}} + - -X github.com/leptonai/gpud/version.Version=v{{.Version}} + + goos: + - linux + goarch: + - arm64 + +# https://goreleaser.com/customization/archive/ +archives: + + - id: gpud + format: tgz + + # "builds" reference which build instances should be archived in this archive + builds: + - gpud + + name_template: >- + {{ .Binary }}_v{{- .Version }}_{{- .Os }}_{{ .Arch }}_ubuntu22.04 + + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +# https://goreleaser.com/customization/changelog/ +changelog: + use: github-native + +release: + draft: false + replace_existing_draft: true + make_latest: true + mode: replace + + github: + owner: leptonai + name: gpud + + header: | + ## GPUd release notes ({{ .Date }}) + + Welcome to this new release! + + name_template: "{{.ProjectName}}-v{{.Version}}" + +# ref. https://goreleaser.com/customization/checksum/?h=checksum +checksum: + disable: true diff --git a/.goreleaser_linux_arm64_ubuntu24.04.yaml b/.goreleaser_linux_arm64_ubuntu24.04.yaml new file mode 100644 index 00000000..92a55a1a --- /dev/null +++ b/.goreleaser_linux_arm64_ubuntu24.04.yaml @@ -0,0 +1,65 @@ +# https://goreleaser.com/customization/builds/ +builds: + + - id: gpud + binary: gpud + main: ./cmd/gpud + env: + - CGO_ENABLED=1 + flags: + - -v + + # NOTE: the "v" prefix from the git tag is stripped for the {{.Version}} + ldflags: + - -s -w + - -X github.com/leptonai/gpud/version.BuildTimestamp={{.CommitTimestamp}} + - -X github.com/leptonai/gpud/version.Revision={{.Commit}} + - -X github.com/leptonai/gpud/version.Version=v{{.Version}} + + goos: + - linux + goarch: + - arm64 + +# https://goreleaser.com/customization/archive/ +archives: + + - id: gpud + format: tgz + + # "builds" reference which build instances should be archived in this archive + builds: + - gpud + + name_template: >- + {{ .Binary }}_v{{- .Version }}_{{- .Os }}_{{ .Arch }}_ubuntu24.04 + + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +# https://goreleaser.com/customization/changelog/ +changelog: + use: github-native + +release: + draft: false + replace_existing_draft: true + make_latest: true + mode: replace + + github: + owner: leptonai + name: gpud + + header: | + ## GPUd release notes ({{ .Date }}) + + Welcome to this new release! + + name_template: "{{.ProjectName}}-v{{.Version}}" + +# ref. https://goreleaser.com/customization/checksum/?h=checksum +checksum: + disable: true