Skip to content

Commit

Permalink
nightly build (zhanghang1989#248)
Browse files Browse the repository at this point in the history
* Create pythonpublish.yml

* Update setup.py

* Update pythonpublish.yml

* Update README.md

* Update setup.py
  • Loading branch information
zhanghang1989 committed Apr 4, 2020
1 parent 90c6a95 commit 09bff70
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 9 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pythonpublish.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: Upload Python Package

on:
push:
branches:
- master

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 }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/* --verbose
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[![PyPI](https://img.shields.io/pypi/v/torch-encoding.svg)](https://pypi.python.org/pypi/torch-encoding)
[![PyPI Pre-release](https://img.shields.io/badge/pypi--prerelease-v1.1.0-ff69b4.svg)](https://pypi.org/project/torch-encoding/#history)
[![Upload Python Package](https://github.com/zhanghang1989/PyTorch-Encoding/workflows/Upload%20Python%20Package/badge.svg)](https://github.com/zhanghang1989/PyTorch-Encoding/actions)

# PyTorch-Encoding

created by [Hang Zhang](http://hangzh.com/)
Expand Down
16 changes: 7 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@

cwd = os.path.dirname(os.path.abspath(__file__))

version = '1.0.1'
version = '1.1.1'
try:
sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'],
cwd=cwd).decode('ascii').strip()
version += '+' + sha[:7]
from datetime import date
today = date.today()
day = today.strftime("b%d%m%Y")
version += day
except Exception:
pass

Expand All @@ -47,11 +48,7 @@ def run(self):
setuptools.command.develop.develop.run(self)
#subprocess.check_call("python tests/unit_test.py".split())

try:
import pypandoc
readme = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
readme = open('README.md').read()
readme = open('README.md').read()

requirements = [
'numpy',
Expand Down Expand Up @@ -79,6 +76,7 @@ def run(self):
url="https://github.com/zhanghang1989/PyTorch-Encoding",
description="PyTorch Encoding Package",
long_description=readme,
long_description_content_type='text/markdown',
license='MIT',
install_requires=requirements,
packages=find_packages(exclude=["tests", "experiments"]),
Expand Down

0 comments on commit 09bff70

Please sign in to comment.