forked from lunny/changelog
keep release step close to gitea one (#29)
Update '.drone.yml' keep release step close to gitea one Reviewed-on: https://gitea.com/gitea/changelog/pulls/29 Reviewed-by: 6543 <6543@noreply.gitea.io>
This commit is contained in:
parent
660d748ddc
commit
0af51468e3
@ -83,8 +83,8 @@ steps:
|
|||||||
bucket: releases
|
bucket: releases
|
||||||
endpoint: https://storage.gitea.io
|
endpoint: https://storage.gitea.io
|
||||||
path_style: true
|
path_style: true
|
||||||
source: "dist/*"
|
source: "dist/release/*"
|
||||||
strip_prefix: dist/
|
strip_prefix: dist/release/
|
||||||
target: /changelog-tool/master
|
target: /changelog-tool/master
|
||||||
environment:
|
environment:
|
||||||
AWS_ACCESS_KEY_ID:
|
AWS_ACCESS_KEY_ID:
|
||||||
@ -103,8 +103,8 @@ steps:
|
|||||||
bucket: releases
|
bucket: releases
|
||||||
endpoint: https://storage.gitea.io
|
endpoint: https://storage.gitea.io
|
||||||
path_style: true
|
path_style: true
|
||||||
source: "dist/*"
|
source: "dist/release/*"
|
||||||
strip_prefix: dist/
|
strip_prefix: dist/release/
|
||||||
target: "/changelog-tool/${DRONE_TAG##v}"
|
target: "/changelog-tool/${DRONE_TAG##v}"
|
||||||
environment:
|
environment:
|
||||||
AWS_ACCESS_KEY_ID:
|
AWS_ACCESS_KEY_ID:
|
||||||
|
47
Makefile
47
Makefile
@ -2,10 +2,14 @@ DIST := dist
|
|||||||
GO ?= go
|
GO ?= go
|
||||||
|
|
||||||
ifneq ($(DRONE_TAG),)
|
ifneq ($(DRONE_TAG),)
|
||||||
SHORT_VERSION ?= $(subst v,,$(DRONE_TAG))
|
VERSION ?= $(subst v,,$(DRONE_TAG))
|
||||||
LONG_VERSION ?= $(SHORT_VERSION)
|
LONG_VERSION ?= $(VERSION)
|
||||||
else
|
else
|
||||||
SHORT_VERSION ?= $(shell git describe --tags --always --abbrev=0 | sed 's/-/+/' | sed 's/^v//')
|
ifneq ($(DRONE_BRANCH),)
|
||||||
|
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
|
||||||
|
else
|
||||||
|
VERSION ?= master
|
||||||
|
endif
|
||||||
LONG_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
|
LONG_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -34,35 +38,48 @@ fmt:
|
|||||||
.PHONY: release
|
.PHONY: release
|
||||||
release: release-dirs check-xgo release-windows release-linux release-darwin release-compress release-check
|
release: release-dirs check-xgo release-windows release-linux release-darwin release-compress release-check
|
||||||
|
|
||||||
.PHONY: release-dirs
|
|
||||||
release-dirs:
|
|
||||||
mkdir -p $(DIST)/
|
|
||||||
|
|
||||||
.PHONY: check-xgo
|
.PHONY: check-xgo
|
||||||
check-xgo:
|
check-xgo:
|
||||||
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
$(GO) get -u src.techknowlogick.com/xgo; \
|
$(GO) get -u src.techknowlogick.com/xgo; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
.PHONY: release-linux
|
.PHONY: release-dirs
|
||||||
release-linux:
|
release-dirs:
|
||||||
xgo -dest $(DIST)/ -targets 'linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/mips64le,linux/mips,linux/mipsle' -out changelog-$(SHORT_VERSION) .
|
mkdir -p $(DIST)/binaries $(DIST)/release
|
||||||
|
|
||||||
.PHONY: release-windows
|
.PHONY: release-windows
|
||||||
release-windows:
|
release-windows:
|
||||||
xgo -dest $(DIST)/ -targets 'windows/*' -out changelog-$(SHORT_VERSION) .
|
xgo -dest $(DIST)/binaries -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out changelog-$(VERSION) .
|
||||||
|
ifeq ($(CI),drone)
|
||||||
|
cp /build/* $(DIST)/binaries
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: release-linux
|
||||||
|
release-linux:
|
||||||
|
xgo -dest $(DIST)/binaries -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/mips64le,linux/mips,linux/mipsle' -out changelog-$(VERSION) .
|
||||||
|
ifeq ($(CI),drone)
|
||||||
|
cp /build/* $(DIST)/binaries
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: release-darwin
|
.PHONY: release-darwin
|
||||||
release-darwin:
|
release-darwin:
|
||||||
xgo -dest $(DIST)/ -targets 'darwin/*' -out changelog-$(SHORT_VERSION) .
|
xgo -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out changelog-$(VERSION) .
|
||||||
|
ifeq ($(CI),drone)
|
||||||
|
cp /build/* $(DIST)/binaries
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: release-copy
|
||||||
|
release-copy:
|
||||||
|
cd $(DIST); for file in `find /build -type f -name "*"`; do cp $${file} ./release/; done;
|
||||||
|
|
||||||
.PHONY: release-check
|
.PHONY: release-check
|
||||||
release-check:
|
release-check:
|
||||||
cd $(DIST)/; for file in `find . -type f -name "*"`; do echo "checksumming $${file}" && $(SHASUM) `echo $${file} | sed 's/^..//'` > $${file}.sha256; done;
|
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "checksumming $${file}" && $(SHASUM) `echo $${file} | sed 's/^..//'` > $${file}.sha256; done;
|
||||||
|
|
||||||
.PHONY: release-compress
|
.PHONY: release-compress
|
||||||
release-compress:
|
release-compress:
|
||||||
@hash gxz > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
@hash gxz > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
go get -u github.com/ulikunitz/xz/cmd/gxz; \
|
$(GO) get -u github.com/ulikunitz/xz/cmd/gxz; \
|
||||||
fi
|
fi
|
||||||
cd $(DIST)/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && gxz -k -9 $${file}; done;
|
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && gxz -k -9 $${file}; done;
|
||||||
|
Loading…
Reference in New Issue
Block a user