Skip to content

Publish package to Test PyPI #4

Publish package to Test PyPI

Publish package to Test PyPI #4

Workflow file for this run

name: Publish package to Test PyPI
on:
workflow_dispatch:
inputs:
version:
description: "Version number"
required: true
type: string
jobs:
publish:
if: ${{ github.event_name == 'workflow_dispatch' && github.actor == 'fnberta' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Add version tag
env:
VERSION: ${{ inputs.version }}
run: git tag v$VERSION
- name: Build new package
run: tox run -e build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Archive package
uses: actions/upload-artifact@v3
with:
name: python-package
path: dist/