Skip to content

Update python-publish.yml #2

Update python-publish.yml

Update python-publish.yml #2

name: Publish Python 🐍 distributions πŸ“¦ to PyPI
on: push
jobs:
build-and-publish:
name: Build and publish Python 🐍 distributions πŸ“¦ to PyPI
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/[email protected]
# Setup Python (faster than using Python container)
- name: Setup Python
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') }}
- 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
run: |
pipenv run build
- name: Publish distribution πŸ“¦ to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}