Skip to content

Commit

Permalink
Replace gh workflow with vanilla twine
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 committed Feb 1, 2022
1 parent daee255 commit 19a83cc
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,25 @@ jobs:
uses: actions/checkout@v2

# Setup Python (faster than using Python container)
- name: Setup Python
uses: actions/setup-python@v2
- uses: actions/setup-python@v2
with:
python-version: "3.x"

- 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') }}
python-version: 3.9

- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --deploy --dev
- name: Build a binary wheel and a source tarball
# Upgrade pip
python3 -m pip install --upgrade pip
# Install build deps
python3 -m pip install setuptools wheel twine
# If requirements.txt exists, install from it
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# Install the package from setup.py
python3 setup.py install
- name: Build and publish to PyPI
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 }}

0 comments on commit 19a83cc

Please sign in to comment.