Update python-publish.yml

This commit is contained in:
curly60e 2024-07-27 08:52:42 -03:00 committed by GitHub
parent 918838270a
commit 58c708f3d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,37 +6,45 @@
# separate terms of service, privacy policy, and support
# documentation.
name: Publish to PyPI
name: Publish Python Package
on:
push:
branches:
- main
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 -
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Configure Poetry
run: |
poetry config virtualenvs.in-project true
- name: Install dependencies
run: |
poetry install
- name: Build package
run: |
poetry build
- name: Publish package to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry publish --no-interaction --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}
- name: Publish package to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*