Skip to content

Commit

Permalink
💎 [CI] Auto publish to pypi when pyproject changes, and add mannual run
Browse files Browse the repository at this point in the history
  • Loading branch information
Hansimov committed Mar 11, 2024
1 parent 04259b3 commit 9ee2d63
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build package and publish to PyPI
on:
push:
paths:
- "pyproject.toml"
workflow_dispatch:

concurrency:
group: pypi
cancel-in-progress: true

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"

- name: Install dependencies
run: |
python -m pip install --upgrade pip build twine
- name: Build and publish
run: |
python -m build
python -m twine upload dist/* --skip-existing
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

0 comments on commit 9ee2d63

Please sign in to comment.