Skip to content

Commit cca7e5c

Browse files
committed
fixed publish workflow
1 parent a8c1bc1 commit cca7e5c

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

.github/workflows/publish.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,40 @@ name: Publish
22

33
on:
44
release:
5-
types: ["published"]
5+
types: [published]
6+
workflow_dispatch: # Enable manual trigger.
67

78
jobs:
8-
run:
9-
name: "Build and publish release"
9+
build-and-publish:
1010
runs-on: ubuntu-latest
11-
11+
permissions:
12+
id-token: write # Mandatory for OIDC.
13+
contents: read
1214
steps:
13-
- uses: actions/checkout@v4
15+
- name: Checkout (official GitHub action)
16+
uses: actions/checkout@v4
17+
with:
18+
# Important for versioning plugins:
19+
fetch-depth: 0
1420

15-
- name: Install uv
21+
- name: Install uv (official Astral action)
1622
uses: astral-sh/setup-uv@v5
1723
with:
24+
version: "0.6.14"
1825
enable-cache: true
19-
cache-dependency-glob: uv.lock
26+
python-version: "3.12"
27+
28+
- name: Set up Python (using uv)
29+
run: uv python install
2030

21-
- name: Set up Python
31+
- name: Install all dependencies
2232
run: uv sync --all-extras --dev
2333

24-
- name: Build
34+
- name: Run tests
35+
run: uv run pytest
36+
37+
- name: Build package
2538
run: uv build
2639

27-
- name: Publish
28-
env:
29-
TOKEN: ${{ secrets.PYPI_TOKEN }}
30-
run: uv publish --token "$TOKEN"
40+
- name: Publish to PyPI (using uv)
41+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)