Skip to content

Commit

Permalink
master doc build & pypi release (zhanghang1989#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanghang1989 committed May 10, 2020
1 parent b8d83b0 commit 1c4e4a3
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Pypi Release

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine pypandoc
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.pypi_username }}
TWINE_PASSWORD: ${{ secrets.pypi_password }}
RELEASE: 1
run: |
python setup.py sdist bdist_wheel
twine upload dist/* --verbose
2 changes: 1 addition & 1 deletion .github/workflows/sphix_build_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
# https://github.com/marketplace/actions/github-pages
- name: Deploy
if: success()
uses: crazy-max/ghaction-github-pages@master
uses: crazy-max/ghaction-github-pages@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
3 changes: 2 additions & 1 deletion experiments/segmentation/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ def test(args):
outname = os.path.splitext(impath)[0] + '.png'
mask.save(os.path.join(outdir, outname))

print( 'pixAcc: %.4f, mIoU: %.4f' % (pixAcc, mIoU))
if args.eval:
print( 'pixAcc: %.4f, mIoU: %.4f' % (pixAcc, mIoU))

class ReturnFirstClosure(object):
def __init__(self, data):
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@

version = '1.2.0'
try:
from datetime import date
today = date.today()
day = today.strftime("b%Y%m%d")
version += day
if not os.getenv('RELEASE'):
from datetime import date
today = date.today()
day = today.strftime("b%Y%m%d")
version += day
except Exception:
pass

Expand Down

0 comments on commit 1c4e4a3

Please sign in to comment.