Update release scripts to use git instead of svn
This commit is contained in:
parent
9812b27fb0
commit
a5b0e34dea
2 changed files with 37 additions and 7 deletions
|
|
@ -6,6 +6,7 @@
|
|||
import sys
|
||||
import string
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
def failed():
|
||||
print "mkdist.py failed to complete"
|
||||
|
|
@ -34,10 +35,42 @@ os.system("rm -f "+dirname+".tar.gz")
|
|||
print "Removing "+dirname+".tar.gz if exists"
|
||||
os.system("rm -f "+dirname+".tar")
|
||||
|
||||
# Do a SVN export into the directory name
|
||||
# Grab the code from git
|
||||
|
||||
print "Grabbing latest SWIG from svn"
|
||||
os.system("svn export -r HEAD https://swig.svn.sourceforge.net/svnroot/swig/trunk "+dirname) == 0 or failed()
|
||||
print "Checking git repository is in sync with remote repository"
|
||||
os.system("git remote update") == 0 or failed()
|
||||
command = ["git", "status", "--porcelain", "-uno"]
|
||||
out = subprocess.check_output(command)
|
||||
if out.strip() != "":
|
||||
print "Local git repository has modifications"
|
||||
print " ".join(command)
|
||||
print out
|
||||
sys.exit(3)
|
||||
|
||||
command = ["git", "log", "--oneline", "master..origin/master"]
|
||||
out = subprocess.check_output(command)
|
||||
if out.strip() != "":
|
||||
print "Remote repository has additional modifications to local repository"
|
||||
print " ".join(command)
|
||||
print out
|
||||
sys.exit(3)
|
||||
|
||||
command = ["git", "log", "--oneline", "origin/master..master"]
|
||||
out = subprocess.check_output(command)
|
||||
if out.strip() != "":
|
||||
print "Local repository has modifications not pushed to the remote repository"
|
||||
print "These should be pushed and checked that they pass Continuous Integration testing before continuing"
|
||||
print " ".join(command)
|
||||
print out
|
||||
sys.exit(3)
|
||||
|
||||
print "Tagging release"
|
||||
tag = "'rel-" + version + "'"
|
||||
os.system("git tag -a -m " + tag + " " + tag) == 0 or failed()
|
||||
|
||||
print "Grabbing tagged release git repository using 'git archive' into " + outdir
|
||||
outdir = os.path.basename(os.getcwd()) + "/" + dirname + "/"
|
||||
os.system("(cd .. && git archive --prefix=" + outdir + tag + " . | tar -xf -)") == 0 or failed()
|
||||
|
||||
# Remove the debian directory -- it's not official
|
||||
|
||||
|
|
|
|||
|
|
@ -43,9 +43,6 @@ os.system("cat swig-" + version + "/README " + "swig-" + version + "/CHANGES.cur
|
|||
os.system("rsync --archive --verbose -P --times -e ssh " + "swig-" + version + ".tar.gz " + full_readme_file + " " + swig_dir_sf) and failed("")
|
||||
os.system("rsync --archive --verbose -P --times -e ssh " + "swigwin-" + version + ".zip " + full_readme_file + " " + swigwin_dir_sf) and failed("")
|
||||
|
||||
print "Tagging release"
|
||||
os.system("svn copy -m \"rel-" + version + "\" https://swig.svn.sourceforge.net/svnroot/swig/trunk https://swig.svn.sourceforge.net/svnroot/swig/tags/rel-" + version + "/")
|
||||
|
||||
print "Finished"
|
||||
|
||||
print "Now log in to SourceForge and set the operating systems applicable to the newly uploaded tarball and zip file."
|
||||
print "Now log in to SourceForge and set the operating systems applicable to the newly uploaded tarball and zip file. Also remember to do a 'git push'."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue