File tree Expand file tree Collapse file tree 4 files changed +40
-6
lines changed Expand file tree Collapse file tree 4 files changed +40
-6
lines changed Original file line number Diff line number Diff line change 1+ # This workflows will upload a Python Package using Twine when a release is created
2+ # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+ name : Pypi Release
5+
6+ on :
7+ release :
8+ types : [created]
9+
10+ jobs :
11+ deploy :
12+
13+ runs-on : ubuntu-18.04
14+
15+ steps :
16+ - uses : actions/checkout@master
17+ - name : Set up Python
18+ uses : actions/setup-python@v1
19+ with :
20+ python-version : ' 3.7'
21+ - name : Install dependencies
22+ run : |
23+ python -m pip install --upgrade pip
24+ pip install setuptools wheel twine pypandoc
25+ - name : Build and publish
26+ env :
27+ TWINE_USERNAME : ${{ secrets.pypi_username }}
28+ TWINE_PASSWORD : ${{ secrets.pypi_password }}
29+ RELEASE : 1
30+ run : |
31+ python setup.py sdist bdist_wheel
32+ twine upload dist/* --verbose
Original file line number Diff line number Diff line change 4343 # https://github.com/marketplace/actions/github-pages
4444 - name : Deploy
4545 if : success()
46- uses : crazy-max/ghaction-github-pages@master
46+ uses : crazy-max/ghaction-github-pages@v1
4747 env :
4848 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4949 with :
Original file line number Diff line number Diff line change @@ -178,7 +178,8 @@ def test(args):
178178 outname = os .path .splitext (impath )[0 ] + '.png'
179179 mask .save (os .path .join (outdir , outname ))
180180
181- print ( 'pixAcc: %.4f, mIoU: %.4f' % (pixAcc , mIoU ))
181+ if args .eval :
182+ print ( 'pixAcc: %.4f, mIoU: %.4f' % (pixAcc , mIoU ))
182183
183184class ReturnFirstClosure (object ):
184185 def __init__ (self , data ):
Original file line number Diff line number Diff line change 1818
1919version = '1.2.0'
2020try :
21- from datetime import date
22- today = date .today ()
23- day = today .strftime ("b%Y%m%d" )
24- version += day
21+ if not os .getenv ('RELEASE' ):
22+ from datetime import date
23+ today = date .today ()
24+ day = today .strftime ("b%Y%m%d" )
25+ version += day
2526except Exception :
2627 pass
2728
You can’t perform that action at this time.
0 commit comments