-
Notifications
You must be signed in to change notification settings - Fork 5
36 lines (34 loc) · 1.04 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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