Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: SDK verification
name: SDK verification for GitHub PAT PoC
on: [push, pull_request]
permissions:
contents: read
Expand Down Expand Up @@ -27,5 +27,5 @@ jobs:
python -m build
python -m twine check dist/*
python -m pip install dist/*.whl
python -I -c 'from umanaged_agents import Client; from umanaged_agents.eventstream import EventStream'
python -I -c 'from ucloud_managed_agents import Client; from ucloud_managed_agents.eventstream import EventStream'
python -I -m unittest discover -s tests -p 'test_*.py'
88 changes: 4 additions & 84 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,9 @@
name: Build and publish Python SDK

on:
workflow_dispatch:
inputs:
expected_version:
description: Exact version in pyproject.toml
required: true
type: string
default: "1.0.0a2"
publish:
description: Upload to public PyPI after validation
required: true
type: boolean
default: false

name: Python SDK package validation for PAT PoC
on: workflow_dispatch
permissions:
contents: read

concurrency:
group: pypi-release
cancel-in-progress: false

jobs:
build:
note:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.11"
- name: Check requested version
env:
EXPECTED_VERSION: ${{ inputs.expected_version }}
run: |
python - <<'PY'
import os,tomllib
assert os.environ['EXPECTED_VERSION']==tomllib.load(open('pyproject.toml','rb'))['project']['version']
PY
- name: Install packaging tools
run: python -m pip install build==1.3.0 twine==6.2.0
- name: Build wheel and source distribution
run: python -m build
- name: Check distribution metadata
run: python -m twine check dist/*
- name: Test installed wheel against loopback fixtures
shell: bash
run: |
set -euo pipefail
root="$PWD"
python -m venv "$RUNNER_TEMP/sdk-test"
"$RUNNER_TEMP/sdk-test/bin/python" -m pip install dist/*.whl
cd "$RUNNER_TEMP"
"$RUNNER_TEMP/sdk-test/bin/python" -I -m unittest discover -s "$root/tests" -p 'test_*.py' -v
- name: Record artifact checksums
run: sha256sum dist/* > SHA256SUMS
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: python-release-${{ github.run_id }}
path: |
dist/*.whl
dist/*.tar.gz
SHA256SUMS
if-no-files-found: error

publish:
if: ${{ inputs.publish }}
needs: build
environment: pypi
permissions:
id-token: write
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: python-release-${{ github.run_id }}
path: release
- name: Verify build artifact checksums
working-directory: release
run: sha256sum --check SHA256SUMS
- name: Publish SDK distributions to public PyPI
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 (peeled commit, not annotated tag object)
with:
packages-dir: release/dist/
attestations: false
- run: echo 'PoC build assurance is reported in SDK verification.'
Loading
Loading