Skip to content

Commit

Permalink
Merge pull request #11 from johnsonandjohnson/5-set-up-workflow-to-up…
Browse files Browse the repository at this point in the history
…load-to-pypi

5 set up workflow to upload to pypi
  • Loading branch information
sara-von-hein-shaw authored Jan 26, 2023
2 parents 3fbf41f + 21fce9b commit 53e744e
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
- name: Run Packaging Step
shell: bash -l {0}
run: |
python -m pip install --user --upgrade setuptools wheel && python setup.py sdist bdist_wheel && python -m pip install --user dist/nlprov-1.0.0-py3-none-any.whl && python -m spacy download en_core_web_sm && python nlp_example.py
python -m pip install --user --upgrade setuptools wheel && python setup.py sdist bdist_wheel && python -m pip install --user dist/nlprov-1.1.0-py3-none-any.whl && python -m spacy download en_core_web_sm && python nlp_example.py
39 changes: 39 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PyPI Release

on:
release:
types: [created]

jobs:
deploy:
name: Build and publish to PyPI and TestPyPI
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 pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TESTPYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN python -m pip install --user --upgrade setuptools wheel

RUN python setup.py sdist bdist_wheel

RUN python -m pip install --user dist/nlprov-1.0.0-py3-none-any.whl
RUN python -m pip install --user dist/nlprov-1.1.0-py3-none-any.whl

RUN python -m spacy download en_core_web_sm

Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='nlprov',
version='1.0.0',
version='1.1.0',
description='A Python package for common Natural Language Processing tasks',
long_description=readme,
long_description_content_type='text/markdown',
Expand All @@ -36,3 +36,6 @@
tests_require=['pytest'],
python_requires='>=3.7'
)


# https://github.com/tomchen/example_pypi_package/blob/d50c61f1317c0cc7d1fc8927d666da7355732c61/README.md
2 changes: 1 addition & 1 deletion tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -408,4 +408,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}

0 comments on commit 53e744e

Please sign in to comment.