[MLsys2026 Best Paper]: https://arxiv.org/abs/2506.08276. RAG on Everything with LEANN. Enjoy 97% storage savings while running a fast, accurate, and 100% private RAG application on your personal device.
Python aifaissgpt-osslangchainllama-indexllmlocalstorageoffline-firstollamaprivacypythonragretrieval-augmented-generationvector-databasevector-searchvectors
fix: make release workflow idempotent
Andy Leefc9c5cb39dbc
diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.ymlindex 027489d..21dfc64 100644--- a/.github/workflows/release-manual.yml+++ b/.github/workflows/release-manual.yml@@ -31,16 +31,26 @@ jobs:- name: Update versions and pushid: pushrun: |- ./scripts/bump_version.sh ${{ inputs.version }}- git config user.name "GitHub Actions"- git config user.email "[email protected]"- git add packages/*/pyproject.toml- git commit -m "chore: release v${{ inputs.version }}"- git push origin main+ # Check current version+ CURRENT_VERSION=$(grep "^version" packages/leann-core/pyproject.toml | cut -d'"' -f2)+ echo "Current version: $CURRENT_VERSION"+ echo "Target version: ${{ inputs.version }}"++ if [ "$CURRENT_VERSION" = "${{ inputs.version }}" ]; then+ echo "⚠️ Version is already ${{ inputs.version }}, skipping update"+ COMMIT_SHA=$(git rev-parse HEAD)+ else+ ./scripts/bump_version.sh ${{ inputs.version }}+ git config user.name "GitHub Actions"+ git config user.email "[email protected]"+ git add packages/*/pyproject.toml+ git commit -m "chore: release v${{ inputs.version }}"+ git push origin main+ COMMIT_SHA=$(git rev-parse HEAD)+ echo "✅ Pushed version update: $COMMIT_SHA"+ fi- COMMIT_SHA=$(git rev-parse HEAD)echo "commit-sha=$COMMIT_SHA" >> $GITHUB_OUTPUT- echo "✅ Pushed version update: $COMMIT_SHA"build-packages:name: Build packages@@ -93,12 +103,24 @@ jobs:- name: Create releaserun: |- git tag "v${{ inputs.version }}"- git push origin "v${{ inputs.version }}"+ # Check if tag already exists+ if git rev-parse "v${{ inputs.version }}" >/dev/null 2>&1; then+ echo "⚠️ Tag v${{ inputs.version }} already exists, skipping tag creation"+ else+ git tag "v${{ inputs.version }}"+ git push origin "v${{ inputs.version }}"+ echo "✅ Created and pushed tag v${{ inputs.version }}"+ fi- gh release create "v${{ inputs.version }}" \- --title "Release v${{ inputs.version }}" \- --notes "🚀 Released to PyPI: https://pypi.org/project/leann/${{ inputs.version }}/" \- --latest+ # Check if release already exists+ if gh release view "v${{ inputs.version }}" >/dev/null 2>&1; then+ echo "⚠️ Release v${{ inputs.version }} already exists, skipping release creation"+ else+ gh release create "v${{ inputs.version }}" \+ --title "Release v${{ inputs.version }}" \+ --notes "🚀 Released to PyPI: https://pypi.org/project/leann/${{ inputs.version }}/" \+ --latest+ echo "✅ Created GitHub release v${{ inputs.version }}"+ fienv:GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\ No newline at end of file