Skip to content

Commit 49fbd1c

Browse files
authored
chore: add publish workflow (#3216)
1 parent b43432a commit 49fbd1c

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will upload a Python Package to PyPI when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Publish to PyPI
10+
11+
on:
12+
workflow_dispatch:
13+
release:
14+
types: [ published ]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
build-and-inspect-package:
21+
name: Build & inspect package.
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: hynek/build-and-inspect-python-package@v2
27+
28+
29+
upload-to-pypi:
30+
name: Upload package to PyPI
31+
needs: build-and-inspect-package
32+
runs-on: ubuntu-latest
33+
permissions:
34+
# IMPORTANT: this permission is mandatory for trusted publishing, but
35+
# should NOT be granted anywhere else!
36+
id-token: write
37+
38+
steps:
39+
- name: Download built artifact to dist/
40+
uses: actions/download-artifact@v4
41+
with:
42+
name: Packages
43+
path: dist
44+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)