Skip to content

Commit 9d6c610

Browse files
authored
Trusted publishing (#7)
* Add .claude and .gitignore * Use trusted publishing * Align with other repos
1 parent 1a2b36a commit 9d6c610

2 files changed

Lines changed: 28 additions & 17 deletions

File tree

.claude/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.local.json

.github/workflows/publish-package.yaml

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,37 @@ on:
44
release:
55
types: [created]
66

7-
env:
8-
UV_LOCKED: true # Assert that the `uv.lock` will remain unchanged
9-
107
jobs:
11-
deploy:
12-
runs-on: ubuntu-latest
8+
build:
9+
runs-on: ubuntu-24.04
1310
steps:
1411
- uses: actions/checkout@v6
15-
16-
- name: Install uv and set the python version
17-
uses: astral-sh/setup-uv@v7
12+
- name: Install uv and set the Python version
13+
uses: astral-sh/setup-uv@v8
1814
with:
19-
# It is considered best practice to pin to a specific uv version.
20-
version: "0.11.6"
21-
python-version: ${{ matrix.python-version }}
22-
15+
version: "0.11.7"
16+
python-version: "3.x"
2317
- name: Build package
2418
run: uv build
25-
26-
- name: Publish package
27-
run: uv publish
2819
env:
29-
UV_PUBLISH_USERNAME: ${{ secrets.FLIT_USERNAME }}
30-
UV_PUBLISH_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
20+
UV_LOCKED: true
21+
- name: Upload dist artifact
22+
uses: actions/upload-artifact@v4
23+
with:
24+
name: dist
25+
path: dist/
26+
27+
publish:
28+
needs: build
29+
runs-on: ubuntu-24.04
30+
environment: pypi
31+
permissions:
32+
id-token: write
33+
steps:
34+
- name: Download dist artifact
35+
uses: actions/download-artifact@v4
36+
with:
37+
name: dist
38+
path: dist/
39+
- name: Publish package distributions to PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)