Commit 5adefab0 authored by Zou Nengren's avatar Zou Nengren Committed by GitHub

send token in the header instead of api call (#3764)

Automatically submitted.
parent 40c7b917
...@@ -112,14 +112,15 @@ tar: ...@@ -112,14 +112,15 @@ tar:
.PHONY: github-push .PHONY: github-push
github-push: github-push:
@echo Releasing: $(VERSION) @echo Releasing: $(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:]]')) @$(eval RELEASE:=$(shell curl -s -d '{"tag_name": "v$(VERSION)", "name": "v$(VERSION)"}' -H "Authorization: token ${GITHUB_ACCESS_TOKEN}" "https://api.github.com/repos/$(GITHUB)/$(NAME)/releases" | grep -m 1 '"id"' | tr -cd '[[:digit:]]'))
@echo ReleaseID: $(RELEASE) @echo ReleaseID: $(RELEASE)
@( cd release; for asset in `ls -A *tgz`; do \ @( cd release; for asset in `ls -A *tgz`; do \
echo $$asset; \ echo $$asset; \
curl -o /dev/null -X POST \ curl -o /dev/null -X POST \
-H "Content-Type: application/gzip" \ -H "Content-Type: application/gzip" \
-H "Authorization: token ${GITHUB_ACCESS_TOKEN}"
--data-binary "@$$asset" \ --data-binary "@$$asset" \
"https://uploads.github.com/repos/$(GITHUB)/$(NAME)/releases/$(RELEASE)/assets?name=$${asset}&access_token=${GITHUB_ACCESS_TOKEN}" ; \ "https://uploads.github.com/repos/$(GITHUB)/$(NAME)/releases/$(RELEASE)/assets?name=$${asset}" ; \
done ) done )
@( cd release; for asset in `ls -A *tgz`; do \ @( cd release; for asset in `ls -A *tgz`; do \
sha256sum $$asset > $$asset.sha256; \ sha256sum $$asset > $$asset.sha256; \
...@@ -128,8 +129,9 @@ github-push: ...@@ -128,8 +129,9 @@ github-push:
echo $$asset; \ echo $$asset; \
curl -o /dev/null -X POST \ curl -o /dev/null -X POST \
-H "Content-Type: text/plain" \ -H "Content-Type: text/plain" \
-H "Authorization: token ${GITHUB_ACCESS_TOKEN}"
--data-binary "@$$asset" \ --data-binary "@$$asset" \
"https://uploads.github.com/repos/$(GITHUB)/$(NAME)/releases/$(RELEASE)/assets?name=$${asset}&access_token=${GITHUB_ACCESS_TOKEN}" ; \ "https://uploads.github.com/repos/$(GITHUB)/$(NAME)/releases/$(RELEASE)/assets?name=$${asset}" ; \
done ) done )
.PHONY: docker-build .PHONY: docker-build
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment