Merge pull request #348 from tboerger/release-fixes
Fix drone release publishing and test steps
This commit is contained in:
commit
70134323d1
3 changed files with 35 additions and 16 deletions
39
.drone.yml
39
.drone.yml
|
@ -8,9 +8,10 @@ pipeline:
|
||||||
pull: true
|
pull: true
|
||||||
environment:
|
environment:
|
||||||
CGO_ENABLED: 1
|
CGO_ENABLED: 1
|
||||||
TAGS: sqlite tidb pam
|
TAGS: sqlite
|
||||||
|
GOPATH: /srv/app
|
||||||
commands:
|
commands:
|
||||||
- apk -U add linux-pam-dev openssh-client
|
- apk -U add openssh-client
|
||||||
- make clean
|
- make clean
|
||||||
- make vet
|
- make vet
|
||||||
- make lint
|
- make lint
|
||||||
|
@ -22,34 +23,46 @@ pipeline:
|
||||||
test-mysql:
|
test-mysql:
|
||||||
image: webhippie/golang:edge
|
image: webhippie/golang:edge
|
||||||
pull: true
|
pull: true
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
TAGS: sqlite
|
||||||
|
GOPATH: /srv/app
|
||||||
commands:
|
commands:
|
||||||
- make test-mysql
|
- make test-mysql
|
||||||
when:
|
when:
|
||||||
event: [ push ]
|
event: [ push ]
|
||||||
|
|
||||||
test-pgsql:
|
test-pgsql:
|
||||||
image: webhippie/golang:edge
|
image: webhippie/golang:edge
|
||||||
pull: true
|
pull: true
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
TAGS: sqlite
|
||||||
|
GOPATH: /srv/app
|
||||||
commands:
|
commands:
|
||||||
- make test-pgsql
|
- make test-pgsql
|
||||||
when:
|
when:
|
||||||
event: [ push ]
|
event: [ push ]
|
||||||
|
|
||||||
|
updater:
|
||||||
|
image: karalabe/xgo-latest:latest
|
||||||
|
pull: true
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
TAGS: sqlite
|
||||||
|
GOPATH: /srv/app
|
||||||
|
commands:
|
||||||
|
- make release
|
||||||
|
when:
|
||||||
|
event: [ push, tag ]
|
||||||
|
branch: [ master, refs/tags/* ]
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
image: plugins/coverage
|
image: plugins/coverage
|
||||||
server: https://coverage.gitea.io
|
server: https://coverage.gitea.io
|
||||||
when:
|
when:
|
||||||
event: [ push, tag, pull_request ]
|
event: [ push, tag, pull_request ]
|
||||||
|
|
||||||
updater:
|
|
||||||
image: karalabe/xgo-latest:latest
|
|
||||||
pull: true
|
|
||||||
commands:
|
|
||||||
- make release
|
|
||||||
when:
|
|
||||||
event: [ push, tag ]
|
|
||||||
branch: [ master, refs/tags/* ]
|
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
repo: gitea/gitea
|
repo: gitea/gitea
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIGJhc2U6IC9zcnYvYXBwCiAgcGF0aDogc3JjL2NvZGUuZ2l0ZWEuaW8vZ2l0ZWEKCnBpcGVsaW5lOgogIHRlc3Q6CiAgICBpbWFnZTogd2ViaGlwcGllL2dvbGFuZzplZGdlCiAgICBwdWxsOiB0cnVlCiAgICBlbnZpcm9ubWVudDoKICAgICAgQ0dPX0VOQUJMRUQ6IDEKICAgICAgVEFHUzogc3FsaXRlIHRpZGIgcGFtCiAgICBjb21tYW5kczoKICAgICAgLSBhcGsgLVUgYWRkIGxpbnV4LXBhbS1kZXYgb3BlbnNzaC1jbGllbnQKICAgICAgLSBtYWtlIGNsZWFuCiAgICAgIC0gbWFrZSB2ZXQKICAgICAgLSBtYWtlIGxpbnQKICAgICAgLSBtYWtlIHRlc3QKICAgICAgLSBtYWtlIGJ1aWxkCiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoLCB0YWcsIHB1bGxfcmVxdWVzdCBdCgogIHRlc3QtbXlzcWw6CiAgICBpbWFnZTogd2ViaGlwcGllL2dvbGFuZzplZGdlCiAgICBwdWxsOiB0cnVlCiAgICBjb21tYW5kczoKICAgIC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iAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoIF0KICAgICAgYnJhbmNoOiBbIG1hc3RlciBdCgogIHJlbGVhc2U6CiAgICBpbWFnZTogcGx1Z2lucy9zMwogICAgcGF0aF9zdHlsZTogdHJ1ZQogICAgc3RyaXBfcHJlZml4OiBkaXN0L3JlbGVhc2UvCiAgICBzb3VyY2U6IGRpc3QvcmVsZWFzZS8qCiAgICB0YXJnZXQ6IC9naXRlYS8kJFRBRwogICAgd2hlbjoKICAgICAgZXZlbnQ6IFsgdGFnIF0KICAgICAgYnJhbmNoOiBbIHJlZnMvdGFncy8qIF0KCiAgZ2l0aHViOgogICAgaW1hZ2U6IHBsdWdpbnMvZ2l0aHViLXJlbGVhc2UKICAgIGZpbGVzOgogICAgICAtIGRpc3QvcmVsZWFzZS8qCiAgICB3aGVuOgogICAgICBldmVudDogWyB0YWcgXQogICAgICBicmFuY2g6IFsgcmVmcy90YWdzLyogXQoKICBnaXR0ZXI6CiAgICBpbWFnZTogcGx1Z2lucy9naXR0ZXIKCnNlcnZpY2VzOgogIG15c3FsOgogICAgaW1hZ2U6IG15c3FsOjUuNwogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gTVlTUUxfREFUQUJBU0U9dGVzdAogICAgICAtIE1ZU1FMX0FMTE9XX0VNUFRZX1BBU1NXT1JEPXllcwogICAgd2hlbjoKICAgICAgZXZlbnQ6IFsgcHVzaCBdCgogIHBnc3FsOgogICAgaW1hZ2U6IHBvc3RncmVzOjkuNQogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gUE9TVEdSRVNfREI9dGVzdAogICAgd2hlbjoKICAgICAgZXZlbnQ6IFsgcHVzaCBdCg.LjU9u_DQ4fD2CytUu9RwwSimdcS3-KzR6nO4ff4edNU
|
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
|
||||||
|
|
Loading…
Reference in a new issue