Skip to content

Commit 553461f

Browse files
committed
use trusted publishing
1 parent e456095 commit 553461f

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,29 +55,29 @@ jobs:
5555
name: tetgen-sdist
5656
path: dist/*.tar.gz
5757

58-
upload_pypi:
58+
59+
release:
60+
name: Release
61+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
5962
needs: [build_wheels, build_sdist]
6063
runs-on: ubuntu-latest
61-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
64+
environment:
65+
name: pypi
66+
url: https://pypi.org/p/tetgen
67+
permissions:
68+
id-token: write # this permission is mandatory for trusted publishing
6269
steps:
6370
- uses: actions/download-artifact@v4
64-
with:
65-
path: artifacts/
66-
67-
- name: Move wheel files to dist/
71+
- name: Flatten directory structure
6872
run: |
69-
mkdir -p dist
70-
find artifacts -name '*.whl' -exec mv {} dist/ \;
71-
72-
# upload to PyPI
73-
- uses: pypa/gh-action-pypi-publish@v1.8.11
74-
with:
75-
user: __token__
76-
password: ${{ secrets.PYPI_TOKEN }}
77-
78-
- name: Release
73+
mkdir -p dist/
74+
find . -name '*.whl' -exec mv {} dist/ \;
75+
find . -name '*.tar.gz' -exec mv {} dist/ \;
76+
- name: Publish package distributions to PyPI
77+
uses: pypa/gh-action-pypi-publish@release/v1
78+
- name: Create GitHub Release
7979
uses: softprops/action-gh-release@v1
8080
with:
8181
generate_release_notes: true
8282
files: |
83-
./dist/*.whl
83+
./**/*.whl

0 commit comments

Comments
 (0)