4848 - name : Upload artifact
4949 uses : actions/upload-artifact@v4
5050 with :
51- name : wheelhouse -${{ strategy.job-index }}
51+ name : cibw-wheels -${{ strategy.job-index }}
5252 path : ./wheelhouse/*.whl
5353
5454 build_sdist :
@@ -71,33 +71,50 @@ jobs:
7171 - name : Upload artifact
7272 uses : actions/upload-artifact@v4
7373 with :
74- name : dist -${{ strategy.job-index }}
74+ name : cibw-sdist -${{ strategy.job-index }}
7575 path : dist/*.tar.gz
7676
7777 publish :
78- name : ' Upload to PyPI/TestPyPI'
79- runs-on : ubuntu-20.04
8078 needs : [build_wheels, build_sdist]
79+ environment : pypi
80+ permissions :
81+ id-token : write
82+ runs-on : ubuntu-latest
83+ if : github.event_name == 'release' && github.event.action == 'published'
8184 steps :
82- - name : Set up Python
83- uses : actions/setup-python@v5
84- with :
85- python-version : ' 3.9'
85+ - uses : actions/download-artifact@v4
86+ with :
87+ pattern : cibw-*
88+ path : dist
89+ merge-multiple : true
8690
87- - name : Set up built items
88- uses : actions/download-artifact@v4
89- with :
90- name : artifact
91- path : dist
91+ - uses : pypa/gh-action-pypi-publish@release/v1
9292
93- - name : Install dependencies
94- run : |
95- python -m pip install --upgrade pip
96- pip install setuptools wheel twine
93+ # publish:
94+ # name: 'Upload to PyPI/TestPyPI'
95+ # runs-on: ubuntu-20.04
96+ # needs: [build_wheels, build_sdist]
97+ # steps:
98+ # - name: Set up Python
99+ # uses: actions/setup-python@v5
100+ # with:
101+ # python-version: '3.9'
97102
98- - name : Publish
99- env :
100- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
101- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
102- run : |
103- twine upload --verbose --repository ${{ github.event.inputs.repository }} dist/*
103+ # - name: Set up built items
104+ # uses: actions/download-artifact@v4
105+ # with:
106+ # pattern: cibw-*
107+ # path: dist
108+ # merge-multiple: true
109+
110+ # - name: Install dependencies
111+ # run: |
112+ # python -m pip install --upgrade pip
113+ # pip install setuptools wheel twine
114+
115+ # - name: Publish
116+ # env:
117+ # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
118+ # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
119+ # run: |
120+ # twine upload --verbose --repository ${{ github.event.inputs.repository }} dist/*
0 commit comments