9
9
tags :
10
10
- ' *'
11
11
12
+ concurrency :
13
+ group : ${{ github.ref }}
14
+ cancel-in-progress : true
15
+
12
16
jobs :
13
17
check :
14
18
runs-on : ubuntu-latest
@@ -49,13 +53,38 @@ jobs:
49
53
pip --disable-pip-version-check install -e .
50
54
pip --disable-pip-version-check install -r docs/requirements.txt
51
55
cd docs && make clean html SPHINXOPTS="-W --keep-going"
52
-
56
+
57
+ #
58
+ # Build a wheel
59
+ #
60
+
61
+ build :
62
+ runs-on : ubuntu-22.04
63
+ steps :
64
+ - uses : actions/checkout@v3
65
+ with :
66
+ submodules : recursive
67
+ fetch-depth : 0
68
+
69
+ - uses : actions/setup-python@v4
70
+ with :
71
+ python-version : 3.8
72
+
73
+ - run : pipx run build
74
+
75
+ - name : Upload build artifacts
76
+ uses : actions/upload-artifact@v3
77
+ with :
78
+ name : dist
79
+ path : dist
80
+
53
81
test :
82
+ needs : [build]
54
83
runs-on : ${{ matrix.os }}
55
84
strategy :
56
85
matrix :
57
86
os : [windows-latest, macos-latest, ubuntu-20.04]
58
- python_version : [3.6, 3.7, 3.8, 3.9, "3.10"]
87
+ python_version : [3.6, 3.7, 3.8, 3.9, "3.10", "3.11", "3.12" ]
59
88
architecture : [x86, x64]
60
89
exclude :
61
90
- os : macos-latest
@@ -74,14 +103,14 @@ jobs:
74
103
python-version : ${{ matrix.python_version }}
75
104
architecture : ${{ matrix.architecture }}
76
105
77
- - name : Install build dependencies
78
- run : python -m pip --disable-pip-version-check install wheel
79
-
80
- - name : Build wheel
81
- run : python setup.py bdist_wheel
106
+ - name : Download build artifacts
107
+ uses : actions/download-artifact@v3
108
+ with :
109
+ name : dist
110
+ path : dist
82
111
83
112
- name : Install test dependencies
84
- run : python -m pip --disable-pip-version-check install pytest pcpp
113
+ run : python -m pip --disable-pip-version-check install -r tests/requirements.txt
85
114
86
115
- name : Test wheel
87
116
shell : bash
@@ -94,23 +123,16 @@ jobs:
94
123
publish :
95
124
runs-on : ubuntu-latest
96
125
needs : [check, check-mypy, check-doc, test]
126
+ permissions :
127
+ id-token : write
97
128
if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
98
129
99
130
steps :
100
- - uses : actions/checkout@v3
131
+ - name : Download build artifacts
132
+ uses : actions/download-artifact@v3
101
133
with :
102
- submodules : recursive
103
- fetch-depth : 0
104
-
105
- - uses : actions/setup-python@v4
106
- with :
107
- python-version : 3.8
108
- - run : pip --disable-pip-version-check install wheel
134
+ name : dist
135
+ path : dist
109
136
110
- - name : Build packages
111
- run : python setup.py sdist bdist_wheel
112
137
- name : Publish to PyPI
113
- uses : pypa/gh-action-pypi-publish@master
114
- with :
115
- user : __token__
116
- password : ${{ secrets.PYPI_PASSWORD }}
138
+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments