From d12dcfc3f6ef5ca64a3017ebdee4bad2f67fea4f Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 31 Oct 2018 19:52:33 -0700 Subject: [PATCH] [stable-2.7] Add Makefile to simplify upstream releases. (cherry picked from commit 6a351c9c86433e54955c7f08601355b862323d48) Co-authored-by: Matt Clay --- packaging/release/Makefile | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 packaging/release/Makefile diff --git a/packaging/release/Makefile b/packaging/release/Makefile new file mode 100644 index 00000000000..b21aca446d8 --- /dev/null +++ b/packaging/release/Makefile @@ -0,0 +1,60 @@ +version ?= $(shell python versionhelper/version_helper.py --raw) + +.PHONY: all +all: + @echo "USAGE:" + @echo + @echo "make release version={version} # current version is '${version}'" + @echo "make publish" + @echo + @echo "NOTE: Make sure to source hacking/env-setup before running these targets." + +.PHONY: release +release: version summary changelog commit-release + git show -p + git status + @echo + @echo 'Run `git push` if you are satisfied with the changes.' + +.PHONY: version +version: + sed -i.bak "s/^__version__ = .*$$/__version__ = '${version}'/" ../../lib/ansible/release.py + rm ../../lib/ansible/release.py.bak + +.PHONY: summary +summary: + @echo 'release_summary: |\n\ + | Release Date: $(shell date '+%Y-%m-%d')\n\ + | `Porting Guide `_' > \ + ../../changelogs/fragments/v${version}_summary.yaml + +.PHONY: changelog +changelog: + changelogs/changelog.py release -vv && changelogs/changelog.py generate -vv + ansible-test sanity changelogs/ + +.PHONY: commit-release +commit-release: + git add ../../changelogs/ ../../lib/ansible/release.py + git commit -m "New release v${version}" + +.PHONY: publish +publish: tag postversion commit-postversion + git show -p + git status + @echo + @echo 'Run `git push --follow-tags` if you are satisfied with the changes.' + +.PHONY: tag +tag: + git tag -a v${version} -m "New release v${version}" + +.PHONY: postversion +postversion: + sed -i.bak "s/^__version__ = .*$$/__version__ = '${version}.post0'/" ../../lib/ansible/release.py + rm ../../lib/ansible/release.py.bak + +.PHONY: commit-postversion +commit-postversion: + git add ../../lib/ansible/release.py + git commit -m "Update Ansible release version to v${version}."