Browse Source

Fixed building static binaries

master
konrad 1 year ago
parent
commit
0b49e973dd
Signed by: konrad GPG Key ID: F40E70337AB24C9B
2 changed files with 11 additions and 11 deletions
  1. +2
    -2
      .drone.yml
  2. +9
    -9
      Makefile

+ 2
- 2
.drone.yml View File

@ -58,7 +58,7 @@ steps:
- make release
# Push the releases to our pseudo-s3-bucket
- name: release-latest
- name: release
image: plugins/s3:1
pull: true
settings:
@ -103,7 +103,7 @@ steps:
- make release
# Push the releases to our pseudo-s3-bucket
- name: release-latest
- name: release
image: plugins/s3:1
pull: true
settings:

+ 9
- 9
Makefile View File

@ -100,30 +100,30 @@ release-dirs:
.PHONY: release-windows
release-windows:
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install $(GOFLAGS) github.com/karalabe/xgo; \
go install $(GOFLAGS) src.techknowlogick.com/xgo; \
fi
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-w -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out sofa-$(VERSION) .
ifeq ($(CI),drone)
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out vikunja-$(VERSION) .
ifneq ($(DRONE_WORKSPACE),'')
mv /build/* $(DIST)/binaries
endif
.PHONY: release-linux
release-linux:
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install $(GOFLAGS) github.com/karalabe/xgo; \
go install $(GOFLAGS) src.techknowlogick.com/xgo; \
fi
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-w -extldflags "-static" $(LDFLAGS)' -targets 'linux/*' -out sofa-$(VERSION) .
ifeq ($(CI),drone)
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/*' -out vikunja-$(VERSION) .
ifneq ($(DRONE_WORKSPACE),'')
mv /build/* $(DIST)/binaries
endif
.PHONY: release-darwin
release-darwin:
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install $(GOFLAGS) github.com/karalabe/xgo; \
go install $(GOFLAGS) src.techknowlogick.com/xgo; \
fi
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out sofa-$(VERSION) .
ifeq ($(CI),drone)
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out vikunja-$(VERSION) .
ifneq ($(DRONE_WORKSPACE),'')
mv /build/* $(DIST)/binaries
endif

Loading…
Cancel
Save