misc: Improve tagging script

This way we can push the tag *after* all the builds succeed. If
something goes wrong, we can always delete our local tag and try again.
This commit is contained in:
James Shubin
2019-10-04 06:49:04 -04:00
parent d4043d3f86
commit 6a7d904fae
2 changed files with 5 additions and 7 deletions

View File

@@ -403,6 +403,8 @@ release_ubuntu-bionic: $(PKG_UBUNTU-BIONIC)
release_archlinux: $(PKG_ARCHLINUX) release_archlinux: $(PKG_ARCHLINUX)
releases/$(VERSION)/mgmt-release.url: $(PKG_FEDORA-30) $(PKG_FEDORA-29) $(PKG_DEBIAN-10) $(PKG_UBUNTU-BIONIC) $(PKG_ARCHLINUX) $(SHA256SUMS_ASC) releases/$(VERSION)/mgmt-release.url: $(PKG_FEDORA-30) $(PKG_FEDORA-29) $(PKG_DEBIAN-10) $(PKG_UBUNTU-BIONIC) $(PKG_ARCHLINUX) $(SHA256SUMS_ASC)
@echo "Pushing git tag $(VERSION) to origin..."
git push origin $(VERSION)
@echo "Creating github release..." @echo "Creating github release..."
hub release create \ hub release create \
-F <( echo -e "$(VERSION)\n";echo "Verify the signatures of all packages before you use them. The signing key can be downloaded from https://purpleidea.com/contact/#pgp-key to verify the release." ) \ -F <( echo -e "$(VERSION)\n";echo "Verify the signatures of all packages before you use them. The signing key can be downloaded from https://purpleidea.com/contact/#pgp-key to verify the release." ) \

View File

@@ -33,16 +33,12 @@ if [[ "${h}" == "${v}" ]]; then
exit 0 exit 0
fi fi
# Give the user a chance to abort. # Give the user some information.
echo "WARN: About to tag \"${h}\" as \"${t}\" and push." echo "WARN: About to tag \"${h}\" as \"${t}\" locally."
echo "Press ^C within 3s to abort."
sleep 3s
# Tag and push. # Tag and sign.
echo "release: tag $t" | git tag --file=- --sign $t echo "release: tag $t" | git tag --file=- --sign $t
echo "INFO: Version $t is now tagged." echo "INFO: Version $t is now tagged."
echo "INFO: Pushing $t to origin."
git push origin $t
# Be informative. # Be informative.
GIT_PAGER=cat git diff --stat "$v" "$t" GIT_PAGER=cat git diff --stat "$v" "$t"