Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
[BUGFIX] Use goreleaser build for crosscompile (gopasspw#2635)
Browse files Browse the repository at this point in the history
This should make sure that we catch all platforms we target during
release.

Signed-off-by: Dominik Schulz <[email protected]>
  • Loading branch information
dominikschulz authored Sep 11, 2023
1 parent 63534c5 commit bdbda58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ builds:
env:
- CGO_ENABLED=0
asmflags:
- all=-trimpath={{.Env.GOPATH}}
- all=-trimpath={{.Env.HOME}}
gcflags:
- all=-trimpath={{.Env.GOPATH}}
- all=-trimpath={{.Env.HOME}}
ldflags: |
-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.CommitDate}} -extldflags '-static'
goos:
Expand Down
20 changes: 5 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,11 @@ test-integration: $(GOPASS_OUTPUT)
cd tests && GOPASS_BINARY=$(PWD)/$(GOPASS_OUTPUT) GOPASS_TEST_DIR=$(PWD)/tests $(GO) test -v $(TESTFLAGS)

crosscompile:
@echo -n ">> CROSSCOMPILE linux/amd64"
@GOOS=linux GOARCH=amd64 $(GO) build -o $(GOPASS_OUTPUT)-linux-amd64
@printf '%s\n' '$(OK)'
@echo -n ">> CROSSCOMPILE darwin/amd64"
@GOOS=darwin GOARCH=amd64 $(GO) build -o $(GOPASS_OUTPUT)-darwin-amd64
@printf '%s\n' '$(OK)'
@echo -n ">> CROSSCOMPILE windows/amd64"
@GOOS=windows GOARCH=amd64 $(GO) build -o $(GOPASS_OUTPUT)-windows-amd64
@printf '%s\n' '$(OK)'
@echo -n ">> CROSSCOMPILE freebsd/amd64"
@GOOS=freebsd GOARCH=amd64 $(GO) build -o $(GOPASS_OUTPUT)-freebsd-amd64
@printf '%s\n' '$(OK)'
@echo -n ">> CROSSCOMPILE openbsd/amd64"
@GOOS=openbsd GOARCH=amd64 $(GO) build -o $(GOPASS_OUTPUT)-openbsd-amd64
@printf '%s\n' '$(OK)'
@echo ">> CROSSCOMPILE"
@which goreleaser > /dev/null; if [ $$? -ne 0 ]; then \
$(GO) install github.com/goreleaser/goreleaser@latest; \
fi
@goreleaser build --snapshot

%.completion: $(GOPASS_OUTPUT)
@printf ">> $* completion, output = $@"
Expand Down

0 comments on commit bdbda58

Please sign in to comment.