-
-
Notifications
You must be signed in to change notification settings - Fork 677
82 lines (72 loc) · 2.06 KB
/
build.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Build
on:
push:
branches-ignore:
- data
- gh-pages
tags:
- '**'
pull_request:
branches-ignore:
- data
- gh-pages
workflow_dispatch:
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: [ubuntu-latest, macos-latest, windows-latest] # Build wheels on different systems
# python-version: [3.6, 3.7]
# architecture: [x64]
# dist: [bdist_wheel]
include:
- os: ubuntu-latest # Modify one element to build source distribution
python-version: '3.10'
architecture: x64
dist: sdist bdist_wheel
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 setup.py ${{ matrix.dist }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: 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: dist/