Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# See also https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

name: "Build and upload to PyPI"
on:
workflow_call:
inputs:
repository:
description: "The package repository to upload to. Defaults to 'testpypi'; use 'pypi' for the regular package index."
type: string
required: false
default: "testpypi"
secrets:
PYPI_API_TOKEN:
required: true

jobs:
build:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"

- uses: "actions/setup-python@v2"
with:
python-version: "3.x"

- name: "Install packaging tools"
run: "python -m pip install build twine"

- name: "Build dist package"
run: "python -m build"

- name: "Upload to PyPI"
run: "python -m twine upload dist/*"
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: "${{ secrets.PYPI_API_TOKEN }}"
TWINE_REPOSITORY: "${{ inputs.repository }}"