-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (32 loc) · 944 Bytes
/
pypi-publish.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
name: Publish Python 🐍 distributions 📦 to PyPI
on:
release:
types: [published]
workflow_dispatch:
jobs:
build-n-publish:
name: Use PDM to Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@master
with:
submodules: true
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
- name: Install twine
run: python -m pip install twine
- name: Build and Publish distribution 📦 to PyPI
env:
PYPI_USERNAME: "__token__"
PYPI_PASSWORD: ${{ secrets.__token__ }}
run: |
cat > ~/.pypirc << EOF
[pypi]
username = $PYPI_USERNAME
password = $PYPI_PASSWORD
EOF
pdm build
twine upload --skip-existing --repository pypi dist/*