diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 8ebc478..0cde98d 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -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 @@ -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: diff --git a/Makefile b/Makefile index 2474ed9..1397fc5 100644 --- a/Makefile +++ b/Makefile @@ -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 \