Skip to content

Commit 5be7feb

Browse files
feat: add SDK publish workflow for PyPI with OIDC authentication
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent 5a991a9 commit 5be7feb

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/sdk_publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish SDK to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to publish (leave empty to use pyproject.toml version)'
8+
required: false
9+
type: string
10+
11+
jobs:
12+
build-and-publish:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
id-token: write
16+
contents: read
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.10'
25+
26+
- name: Install build dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install build
30+
31+
- name: Update version if specified
32+
if: ${{ inputs.version != '' }}
33+
working-directory: sdk
34+
run: |
35+
sed -i "s/^version = .*/version = \"${{ inputs.version }}\"/" pyproject.toml
36+
37+
- name: Build package
38+
working-directory: sdk
39+
run: python -m build
40+
41+
- name: Publish to PyPI
42+
uses: pypa/gh-action-pypi-publish@release/v1
43+
with:
44+
packages-dir: sdk/dist/

0 commit comments

Comments
 (0)