diff options
author | 2018-06-24 11:21:58 -0700 | |
---|---|---|
committer | 2018-06-24 19:21:58 +0100 | |
commit | c25a2e0fac398c4454578abef8ea0870099fac97 (patch) | |
tree | b86f6c1fe11224bd62caa12b5d33759819109c5f /Makefile.release | |
parent | 1ef9e31262b6dff796d35ee667cb9b93e723b13d (diff) | |
download | coredns-c25a2e0fac398c4454578abef8ea0870099fac97.tar.gz coredns-c25a2e0fac398c4454578abef8ea0870099fac97.tar.zst coredns-c25a2e0fac398c4454578abef8ea0870099fac97.zip |
Replace gh-release with curl (#1896)
* Replace gh-release with curl
This fix tries to address the issue raised in 1895 where
gh-release is deprecated.
As GitHub provides API that could be accessed easily,
and gh-release itself is just a wrapper to the API,
this fix replaces gh-release with the direct interaction
with GitHub API, so that it could be maintained by coredns
team.
This fix fixes 1895.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Added `-o /dev/null`
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Diffstat (limited to 'Makefile.release')
-rw-r--r-- | Makefile.release | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Makefile.release b/Makefile.release index e046c3793..9dd8f7bbd 100644 --- a/Makefile.release +++ b/Makefile.release @@ -46,8 +46,8 @@ EMPTY:= SPACE:=$(EMPTY) $(EMPTY) COMMA:=$(EMPTY),$(EMPTY) -ifeq (, $(shell which gh-release)) - $(error "No gh-release in $$PATH, install with: go get github.com/progrium/gh-release") +ifeq (, $(shell which curl)) + $(error "No curl in $$PATH, please install") endif ifeq (, $(shell which manifest-tool)) @@ -115,7 +115,14 @@ tar: .PHONY: upload upload: @echo Releasing: $(VERSION) - gh-release create $(GITHUB)/$(NAME) $(VERSION) + $(eval RELEASE:=$(shell curl -s -d '{"tag_name": "v$(VERSION)", "name": "v$(VERSION)"}' "https://api.github.com/repos/$(GITHUB)/$(NAME)/releases?access_token=${GITHUB_ACCESS_TOKEN}" | grep -m 1 '"id"' | tr -cd '[[:digit:]]')) + @echo ReleaseID: $(RELEASE) + @for asset in `ls -A release`; do \ + curl -o /dev/null -X POST \ + -H "Content-Type: application/gzip" \ + --data-binary "@release/$$asset" \ + "https://uploads.github.com/repos/$(GITHUB)/$(NAME)/releases/$(RELEASE)/assets?name=$${asset}&access_token=${GITHUB_ACCESS_TOKEN}" ; \ + done .PHONY: docker-build docker-build: tar |