Skip to content

Commit

Permalink
chore(build): support arm64 build for linux (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
photoszzt authored Jan 18, 2025
1 parent 87cc02d commit ab40371
Show file tree
Hide file tree
Showing 6 changed files with 340 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
65 changes: 65 additions & 0 deletions .goreleaser_linux_arm64_amzn2.yaml
Original file line number Diff line number Diff line change
@@ -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
65 changes: 65 additions & 0 deletions .goreleaser_linux_arm64_amzn2023.yaml
Original file line number Diff line number Diff line change
@@ -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
65 changes: 65 additions & 0 deletions .goreleaser_linux_arm64_ubuntu20.04.yaml
Original file line number Diff line number Diff line change
@@ -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
65 changes: 65 additions & 0 deletions .goreleaser_linux_arm64_ubuntu22.04.yaml
Original file line number Diff line number Diff line change
@@ -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
65 changes: 65 additions & 0 deletions .goreleaser_linux_arm64_ubuntu24.04.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ab40371

Please sign in to comment.