Skip to content

Commit

Permalink
Update python-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lord-dubious authored Apr 3, 2024
1 parent 08330bc commit b8925fd
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
name: Publish Python 🐍 distributions 📦 to PyPI
name: Build and Upload to PyPI

on:
push:
branches:
- main # Adjust to your main branch name

on: push
jobs:
build-and-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
build:
runs-on: ubuntu-latest

steps:
- name: Check out repository code
uses: actions/checkout@v4.1.1
- name: Checkout Repository
uses: actions/checkout@v2

# Setup Python (faster than using Python container)
- name: Setup Python
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
python-version: 3.x # Specify the Python version you're using

- name: Install pipenv
- name: Install Dependencies
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 -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
- name: Build Package
run: |
pipenv install --deploy --dev
- name: Build a binary wheel and a source tarball
python setup.py sdist bdist_wheel
- name: Upload to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
pipenv run build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
python -m twine upload --skip-existing dist/*

0 comments on commit b8925fd

Please sign in to comment.