-
Notifications
You must be signed in to change notification settings - Fork 41
60 lines (47 loc) · 1.22 KB
/
publish_to_pypi.yaml
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
55
56
57
58
59
60
name: Publish PyPI Release
on:
release:
types: [published]
jobs:
build-dists:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: python -m pip install build twine
- name: Build Dists
run: python -m build .
- name: Check Dists (twine)
run: twine check dist/*
- uses: actions/upload-artifact@v3
with:
name: packages
path: dist/*
publish_pypi:
needs: [build-dists]
runs-on: ubuntu-latest
environment: publish
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: packages
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
publish_release_asset:
needs: [build-dists]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: packages
path: dist
- name: Publish to GitHub Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ github.ref_name }}" dist/*