Skip to content

Commit 36ee2fe

Browse files
committed
2 parents a7bfdd8 + 48c849e commit 36ee2fe

File tree

1 file changed

+15
-64
lines changed

1 file changed

+15
-64
lines changed
Lines changed: 15 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,23 @@
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
1+
name: Release
102

113
on:
12-
release:
13-
types: [published]
14-
15-
permissions:
16-
contents: read
4+
push:
5+
tags:
6+
# Publish on any tag starting with a `v`, e.g. v1.2.3
7+
- v*
178

189
jobs:
19-
release-build:
20-
runs-on: ubuntu-latest
21-
22-
steps:
23-
- uses: actions/checkout@v4
24-
25-
- name: Install the latest version of uv
26-
uses: astral-sh/setup-uv@v6
27-
28-
- uses: actions/setup-python@v5
29-
with:
30-
python-version: "3.x"
31-
32-
- name: Build release distributions
33-
run: |
34-
# NOTE: put your own distribution build steps here.
35-
uv build
36-
37-
- name: Upload distributions
38-
uses: actions/upload-artifact@v4
39-
with:
40-
name: release-dists
41-
path: dist/
42-
43-
pypi-publish:
10+
pypi:
11+
name: Publish to PyPI
4412
runs-on: ubuntu-latest
45-
needs:
46-
- release-build
13+
# Environment and permissions trusted publishing.
14+
environment:
15+
# Create this environment in the GitHub repository under Settings -> Environments
16+
name: release
4717
permissions:
48-
# IMPORTANT: this permission is mandatory for trusted publishing
4918
id-token: write
50-
51-
# Dedicated environments with protections for publishing are strongly recommended.
52-
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
53-
environment:
54-
name: pypi
55-
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
56-
# url: https://pypi.org/p/YOURPROJECT
57-
#
58-
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
59-
# ALTERNATIVE: exactly, uncomment the following line instead:
60-
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
61-
6219
steps:
63-
- name: Retrieve release distributions
64-
uses: actions/download-artifact@v4
65-
with:
66-
name: release-dists
67-
path: dist/
68-
69-
- name: Publish release distributions to PyPI
70-
uses: pypa/gh-action-pypi-publish@release/v1
71-
with:
72-
packages-dir: dist/
20+
- uses: actions/checkout@v4
21+
- uses: astral-sh/setup-uv@v3
22+
- run: uv build
23+
- run: uv publish --trusted-publishing always

0 commit comments

Comments
 (0)