From e247b9d3305b88a4208f9bf22426df94eb1f1b8e Mon Sep 17 00:00:00 2001 From: Vasundhara Gautam <15020857+vgautam@users.noreply.github.com> Date: Mon, 18 May 2020 13:49:07 -0700 Subject: [PATCH 1/2] Create publish.yml --- .github/workflows/publish.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..cb15134 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish Package to PyPI + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - 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/* From 9a256baf87e34aea59c00ab86dbc9113e2673956 Mon Sep 17 00:00:00 2001 From: vgautam Date: Mon, 18 May 2020 13:54:10 -0700 Subject: [PATCH 2/2] versioning external to the setup file --- VERSION | 1 + setup.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..8acdd82 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.0.1 diff --git a/setup.py b/setup.py index 94608fa..74e2b6c 100644 --- a/setup.py +++ b/setup.py @@ -9,9 +9,12 @@ with open(os.path.join(pkg_root, 'requirements.txt'), 'r', encoding='utf-8') as f: requirements = [r.strip() for r in f.readlines()] +with open(os.path.join(pkg_root, 'VERSION'), 'r', encoding='utf-8') as f: + VERSION = f.read().strip() + setuptools.setup( name='syllabifier', - version='0.0.1', + version=VERSION, description='syllabifier chunks your English ARPABET pronunciations into syllables', long_description=long_description, packages=setuptools.find_packages(where='src', exclude=('tests',)),