-
Notifications
You must be signed in to change notification settings - Fork 4
54 lines (47 loc) · 1.39 KB
/
python-publish-pypi.yaml
File metadata and controls
54 lines (47 loc) · 1.39 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Publish Python 🐍 distributions 📦 to PyPI
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest
permissions:
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Build and inspect Python 🐍 package 📦
uses: hynek/build-and-inspect-python-package@efb823f52190ad02594531168b7a2d5790e66516 # v2.14.0
with:
attest-build-provenance-github: ${{ github.event.action == 'published' }}
publish-to-pypi:
name: Publish Python 🐍 distribution 📦 to PyPI
needs: build
if: ${{ github.event.action == 'published' }}
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/imsosorry/${{ github.ref_name }}
permissions:
id-token: write
steps:
- name: Download dists
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: Packages
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
print-hash: true