@@ -32,55 +32,55 @@ jobs:
3232 - name : Install dependencies
3333 run : pip install tox
3434 - name : Run tests
35- run : tox -e py
35+ run : tox run -e py
3636
3737 tests-misc :
3838 runs-on : ubuntu-latest
3939 strategy :
4040 matrix :
41- env : [generate-integration-files, type, lint, format]
41+ env :
42+ - build
43+ - format
44+ - generate-integration-files
45+ - lint
46+ - type
4247 steps :
4348 - uses : actions/checkout@v5
49+ with :
50+ # build env: fetch all commits for version computation
51+ fetch-depth : ${{ matrix.env == 'build' && '0' || '1' }}
4452 - name : Setup Python
4553 uses : actions/setup-python@v6
4654 with :
4755 python-version : " 3.11"
4856 - name : Install dependencies
4957 run : pip install tox
5058 - name : Run ${{ matrix.env }}
51- run : tox -e ${{ matrix.env }}
52-
53- build :
54- needs : [tests-py, tests-misc]
55- runs-on : ubuntu-latest
56- steps :
57- - uses : actions/checkout@v5
58- with :
59- # fetch all commits for setuptools_scm
60- fetch-depth : 0
61- - name : Setup Python
62- uses : actions/setup-python@v6
63- with :
64- python-version : " 3.11"
65- - name : Build
66- run : python setup.py sdist bdist_wheel
67- - name : Save build artifacts
59+ run : tox run -e ${{ matrix.env }}
60+ - if : ${{ matrix.env == 'build' }}
61+ name : Save ${{ matrix.env }} artifacts
6862 uses : actions/upload-artifact@v4
6963 with :
70- name : dist
64+ name : ${{ matrix.env }}
7165 path : dist
7266
7367 publish :
7468 if : startsWith(github.ref, 'refs/tags')
75- needs : build
69+ needs :
70+ - tests-py
71+ - tests-misc
7672 runs-on : ubuntu-latest
73+ environment : publish
74+ permissions :
75+ id-token : write # This permission is mandatory for trusted publishing
7776 steps :
7877 - name : Restore build artifacts
7978 uses : actions/download-artifact@v5
8079 with :
81- name : dist
80+ name : build
8281 path : dist
8382 - name : Publish to PyPI
8483 uses : pypa/gh-action-pypi-publish@release/v1
8584 with :
86- password : ${{ secrets.pypi_password }}
85+ verbose : true
86+ print-hash : true
0 commit comments