Skip to content

Support alpha version on PyPI #4

Support alpha version on PyPI

Support alpha version on PyPI #4

Workflow file for this run

name: Publish to PyPI
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+.alpha[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
jobs:
build-and-publish:
name: publish to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools build twine
- name: Build dists
run: |
python -m build
- name: Publish distribution to Test Pypi
if: startsWith(github.ref, 'refs/tags') && contains(github.ref, '-rc')
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to Pypi
if: startsWith(github.ref, 'refs/tags') && !contains(github.ref, '-rc')
uses: pypa/gh-action-pypi-publish@release/v1