-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 933 Bytes
/
pypi-package.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
43
44
45
46
---
name: Build and verify package, with optional upload to PyPI
on:
push:
branches: [main]
tags: ["*"]
pull_request:
branches: [main]
release:
types:
- published
permissions:
contents: read
id-token: write
jobs:
build-package:
name: Build and verify package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
show-progress: false
- uses: hynek/build-and-inspect-python-package@v2
release-pypi:
name: Publish released package to PyPI
environment: release-pypi
if: github.event.action == 'published'
runs-on: ubuntu-latest
needs: build-package
steps:
- name: Download previously built packages
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Upload packages
uses: pypa/gh-action-pypi-publish@release/v1