Skip to content

Commit 7c19986

Browse files
committed
ci: align release workflow with 2.0 python sdk
1 parent c682f4c commit 7c19986

2 files changed

Lines changed: 9 additions & 91 deletions

File tree

.github/workflows/publish-python.yml

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Publish Python SDK
22

3-
# This workflow builds native Python wheels and uploads them to GitHub Releases.
4-
# The bootstrap package (a3s-code) is published to PyPI and downloads wheels
5-
# from GitHub Releases at runtime - NO native wheels are included in the PyPI package.
3+
# This workflow builds native Python wheels, uploads them to GitHub Releases,
4+
# and publishes the wheels to PyPI.
65

76
on:
87
workflow_call:
@@ -89,42 +88,13 @@ jobs:
8988
path: dist/*.whl
9089
if-no-files-found: error
9190

92-
# ─────────────────────────────────────────────────────────────────
93-
# Build bootstrap package
94-
# This is published to PyPI - it downloads wheels from GitHub Releases
95-
# ─────────────────────────────────────────────────────────────────
96-
build-bootstrap:
97-
name: Build bootstrap package
98-
runs-on: ubuntu-latest
99-
steps:
100-
- uses: actions/checkout@v4
101-
102-
- name: Setup Python
103-
uses: actions/setup-python@v5
104-
with:
105-
python-version: "3.12"
106-
107-
- name: Build bootstrap dist
108-
run: |
109-
python -m pip install --upgrade pip build
110-
python -m build sdk/python-bootstrap --outdir sdk/python-bootstrap/dist
111-
112-
- name: Upload bootstrap dist
113-
uses: actions/upload-artifact@v4
114-
with:
115-
name: python-bootstrap-dist
116-
path: sdk/python-bootstrap/dist/*
117-
if-no-files-found: error
118-
11991
# ─────────────────────────────────────────────────────────────────
12092
# Publish to GitHub Releases and PyPI
12193
# ─────────────────────────────────────────────────────────────────
12294
publish:
12395
name: Publish Python SDK
12496
runs-on: ubuntu-latest
125-
needs:
126-
- build
127-
- build-bootstrap
97+
needs: build
12898
steps:
12999
- uses: actions/checkout@v4
130100

@@ -135,12 +105,6 @@ jobs:
135105
path: dist
136106
merge-multiple: true
137107

138-
- name: Download bootstrap dist
139-
uses: actions/download-artifact@v4
140-
with:
141-
name: python-bootstrap-dist
142-
path: bootstrap-dist
143-
144108
- name: List wheels
145109
run: ls -la dist/
146110

@@ -173,12 +137,11 @@ jobs:
173137
run: |
174138
gh release upload "$GITHUB_REF_NAME" dist/python-native-manifest.json --clobber
175139
176-
# Publish bootstrap package to PyPI
177-
# This package downloads wheels from GitHub Releases at runtime
178-
- name: Publish bootstrap to PyPI
140+
# Publish native wheels to PyPI
141+
- name: Publish wheels to PyPI
179142
env:
180143
TWINE_USERNAME: __token__
181144
TWINE_PASSWORD: ${{ secrets.PYPI_NATIVE_TOKEN }}
182145
run: |
183146
python -m pip install --upgrade pip twine
184-
python -m twine upload --skip-existing bootstrap-dist/*
147+
python -m twine upload --skip-existing dist/*.whl

check-version.sh

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,9 @@
1-
#!/bin/bash
2-
# Check version alignment across all SDK files
1+
#!/usr/bin/env bash
2+
# Check version alignment across release artifacts.
33

44
set -euo pipefail
55

66
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
77
cd "$SCRIPT_DIR"
88

9-
echo "=========================================="
10-
echo "Version Alignment Check"
11-
echo "=========================================="
12-
echo ""
13-
14-
# Extract versions
15-
CORE_VERSION=$(grep '^version = ' core/Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
16-
NODE_CARGO_VERSION=$(grep '^version = ' sdk/node/Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
17-
NODE_PKG_VERSION=$(grep '"version":' sdk/node/package.json | sed 's/.*"version": "\(.*\)".*/\1/')
18-
NODE_LOCK_VERSION=$(node -p "require('./sdk/node/package-lock.json').packages[''].version")
19-
PYTHON_CARGO_VERSION=$(grep '^version = ' sdk/python/Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
20-
PYTHON_PYPROJECT_VERSION=$(grep '^version = ' sdk/python/pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
21-
BOOTSTRAP_VERSION=$(grep '^version = ' sdk/python-bootstrap/pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
22-
23-
echo "Current versions:"
24-
echo " core/Cargo.toml: ${CORE_VERSION}"
25-
echo " sdk/node/Cargo.toml: ${NODE_CARGO_VERSION}"
26-
echo " sdk/node/package.json: ${NODE_PKG_VERSION}"
27-
echo " sdk/node/package-lock: ${NODE_LOCK_VERSION}"
28-
echo " sdk/python/Cargo.toml: ${PYTHON_CARGO_VERSION}"
29-
echo " sdk/python/pyproject.toml: ${PYTHON_PYPROJECT_VERSION}"
30-
echo " sdk/python-bootstrap/pyproject.toml: ${BOOTSTRAP_VERSION}"
31-
echo ""
32-
33-
# Check alignment
34-
if [ "$CORE_VERSION" = "$NODE_CARGO_VERSION" ] && \
35-
[ "$CORE_VERSION" = "$NODE_PKG_VERSION" ] && \
36-
[ "$CORE_VERSION" = "$NODE_LOCK_VERSION" ] && \
37-
[ "$CORE_VERSION" = "$PYTHON_CARGO_VERSION" ] && \
38-
[ "$CORE_VERSION" = "$PYTHON_PYPROJECT_VERSION" ] && \
39-
[ "$CORE_VERSION" = "$BOOTSTRAP_VERSION" ]; then
40-
echo "✅ All versions aligned: ${CORE_VERSION}"
41-
exit 0
42-
else
43-
echo "❌ Version mismatch detected!"
44-
echo ""
45-
echo "Expected: ${CORE_VERSION}"
46-
echo "Mismatches:"
47-
[ "$CORE_VERSION" != "$NODE_CARGO_VERSION" ] && echo " - sdk/node/Cargo.toml: ${NODE_CARGO_VERSION}"
48-
[ "$CORE_VERSION" != "$NODE_PKG_VERSION" ] && echo " - sdk/node/package.json: ${NODE_PKG_VERSION}"
49-
[ "$CORE_VERSION" != "$NODE_LOCK_VERSION" ] && echo " - sdk/node/package-lock.json: ${NODE_LOCK_VERSION}"
50-
[ "$CORE_VERSION" != "$PYTHON_CARGO_VERSION" ] && echo " - sdk/python/Cargo.toml: ${PYTHON_CARGO_VERSION}"
51-
[ "$CORE_VERSION" != "$PYTHON_PYPROJECT_VERSION" ] && echo " - sdk/python/pyproject.toml: ${PYTHON_PYPROJECT_VERSION}"
52-
[ "$CORE_VERSION" != "$BOOTSTRAP_VERSION" ] && echo " - sdk/python-bootstrap/pyproject.toml: ${BOOTSTRAP_VERSION}"
53-
exit 1
54-
fi
9+
scripts/check_release_versions.sh

0 commit comments

Comments
 (0)