-
-
Notifications
You must be signed in to change notification settings - Fork 65
58 lines (47 loc) · 1.38 KB
/
python-publish.yml
File metadata and controls
58 lines (47 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Upload Python Package
on:
release:
types: [created]
workflow_dispatch: {}
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22.14.0
registry-url: https://registry.npmjs.org/
- name: Upgrade npm
run: |
npm --version
npm i -g npm@latest
npm --version
- name: Install uv (with cache)
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
enable-cache: true
- name: Install the project
run: uv sync --all-extras --dev
- name: Ensure npm uses OIDC (no token auth)
shell: bash
run: |
rm -f ~/.npmrc .npmrc || true
# Build using uv env so Python CLIs are available to npm scripts
- name: Build (uses Python deps via uv)
run: |
uv run npm ci
uv run npm run build
# Publish with bare npm so it can do OIDC trusted publishing
- name: Publish to npm (OIDC trusted publishing)
run: |
npm publish --provenance
- name: Build and publish to PyPI
run: |
uv build
uv publish --username=${{ secrets.PYPI_USERNAME }} --password=${{ secrets.PYPI_PASSWORD }}