Skip to content

Merge pull request #311 from bluesky/310-unit-tests #282

Merge pull request #311 from bluesky/310-unit-tests

Merge pull request #311 from bluesky/310-unit-tests #282

Workflow file for this run

name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
on: push
jobs:
pypi:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install OS packages
run: >-
sudo apt-get -y update
&& sudo apt-get install -y libgirepository1.0-dev
- 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: Install twine
run: >-
python -m
pip install
twine
- name: Check package metadata
run: >-
twine check dist/*
# TODO: restrict to tags on main branch only?
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true