-
Notifications
You must be signed in to change notification settings - Fork 57
39 lines (36 loc) · 1.08 KB
/
ci.yaml
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
name: Build and test
on:
push:
branches: ['main']
pull_request:
branches: ['main']
release:
types: [ 'created' ]
# This allows a subsequently queued workflow run to interrupt and cancel previous runs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-n-publish:
if: github.event_name == 'release'
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.9'
architecture: 'x64'
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ hashFiles('setup.cfg') }}
- name: Verify Git Tag and package version
run: python3 .github/scripts/verify_tag_and_version.py
- run: pip3 install -U pip wheel build twine
- run: python3 -m build
- run: twine check dist/*
- run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}