-
Notifications
You must be signed in to change notification settings - Fork 16
38 lines (35 loc) · 1.14 KB
/
pypi.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
# This workflow will build, check and deploy to pypi when new tags are pushed
# matching "v*".
# It runs on multiple python3 versions on macOS, Ubuntu and Windows.
# Based on: https://github.com/marketplace/actions/pypi-deployment
name: pypi
# Run on push/PR/manually BUT only uploads with a tag (see below)
on:
push:
tags: ["v*"]
branches: [$default-branch]
pull_request:
workflow_dispatch:
jobs:
pypi_deploy:
strategy:
matrix:
os: ["ubuntu-20.04"]
python-version: ["3.9"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Build, check and deploy to pypi
uses: casperdcl/deploy-pypi@v2
with:
password: ${{ secrets.PYPI_TOKEN }}
# Create source tgz
build: true
# Create wheel
pip: true
# Only upload if a tag is pushed (otherwise just build & check)
upload: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}