Properly move releases within drone builds
This commit is contained in:
parent
947d2ee21b
commit
e52b24ad5d
1 changed files with 8 additions and 2 deletions
10
Makefile
10
Makefile
|
@ -90,7 +90,11 @@ $(EXECUTABLE): $(wildcard *.go)
|
||||||
go build -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
|
go build -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
|
||||||
|
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
release: release-build release-copy release-check
|
release: release-dirs release-build release-copy release-check
|
||||||
|
|
||||||
|
.PHONY: release-dirs
|
||||||
|
release-dirs:
|
||||||
|
mkdir -p $(DIST)/binaries $(DIST)/release
|
||||||
|
|
||||||
.PHONY: release-build
|
.PHONY: release-build
|
||||||
release-build:
|
release-build:
|
||||||
|
@ -98,10 +102,12 @@ release-build:
|
||||||
go get -u github.com/karalabe/xgo; \
|
go get -u github.com/karalabe/xgo; \
|
||||||
fi
|
fi
|
||||||
xgo -dest $(DIST)/binaries -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -targets '$(TARGETS)' -out $(EXECUTABLE)-$(VERSION) $(IMPORT)
|
xgo -dest $(DIST)/binaries -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -targets '$(TARGETS)' -out $(EXECUTABLE)-$(VERSION) $(IMPORT)
|
||||||
|
ifeq ($(CI),drone)
|
||||||
|
mv /build/* $(DIST)/binaries
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: release-copy
|
.PHONY: release-copy
|
||||||
release-copy:
|
release-copy:
|
||||||
mkdir -p $(DIST)/release
|
|
||||||
$(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),cp $(file) $(DIST)/release/$(notdir $(file));)
|
$(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),cp $(file) $(DIST)/release/$(notdir $(file));)
|
||||||
|
|
||||||
.PHONY: release-check
|
.PHONY: release-check
|
||||||
|
|
Reference in a new issue