-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.githubbuild_and_publish.yaml
72 lines (62 loc) · 1.82 KB
/
.githubbuild_and_publish.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Build-and-Publish
on:
push:
pull_request:
jobs:
# Build job. Builds source distribution (sdist) and binary wheels distribution (bdist_wheel)
build:
name: Build ${{ matrix.dist }} [${{ matrix.python-version }} | ${{ matrix.os }} ${{ matrix.architecture }}]
strategy:
fail-fast: false
matrix:
os: [windows-latest]
include:
- os: windows-latest
python-version: 3.9
dist: sdist bdist_wheel
architecture: x64
target: Windows
runs-on: ${{ matrix.os }}
env:
PYTHONUNBUFFERED: 1
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Build
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
python -m pip install --upgrade cython
python setup.py ${{ matrix.dist }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: publish_dist
# Deploy job. Uploads distribution to PyPI (only on tags)
deploy:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
env:
PYTHONUNBUFFERED: 1
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Publish to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: publish_dist/