refactor: use CI artifacts in release workflow instead of rebuilding
- Download pre-built wheels from successful CI runs - Avoids duplicate builds and ensures consistency - CI artifacts are already tested across all platforms - Faster release process (no build time) - Updates release documentation to reflect new flow This ensures the released packages are exactly what was tested in CI.
This commit is contained in:
65
.github/workflows/release-manual.yml
vendored
65
.github/workflows/release-manual.yml
vendored
@@ -26,8 +26,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Check CI status
|
- name: Check CI status
|
||||||
run: |
|
run: |
|
||||||
echo "ℹ️ This workflow assumes CI has already passed on the current commit."
|
echo "ℹ️ This workflow will download build artifacts from the latest CI run."
|
||||||
echo " If not, please wait for CI to complete before releasing."
|
echo " CI must have completed successfully on the current commit."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
- name: Validate version format
|
- name: Validate version format
|
||||||
@@ -64,11 +64,64 @@ jobs:
|
|||||||
git add packages/*/pyproject.toml
|
git add packages/*/pyproject.toml
|
||||||
git commit -m "chore: release v${{ inputs.version }}"
|
git commit -m "chore: release v${{ inputs.version }}"
|
||||||
|
|
||||||
- name: Build packages for TestPyPI
|
- name: Get CI run ID
|
||||||
|
id: get-ci-run
|
||||||
run: |
|
run: |
|
||||||
echo "🔨 Building packages for testing..."
|
# Get the latest successful CI run on this commit
|
||||||
./scripts/build_and_test.sh all
|
COMMIT_SHA=$(git rev-parse HEAD)
|
||||||
echo "✅ Build successful! (Already tested on multiple platforms)"
|
RUN_ID=$(gh run list \
|
||||||
|
--workflow=ci.yml \
|
||||||
|
--status=success \
|
||||||
|
--commit=$COMMIT_SHA \
|
||||||
|
--json databaseId \
|
||||||
|
--jq '.[0].databaseId')
|
||||||
|
|
||||||
|
if [ -z "$RUN_ID" ]; then
|
||||||
|
echo "❌ No successful CI run found for commit $COMMIT_SHA"
|
||||||
|
echo "Please wait for CI to complete before releasing."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "✅ Found CI run: $RUN_ID"
|
||||||
|
echo "run-id=$RUN_ID" >> $GITHUB_OUTPUT
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Download artifacts from CI
|
||||||
|
run: |
|
||||||
|
echo "📦 Downloading artifacts from CI run ${{ steps.get-ci-run.outputs.run-id }}..."
|
||||||
|
|
||||||
|
# Download all wheel artifacts
|
||||||
|
gh run download ${{ steps.get-ci-run.outputs.run-id }} \
|
||||||
|
--pattern "wheels-*" \
|
||||||
|
--dir ./dist-downloads
|
||||||
|
|
||||||
|
# Consolidate all wheels into packages/*/dist/
|
||||||
|
mkdir -p packages/leann-core/dist
|
||||||
|
mkdir -p packages/leann-backend-hnsw/dist
|
||||||
|
mkdir -p packages/leann-backend-diskann/dist
|
||||||
|
mkdir -p packages/leann/dist
|
||||||
|
|
||||||
|
find ./dist-downloads -name "*.whl" -exec cp {} ./packages/ \;
|
||||||
|
|
||||||
|
# Move wheels to correct package directories
|
||||||
|
for wheel in packages/*.whl; do
|
||||||
|
if [[ $wheel == *"leann_core"* ]]; then
|
||||||
|
mv "$wheel" packages/leann-core/dist/
|
||||||
|
elif [[ $wheel == *"leann_backend_hnsw"* ]]; then
|
||||||
|
mv "$wheel" packages/leann-backend-hnsw/dist/
|
||||||
|
elif [[ $wheel == *"leann_backend_diskann"* ]]; then
|
||||||
|
mv "$wheel" packages/leann-backend-diskann/dist/
|
||||||
|
elif [[ $wheel == *"leann-"* ]] && [[ $wheel != *"backend"* ]] && [[ $wheel != *"core"* ]]; then
|
||||||
|
mv "$wheel" packages/leann/dist/
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# List downloaded wheels
|
||||||
|
echo "✅ Downloaded wheels:"
|
||||||
|
find packages/*/dist -name "*.whl" -type f | sort
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Test on TestPyPI (optional)
|
- name: Test on TestPyPI (optional)
|
||||||
if: inputs.test_pypi
|
if: inputs.test_pypi
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ Before releasing, ensure:
|
|||||||
|
|
||||||
**What happens:**
|
**What happens:**
|
||||||
- ✅ Validates version format
|
- ✅ Validates version format
|
||||||
|
- ✅ Downloads pre-built packages from CI (no rebuild needed!)
|
||||||
- ✅ Updates all package versions
|
- ✅ Updates all package versions
|
||||||
- ✅ Optionally tests on TestPyPI
|
- ✅ Optionally tests on TestPyPI
|
||||||
- ✅ Creates tag and GitHub release
|
- ✅ Creates tag and GitHub release
|
||||||
|
|||||||
Reference in New Issue
Block a user