File tree Expand file tree Collapse file tree 1 file changed +1
-49
lines changed Expand file tree Collapse file tree 1 file changed +1
-49
lines changed Original file line number Diff line number Diff line change 1- name : Publish to PyPI
2-
3- on :
4- push :
5- tags :
6- - ' v*'
7-
8- permissions :
9- contents : read
10- id-token : write
11-
12- jobs :
13- test-build-publish :
14- runs-on : ubuntu-latest
15- steps :
16- - name : Check out code
17- uses : actions/checkout@v4
18-
19- - name : Set up Python
20- uses : actions/setup-python@v5
21- with :
22- python-version : ' 3.10'
23-
24- - name : Install dependencies
25- run : |
26- python -m pip install --upgrade pip
27- pip install -r requirements.txt
28- pip install pytest build
29-
30- - name : Run tests (headless)
31- env :
32- MPLBACKEND : Agg
33- run : pytest -q
34-
35- - name : Verify tag matches version
36- run : |
37- VERSION=$(python -c "import re;print(re.search(r"""__version__\s*=\s*'([^']+)'""", open('statclean/__init__.py').read()).group(1))")
38- TAG=${GITHUB_REF_NAME#v}
39- echo "Version: $VERSION | Tag: $TAG"
40- if [ "$VERSION" != "$TAG" ]; then echo "Tag ($TAG) does not match version ($VERSION)" && exit 1; fi
41-
42- - name : Build package
43- run : python -m build
44-
45- - name : Publish to PyPI (Trusted Publisher)
46- uses : pypa/gh-action-pypi-publish@release/v1
47- with :
48- skip-existing : true
491name : Publish to PyPI and GitHub Release
502
513on :
9547 run : python -m build
9648
9749 - name : Publish package distributions to PyPI
98- uses : pypa/gh-action-pypi-publish@release/v1
50+ uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments