-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 873 Bytes
/
publish.yml
File metadata and controls
39 lines (34 loc) · 873 Bytes
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
on:
release:
types:
- published
workflow_call:
workflow_dispatch:
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
jobs:
publish-to-pypi:
name: Publish Python distribution to PyPI
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Download all distributions from release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release download
'${{ github.ref_name }}'
-p '*.whl'
-p '*.tar.gz'
--dir dist/
--repo '${{ github.repository }}'
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: true
attestations: false