Skip to content

Commit

Permalink
Automatic PyPI packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Olsen committed Mar 25, 2022
1 parent 1bd791a commit 3d73817
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,20 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
python-version: 3.8

- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- id: cache-pipenv
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
python3 -m pip install --upgrade pip
python3 -m pip install setuptools wheel twice

- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --python python3.8 --deploy --dev
- name: Build a binary wheel and a source tarball
# Upload to TestPyPI
- name: Build and Upload to TestPyPI
run: |
pipenv run build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_REPOSITORY: pypi

0 comments on commit 3d73817

Please sign in to comment.