-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (52 loc) · 1.59 KB
/
pypi-publish.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Publish releases to PyPI
on:
push:
tags:
- v[0-9]+**
jobs:
package-build:
name: Build and push to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Prep Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install build tools
run: |
python -m pip install build setuptools twine --user
continue-on-error: false
- name: Build wheel
id: wheel
run: |
python -m build --wheel --outdir dist/
continue-on-error: true
- name: Build source distribution
id: sdist
run: |
python -m build --sdist --outdir dist/
continue-on-error: true
- name: Check the output
run: |
python -m twine check --strict dist/*
continue-on-error: false
- name: Die on failure
if: steps.wheel.outcome != 'success' && steps.sdist.outcome != 'success'
run: exit 1
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
- name: Get version number
run: |
echo "RVS_VER=v$(cat rvsfunc/.version)" >> $GITHUB_ENV
- name: Make GH release
uses: marvinpinto/action-automatic-releases@v1.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
files: |
LICENSE
dist/*.tar.gz