Skip to content

Publish to Test PyPi #13

Publish to Test PyPi

Publish to Test PyPi #13

name: Publish to Test PyPi
on:
workflow_dispatch:
jobs:
build:
name: Build distro
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
run: |
python3 -m pip install --upgrade pip
python3 -m pip install build --user
- name: Build binary wheel and source tarbell
run: python3 -m build
- name: Store distribution package
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish-to-testpypi:
name: Publish distro to TestPyPI
needs:
- build
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/patcherctl
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution package to TestPyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/