-
-
Notifications
You must be signed in to change notification settings - Fork 154
40 lines (35 loc) · 1000 Bytes
/
release-pypi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: PyPI Release
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/[email protected]
- name: Pull all release assets
uses: robinraju/[email protected]
with:
releaseId: ${{ github.event.release.id }}
fileName: "*"
tarBall: false
zipBall: false
out-file-path: "dist"
- name: Verify release attestation
env:
GH_TOKEN: ${{ github.token }}
run: |
for fname in dist/*; do
if gh attestation verify $fname -R ${{ github.repository }}; then
echo "[ALLOWED] $fname"
else
rm $fname
echo "[DELETED] $fname"
fi
done
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1