@@ -23,36 +23,29 @@ defaults:
23
23
24
24
jobs :
25
25
build :
26
- runs-on : ${{ matrix.os }}
27
- strategy :
28
- matrix :
29
- os : ["ubuntu-latest"]
30
- python-version : ["3.11"]
26
+ name : Build & verify package
27
+ runs-on : ubuntu-latest
28
+ permissions :
29
+ attestations : write
30
+ id-token : write
31
31
steps :
32
32
- uses : actions/checkout@v4
33
- - uses : actions/setup-python@v5
34
33
with :
35
- python-version : ${{ matrix.python-version }}
36
- - name : " Install build dependencies"
37
- run : pip install --upgrade build twine
38
- - name : " Install test dependencies on tag"
39
- run : pip install --upgrade tools/schemacode[all]
34
+ fetch-depth : 0
35
+ - name : Install the latest version of uv
36
+ uses : astral-sh/setup-uv@v6
40
37
if : ${{ startsWith(github.ref, 'refs/tags/schema-') }}
41
38
- name : " Build archive on tag"
42
39
run : |
43
- python -m pytest -k make_archive
40
+ uv run --extra=tests pytest -k make_archive
44
41
working-directory : tools/schemacode
45
42
env :
46
43
BIDSSCHEMATOOLS_RELEASE : 1
47
44
if : ${{ startsWith(github.ref, 'refs/tags/schema-') }}
48
- - name : " Build source distribution and wheel"
49
- run : python -m build tools/schemacode
50
- - name : " Check distribution metadata"
51
- run : twine check tools/schemacode/dist/*
52
- - uses : actions/upload-artifact@v4
45
+ - uses : hynek/build-and-inspect-python-package@v2
53
46
with :
54
- name : dist
55
- path : tools/schemacode/dist/
47
+ path : tools/schemacode
48
+ attest-build-provenance-github : ${{ github.event_name != 'pull_request' }}
56
49
57
50
test :
58
51
runs-on : ${{ matrix.os }}
83
76
- name : " Fetch packages"
84
77
uses : actions/download-artifact@v4
85
78
with :
86
- name : dist
87
- path : dist/
79
+ name : Packages
80
+ path : dist
88
81
89
82
- name : " Install package"
90
83
run : |
@@ -104,20 +97,20 @@ jobs:
104
97
if : success()
105
98
106
99
publish :
107
- runs-on : ${{ matrix.os }}
108
100
name : Publish Python Package
109
- needs : [test]
110
101
if : github.event_name == 'push'
111
- strategy :
112
- matrix :
113
- os : ["ubuntu-latest"]
114
- python-version : ["3.11"]
102
+ runs-on : ubuntu-latest
103
+ needs : [test]
104
+ permissions :
105
+ attestations : write
106
+ id-token : write
107
+
115
108
steps :
116
- - name : " Fetch packages"
109
+ - name : Download packages built by build-and-inspect-python-package
117
110
uses : actions/download-artifact@v4
118
111
with :
119
- name : dist
120
- path : dist/
112
+ name : Packages
113
+ path : dist
121
114
- name : " Test PyPI upload"
122
115
uses : pypa/gh-action-pypi-publish@release/v1
123
116
with :
@@ -128,9 +121,6 @@ jobs:
128
121
- name : " Upload to PyPI (on tags)"
129
122
if : startsWith(github.ref, 'refs/tags/schema-')
130
123
uses : pypa/gh-action-pypi-publish@release/v1
131
- with :
132
- user : __token__
133
- password : ${{ secrets.PYPI_API_TOKEN }}
134
124
135
125
validate_schema :
136
126
runs-on : ubuntu-latest
0 commit comments