Skip to content

Commit

Permalink
Add darwin arm build and fix archive names
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanJarv committed Aug 22, 2024
1 parent bc39761 commit 688c3c2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 7 deletions.
36 changes: 29 additions & 7 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ builds:
- -mod=readonly
ldflags:
- -s -w -X main.version={{.Version}}
- id: darwin-arm64
main: ./
binary: liquidswards
goos:
- darwin
goarch:
- arm64
env:
- PKG_CONFIG_SYSROOT_DIR=/sysroot/macos/arm64
- PKG_CONFIG_PATH=/sysroot/macos/arm64/usr/local/lib/pkgconfig
- CC=oa64-clang
- CXX=oa64-clang++
flags:
- -mod=readonly
ldflags:
- -s -w -X main.version={{.Version}}
- id: linux-armhf
main: ./
binary: liquidswards
Expand All @@ -36,13 +52,19 @@ builds:
ldflags:
- -s -w -X main.version={{.Version}}
archives:
- id: golang-cross
builds:
- darwin-amd64
- linux-armhf
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format: zip
wrap_in_directory: true
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ sysroot-pack:
sysroot-unpack:
@pv $(SYSROOT_ARCHIVE) | pbzip2 -cd | tar -xf -

.PHONY: release-dry-run
release-dry-run:
@docker run \
--rm \
-e CGO_ENABLED=1 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-v `pwd`/sysroot:/sysroot \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
--clean --skip-validate --skip-publish

.PHONY: release
release:
@if [ ! -f ".release-env" ]; then \
Expand Down

0 comments on commit 688c3c2

Please sign in to comment.