You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 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
# 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
+
- name: Install poetry
26
+
run: pipx install poetry
27
+
28
+
- uses: actions/setup-python@v5
29
+
with:
30
+
python-version: "3.11"
31
+
cache: "poetry"
32
+
33
+
- name: Install dependencies
34
+
run: poetry install --no-interaction --no-root
35
+
36
+
- name: Run tests
37
+
run: poetry run pytest
38
+
39
+
- name: Build release distributions
40
+
run: poetry build
41
+
42
+
- name: Upload distributions
43
+
uses: actions/upload-artifact@v4
44
+
with:
45
+
name: release-dists
46
+
path: dist/
47
+
48
+
pypi-publish:
49
+
runs-on: ubuntu-latest
50
+
needs:
51
+
- release-build
52
+
permissions:
53
+
# IMPORTANT: this permission is mandatory for trusted publishing
54
+
id-token: write
55
+
56
+
# Dedicated environments with protections for publishing are strongly recommended.
57
+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
58
+
environment:
59
+
name: pypi
60
+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
61
+
# url: https://pypi.org/p/YOURPROJECT
62
+
#
63
+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
64
+
# ALTERNATIVE: exactly, uncomment the following line instead:
0 commit comments