-
-
Notifications
You must be signed in to change notification settings - Fork 507
118 lines (118 loc) · 3.23 KB
/
python-build.yml
File metadata and controls
118 lines (118 loc) · 3.23 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Python Tests
run-name: Run Tests by ${{ github.actor }}
on: [push, pull_request, workflow_dispatch]
jobs:
tests:
env:
FORCE_COLOR: 1
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: Check out repository code
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Install prereq
run: pip install tox coveralls
- name: Run python tests
run: tox -e ${{ matrix.python }}
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true
run: coveralls
coveralls:
name: Indicate completion to coveralls.io
needs: tests
runs-on: ubuntu-latest
container: python:3-slim
permissions:
contents: read
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docs:
strategy:
matrix:
toxenv: ["docs", "readme"]
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- run: sudo apt install -y graphviz
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Check out repository code
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Install prereq
run: pip install tox
- name: Run python tests
run: tox -e ${{ matrix.toxenv }}
build:
name: Build oauthlib distribution
needs:
- tests
- docs
- coveralls
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Check out repository code
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build wheel and tarball
run: python3 -m build
- name: Store the package's artifact
uses: actions/upload-artifact@v5
with:
name: python-package-distributions
path: dist/
pypi-publish:
if: success() && github.repository == 'oauthlib/oauthlib' && github.ref_type == 'tag'
needs:
- build
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/oauthlib
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: python-package-distributions
path: dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1