Skip to content

Publish Python

Publish Python #44

Workflow file for this run

name: Publish Python
# on:
# release:
# types: [published]
on:
push:
tags:
- 'v*' # Only triggers on tags starting with 'v', like 'v1.0.0'
jobs:
tests:
name: run tests
uses: ./.github/workflows/unittest.yml
build-n-publish:
name: Build and publish Python 🐍 distributions πŸ“¦ to TestPyPI
needs: [tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
# - name: Publish distribution πŸ“¦ to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_TEST_KEY }}
# repository_url: https://test.pypi.org/legacy/
- name: Publish distribution πŸ“¦ to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_KEY }}