[tor-commits] [sbws/maint-1.1] fix: scripts: Change Github by Gitlab
juga at torproject.org
juga at torproject.org
Tue Aug 11 13:51:35 UTC 2020
commit 58f71fabe181952e372a72123a47d9276efdaa3f
Author: juga0 <juga at riseup.net>
Date: Fri Jul 17 09:38:42 2020 +0000
fix: scripts: Change Github by Gitlab
releases can live now in gitlab.tpo, instead of github.com and
there is no need to check them since Gitlab is FLOSS and gitlab.tpo is
hosted by Tor Project.
Also, stop assuming which is the current branch and remote and do not
push. Instead guide the maintainer to do it.
---
scripts/maint/release.py | 55 +++++++++++++-----------------------------------
1 file changed, 15 insertions(+), 40 deletions(-)
diff --git a/scripts/maint/release.py b/scripts/maint/release.py
index 01e63e8..ee1c904 100755
--- a/scripts/maint/release.py
+++ b/scripts/maint/release.py
@@ -13,7 +13,7 @@ It will:
commit it and commit changelog
4. Create a version with the tag and sign it
5. Push the commit and tag to the repository
-6. Obtain the release tarball from Github
+6. Obtain the release tarball
7. Sign the release tarball
8. Modify the program to the next prerelease version and commit it
9. Push the commit
@@ -23,10 +23,8 @@ All in sequence and doesn't recover from any previous step.
It assumes that:
- the program version is in ``__init__.py.__version__``
- gitchangelog and semantic_version are installed
-- we are in the master branch
-- the remote repository to push is origin
- the next prerelease version is the release version + "-dev0"
-- the official releases tarballs are in Github (because no access to dist.tpo)
+- the official tarball releases are at gitlab.torproject.org
- the key to sign the release is only one and is available in the system
"""
@@ -130,45 +128,22 @@ def main(args):
'-m', '"Release version {}."'.format(release_version)])
print("\n5. Push commit and tag")
- print("----------------------")
- print("\nPush now so that the Github tarball will have the"
- " correct tag...")
- input("Press enter when you are sure everything is correct.")
- subprocess.call(['git', 'push', 'origin', 'master'])
-
- # While we use Github releases and not dist.tpo
- print("\n6. Create release tarball")
- print("-------------------------")
-
- print("\nCreating a release tarball...")
- subprocess.call(
- "git archive --format=tar.gz --prefix=sbws-{}/ "
- "-o v{}.tar.gz v{}"
- .format(release_version, release_version, release_version).split(' ')
- )
- print("\nCreating tarball hash file...")
- fd = open('v{}.tar.gz.sha256'.format(release_version), 'w')
- subprocess.call("sha256sum v{}.tar.gz".format(release_version).split(' '),
- stdout=fd)
- fd.close()
-
- print("Obtaining Github tarball...")
- # This will overwrite local tarball, but that's fine since the hash file
- # won't be overwritten.
+ print("------------------------")
+ print("\nPush now so that the Gitlab creates the tarball from the new "
+ " commit and tag, eg:")
+ print("git push myremote mybranch")
+ print("git push myremote --tags")
+ input("Press enter when you are done.")
+
+ print("\n6. Obtain the release tarball")
+ print("-------------------------------")
+ print("Obtaining Gitlab tarball...")
subprocess.call(
- "wget https://github.com/torproject/sbws/archive/v{}.tar.gz "
+ "wget https://gitlab.torproject.org/tpo/network-health/sbws/-/archive/v{}/sbws-v{}.tar.gz "
"-O v{}.tar.gz"
- .format(release_version, release_version).split(' ')
+ .format(release_version, release_version, release_version).split(' ')
)
- print("Verifying Github tarball and local one are the same...")
- try:
- subprocess.check_call("sha256sum -c v{}.tar.gz.sha256"
- .format(release_version).split(' '))
- except subprocess.CalledProcessError:
- print("Tarballs are not the same")
- sys.exit(1)
-
print("\n7. Create the tarball signature")
print("-------------------------------")
print("Creating detached signature...")
@@ -178,7 +153,7 @@ def main(args):
.format(keyid, release_version, release_version)
.split(' '))
- print("\nUpload the signature manually to Github.")
+ print("\nUpload the signature manually to Gitlab.")
input("Press enter when done.")
print("\nRelease done!!!.")
More information about the tor-commits
mailing list