-
Notifications
You must be signed in to change notification settings - Fork 261
81 lines (72 loc) · 2.27 KB
/
deploy.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
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Deploy
on:
push:
pull_request:
types: [opened, synchronize, reopened, edited]
jobs:
release-check:
runs-on: ubuntu-20.04
continue-on-error: ${{ startsWith(github.event.ref,'refs/heads/') }}
steps:
- uses: actions/checkout@v2
- name: Run release_checklist
run: |
admin/release_checklist 5.0
deploy:
runs-on: ubuntu-18.04
needs: release-check
env:
PYTHON_VERSION: "3.8"
CC: "gcc-8"
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('noxfile.py', 'doc/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install GCC
run: |
sudo apt update
sudo apt-get install -y make $CC $(echo $CC | sed -e 's/gcc/g\+\+/')
sudo apt-get clean
- name: Install ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Install dependencies
run: |
python -m pip install nox
- name: Lint with flake8
run: |
nox --non-interactive --session lint
- name: Test with pytest
run: |
nox --non-interactive --session "tests_compiler($CC)"
- name: Generate documentation
run: |
nox --non-interactive --session doc
- name: Build
run: |
nox --non-interactive --session build_wheel
- name: Upload distribution
if: ${{ success() }}
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/**
- name: Publish
if: ${{ success() && startsWith(github.event.ref,'refs/tags/') }}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m nox --session upload_wheel