From 267f3a1e815bd162c8ec7786880b01d1eb3a97fd Mon Sep 17 00:00:00 2001 From: Andrey Kislyuk Date: Sun, 26 Mar 2017 12:20:05 -0700 Subject: [PATCH] Fix release script --- common.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common.mk b/common.mk index 5bc483f..edd3efe 100644 --- a/common.mk +++ b/common.mk @@ -1,5 +1,4 @@ SHELL=/bin/bash -eo pipefail -CLEAN_DIRS=watchtower release_major: $(eval export TAG=$(shell git describe --tags --match 'v*.*.*' | perl -ne '/^v(\d)+\.(\d)+\.(\d+)+/; print "v@{[$$1+1]}.0.0"')) @@ -15,13 +14,14 @@ release_patch: release: @if [[ -z $$TAG ]]; then echo "Use release_{major,minor,patch}"; exit 1; fi - $(eval REMOTE=$(shell git remote get-url origin | perl -ne '/(\w+\/\w+)[^\/]+$$/; print $$1')) + $(eval REMOTE=$(shell git remote get-url origin | perl -ne '/([^\/\:]+\/.+?)(\.git)?$$/; print $$1')) $(eval GIT_USER=$(shell git config --get user.email)) $(eval GH_AUTH=$(shell if grep -q '@github.com' ~/.git-credentials; then echo $$(grep '@github.com' ~/.git-credentials | python3 -c 'import sys, urllib.parse as p; print(p.urlparse(sys.stdin.read()).netloc.split("@")[0])'); else echo $(GIT_USER); fi)) $(eval RELEASES_API=https://api.github.com/repos/${REMOTE}/releases) $(eval UPLOADS_API=https://uploads.github.com/repos/${REMOTE}/releases) - git clean -x --force ${CLEAN_DIRS} - sed -i -e "s/version=\"[0-9]\+\.[0-9]\+\.[0-9]\+\"/version=\"$${TAG:1}\"/" setup.py + git pull + git clean -x --force $$(python setup.py --name) + sed -i -e "s/version=\([\'\"]\)[0-9]*\.[0-9]*\.[0-9]*/version=\1$${TAG:1}/" setup.py git add setup.py TAG_MSG=$$(mktemp); \ echo "# Changes for ${TAG} ($$(date +%Y-%m-%d))" > $$TAG_MSG; \