Skip to content

Commit 6992b10

Browse files
committed
fix: PyPI publishing issues
1 parent a67aa23 commit 6992b10

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

.github/workflows/CD-publish_to_pypi.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ name: CD | Publish Python 🐍 distributions 📦 to PyPI
22

33
on:
44
push:
5-
branches:
6-
- main
7-
workflow_dispatch:
5+
branches: [main]
86

97
permissions:
108
contents: write
119
pull-requests: write
1210
actions: write
1311
issues: write
12+
id-token: write
1413

1514
jobs:
1615
release-please:
@@ -26,36 +25,44 @@ jobs:
2625
release-type: python
2726
package-name: runpod
2827

29-
build-n-publish:
30-
name: Build and publish Python 🐍 distributions 📦 to PyPI
28+
# PyPI publishing
29+
pypi-publish:
30+
name: PyPI Publish
3131
needs: release-please
3232
if: ${{ needs.release-please.outputs.release_created }}
3333
runs-on: ubuntu-latest
34-
environment: release
35-
permissions:
36-
contents: read
37-
id-token: write # Required for OIDC
34+
35+
environment:
36+
name: pypi-production
37+
url: https://pypi.org/project/runpod/
3838

3939
steps:
40-
- uses: actions/checkout@v4
40+
- name: Checkout code
41+
uses: actions/checkout@v4
42+
43+
- name: Set up Python
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: 3.11.10
47+
4148
- name: Install uv
42-
uses: astral-sh/setup-uv@v6
49+
uses: astral-sh/setup-uv@v2
4350
with:
4451
enable-cache: true
4552

46-
- name: Set up Python 3.11.10
47-
run: uv python install 3.11.10
53+
- name: Install dependencies
54+
run: uv sync --all-groups
4855

4956
- name: Build package
5057
run: uv build
5158

52-
- name: Publish distribution 📦 to Test PyPI
53-
uses: pypa/gh-action-pypi-publish@release/v1
54-
with:
55-
repository-url: https://test.pypi.org/legacy/
59+
- name: Verify package
60+
run: uv run twine check dist/*
5661

57-
- name: Publish distribution 📦 to PyPI
62+
- name: Publish to PyPI
5863
uses: pypa/gh-action-pypi-publish@release/v1
64+
with:
65+
verbose: true
5966

6067
notify-runpod-workers:
6168
name: Notify workers

0 commit comments

Comments
 (0)