Mercurial > piecrust2
comparison garcon/pypi.py @ 1005:2e5c5d33d62c
Merge changes.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 21 Nov 2017 22:07:12 -0800 |
parents | 22cf13b86cc3 112ff1ab110c |
children | a013a3bea22a |
comparison
equal
deleted
inserted
replaced
1004:4f2e0136123d | 1005:2e5c5d33d62c |
---|---|
1 import re | |
1 from invoke import task, run | 2 from invoke import task, run |
2 | 3 |
3 | 4 |
4 @task | 5 @task |
5 def makerelease(ctx, version, local_only=False): | 6 def makerelease(ctx, version, local_only=False): |
12 print("Install Bower components") | 13 print("Install Bower components") |
13 run("bower install") | 14 run("bower install") |
14 print("Generating FoodTruck assets") | 15 print("Generating FoodTruck assets") |
15 run("gulp") | 16 run("gulp") |
16 | 17 |
18 # See if any asset was modified and needs to be submitted. | |
19 r = run('hg status', hide=True) | |
20 if re.match(r'^[R\!] ', r.stdout): | |
21 raise Exception("FoodTruck assets are missing or were removed!") | |
22 | |
23 commit_assets = False | |
24 if re.match(r'^[MA] ', r.stdout): | |
25 commit_assets = True | |
26 | |
17 # CHANGELOG.rst and documentation changelog page. | 27 # CHANGELOG.rst and documentation changelog page. |
18 run("invoke changelog --last %s" % version) | 28 run("invoke changelog --last %s" % version) |
19 run("invoke changelog --last %s -o docs/pages/support/changelog.md" % | 29 run("invoke changelog --last %s -o docs/pages/support/changelog.md" % |
20 version) | 30 version) |
21 | 31 |
22 if not local_only: | 32 if not local_only: |
33 if commit_assets: | |
34 res = run('hg status piecrust/admin/static') | |
35 if not res: | |
36 return | |
37 if res.stdout.strip() != '': | |
38 run('hg commit piecrust/admin/static ' | |
39 '-m "admin: Regenerate FoodTruck assets."') | |
40 | |
23 # Submit the CHANGELOG. | 41 # Submit the CHANGELOG. |
24 run('hg commit CHANGELOG.rst docs/pages/support/changelog.md ' | 42 run('hg commit CHANGELOG.rst docs/pages/support/changelog.md ' |
25 '-m "cm: Regenerate the CHANGELOG."') | 43 '-m "cm: Regenerate the CHANGELOG."') |
26 | 44 |
27 # Tag in Mercurial, which will then be used for PyPi version. | 45 # Tag in Mercurial, which will then be used for PyPi version. |
29 | 47 |
30 # PyPi upload. | 48 # PyPi upload. |
31 run("python setup.py version") | 49 run("python setup.py version") |
32 run("python setup.py sdist upload") | 50 run("python setup.py sdist upload") |
33 else: | 51 else: |
52 if commit_assets: | |
53 print("Would submit FoodTruck assets...") | |
34 print("Would submit changelog files...") | 54 print("Would submit changelog files...") |
35 print("Would tag repo with %s..." % version) | 55 print("Would tag repo with %s..." % version) |
36 print("Would upload to PyPi...") | 56 print("Would upload to PyPi...") |
37 | 57 |