Skip to content

feat: Add support for Team APIs (#42) #47

feat: Add support for Team APIs (#42)

feat: Add support for Team APIs (#42) #47

name: Publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI
on:
push:
tags:
- v*
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: |
VERSION_TAG=`echo ${GITHUB_REF_NAME} \
| sed -r 's#v([0-9]+\.[0-9]\.[0-9])#\1#g' \
| sed 's#[^a-zA-Z0-9_\.\-]#_#g'`
echo "tag version = $VERSION_TAG"
VERSION_FILE=$(cat VERSION.txt)
echo "file version = $VERSION_FILE"
if [ "$VERSION_TAG" != "$VERSION_FILE" ]; then
echo "Version in file 'version.py' must be the same as the pushed tag"
exit 1
fi
python -m build --sdist --wheel --outdir dist/
# make this available for test
# - name: Publish distribution πŸ“¦ to Test PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN_V2 }}
# repository_url: https://test.pypi.org/legacy/
- name: Publish distribution πŸ“¦ to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN_V2 }}