Skip to content

Commit ba67fe4

Browse files
authored
Create python-publish.yml github action file
1 parent 792176e commit ba67fe4

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/python-publish.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
release-build:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.13"
28+
29+
- name: Install Poetry
30+
uses: snok/install-poetry@v1
31+
32+
- name: Build release distributions
33+
run: |
34+
poetry build
35+
36+
- name: Upload distributions
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: release-dists
40+
path: dist/
41+
42+
pypi-publish:
43+
runs-on: ubuntu-latest
44+
needs:
45+
- release-build
46+
permissions:
47+
id-token: write
48+
49+
environment:
50+
name: pypi
51+
steps:
52+
- name: Retrieve release distributions
53+
uses: actions/download-artifact@v4
54+
with:
55+
name: release-dists
56+
path: dist/
57+
58+
- name: Publish release distributions to PyPI
59+
uses: pypa/gh-action-pypi-publish@release/v1
60+
with:
61+
packages-dir: dist/

0 commit comments

Comments
 (0)