-
Notifications
You must be signed in to change notification settings - Fork 5
executable file
·43 lines (37 loc) · 1.07 KB
/
build_and_release.yml
File metadata and controls
executable file
·43 lines (37 loc) · 1.07 KB
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
name: Publish package to PyPI
on:
release:
types: [created]
jobs:
release:
# if: github.event_name == 'release' && github.event.action == 'created'
name: PyPi Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Checkout repo
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- uses: actions/cache@v1
name: Cache pip dependencies
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install pip dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
python3 -m pip install --upgrade build twine wheel
- name: Make distribution
run: |
python3 setup.py sdist bdist_wheel
twine check dist/*
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}