This repository was archived by the owner on Mar 17, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
85 lines (73 loc) · 2.49 KB
/
test-publish-python.yaml
File metadata and controls
85 lines (73 loc) · 2.49 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Test Publish Python Client
on:
workflow_dispatch:
inputs:
reason:
description: 'Reason for test publish'
required: false
default: 'Manual test publish'
jobs:
test-publish-python:
name: Test Publish - Python Client to TestPyPI
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
defaults:
run:
working-directory: ./client/python
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for setuptools-scm to get version from git
- name: Set up Python '3.11'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Create virtual environment and install build tools
run: |
python3 -m venv .venv
.venv/bin/python -m pip install --upgrade pip
.venv/bin/python -m pip install build setuptools wheel
echo "$PWD/.venv/bin" >> $GITHUB_PATH
- name: Generate protobuf files
run: make generate-proto
- name: Build package
run: make build
- name: Check package contents
run: |
echo "=== Package files created ==="
ls -la dist/
echo "=== Package contents ==="
python -c "
import glob
import tarfile
import zipfile
import sys
# Find sdists and wheels
sdists = glob.glob('dist/*.tar.gz')
wheels = glob.glob('dist/*.whl')
if not sdists and not wheels:
print('ERROR: No package artifacts found in dist/')
sys.exit(1)
# List sdist contents
for sdist in sdists:
print(f'\\n=== {sdist} contents (first 20) ===')
with tarfile.open(sdist, 'r:gz') as tf:
for member in tf.getnames()[:20]:
print(f' {member}')
# List wheel contents
for wheel in wheels:
print(f'\\n=== {wheel} contents (first 20) ===')
with zipfile.ZipFile(wheel, 'r') as zf:
for name in zf.namelist()[:20]:
print(f' {name}')
"
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: ./client/python/dist/
verbose: true
skip-existing: true