diff --git a/.forgejo/workflows/pypi-publish.yml b/.forgejo/workflows/pypi-publish.yml new file mode 100644 index 0000000..bb1763e --- /dev/null +++ b/.forgejo/workflows/pypi-publish.yml @@ -0,0 +1,38 @@ +name: Publish to PyPI + +on: + push: + branches: [main, master] + workflow_dispatch: + +env: + PYTHON_VERSION: '3.12' + REGISTRY_URL: 'https://forge.nasty.sh/api/packages/lilith/pypi/' + +jobs: + publish: + name: Build and Publish + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Install build tools + run: | + python -m pip install --upgrade pip + pip install build twine + + - name: Build package + run: python -m build + + - name: Publish to Forgejo PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + TWINE_REPOSITORY_URL: ${{ env.REGISTRY_URL }} + run: twine upload dist/*