-
Notifications
You must be signed in to change notification settings - Fork 13
42 lines (33 loc) · 928 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
40
41
42
name: Code CI
on:
push:
pull_request:
jobs:
dist:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build sdist and wheel
run: pipx run build
- name: Upload sdist and wheel as artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
pypi:
# upload to PyPI and make a release on every tag
if: github.ref_type == 'tag'
needs: [dist]
runs-on: ubuntu-latest
permissions:
# this permission is mandatory for trusted publishing To PyPI
id-token: write
# Specify the GitHub Environment to publish to
environment: release
steps:
# download sdist and wheel from dist job
- uses: actions/download-artifact@v4
# publish to PyPI using trusted publishing
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1