Skip to content

Commit eee725d

Browse files
committed
Use uv publish in "publish" CI workflow
1 parent 08cb547 commit eee725d

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

.github/workflows/publish.yaml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
name: Build package / publish
22

33
on:
4-
push:
5-
branches: [ main ]
6-
tags: [ "v*" ]
7-
release:
8-
types: [ published ]
9-
# Check that package can be built even on PRs
10-
pull_request:
11-
branches: [ main ]
4+
pull_request: { branches: [ main ] }
5+
push: { tags: [ "v*" ] }
6+
release: { types: [ published ] }
127

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
1311

1412
jobs:
1513
publish:
16-
uses: iiasa/actions/.github/workflows/publish.yaml@main
17-
secrets:
18-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
19-
TESTPYPI_TOKEN: ${{ secrets.TESTPYPI_TOKEN }}
14+
environment: { name: publish }
15+
permissions: { id-token: write }
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v6
20+
- uses: astral-sh/setup-uv@v7
21+
with: { python-version: "3.14" }
22+
- run: uv build
23+
- run: uv publish --trusted-publishing=always
24+
if: >-
25+
github.event_name == 'release' || (
26+
github.event_name == 'push'
27+
&& startsWith(github.ref, 'refs/tags')
28+
)
29+
# Uncomment for testing
30+
# env: { UV_PUBLISH_URL: "https://test.pypi.org/legacy/" }
31+

0 commit comments

Comments
 (0)