Skip to content

snapshot from ClawNet@561858b #2

snapshot from ClawNet@561858b

snapshot from ClawNet@561858b #2

name: publish-testpypi
# Publishes a tagged build to **TestPyPI** via OIDC Trusted Publishing.
# Triggered by:
# - Tags matching v*-test* or v*-rc* (e.g. v1.1.0-test1, v1.1.0-rc2)
# - Manual workflow_dispatch
#
# Requires (one-time, Web UI):
# TestPyPI → Account Settings → Publishing → Add a pending publisher
# Owner / Repo: ChatChatTech / anet-python-sdk
# Workflow file: publish-testpypi.yml
# Environment: testpypi
on:
push:
tags:
- "v*-test*"
- "v*-rc*"
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build sdist + wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build tooling
run: |
python -m pip install --upgrade pip
python -m pip install build twine pytest httpx
- name: Run offline unit tests
run: pytest -q tests/test_svc.py
- name: Build distributions
run: python -m build
- name: Twine check
run: python -m twine check dist/*
- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
publish-testpypi:
name: Publish to TestPyPI
needs: build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/project/anet-sdk/
permissions:
id-token: write # Required for OIDC Trusted Publishing
steps:
- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: dist/
skip-existing: true