Skip to content

Add pushes to test pypi deployment branches as trigger for test PyPI … #1

Add pushes to test pypi deployment branches as trigger for test PyPI …

Add pushes to test pypi deployment branches as trigger for test PyPI … #1

name: pypi_test_upload
on:
workflow_dispatch:
push:
# branches to consider in the event; optional, defaults to all
branches:
- pypi-deployment
- test-pypi-deployment
permissions:
contents: read
jobs:
deploy:
# This will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
#
# This job will run when you have tagged a commit, starting with "v*"
# or created a release in GitHub which includes a tag starting with "v*"
# and requires that you have put your twine API key in your
# github secrets (see readme for details)
needs: []
runs-on: ubuntu-latest
if: contains(github.ref, 'tags')
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
run: |
python -m build
twine upload --repository testpypi dist/*