Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix(ci): move version auto-bump to merge time

LearningCircuit57d1de459b85
diff --git a/.github/workflows/version_check.yml b/.github/workflows/version_check.yml
index d1be06cef2..383b7f01f8 100644
--- a/.github/workflows/version_check.yml
+++ b/.github/workflows/version_check.yml
@@ -1,30 +1,32 @@
-name: Version Check
+name: Version Auto-Bump
+# Run AFTER merge to main, not during PR checks
+# Benefits:
+# - PR checks run once without restarts
+# - No version merge conflicts between parallel PRs
+# - Version always reflects what's actually in main
on:
- pull_request:
+ push:
+ branches:
+ - main
paths:
- 'src/**'
- - 'pdm.lock' # Dependency updates (security fixes)
- - 'pyproject.toml' # Project config/dependency changes
- - 'package.json' # Frontend dependency changes
- - 'vite.config.js' # Frontend configuration changes
- - 'package-lock.json' # Frontend locked dependencies
- - '.github/workflows/version_check.yml' # Self-updates to version bump logic
- - 'scripts/ollama_entrypoint.sh' # Critical scripts
- - 'Dockerfile' # Main Dockerfile
- types: [ opened, synchronize, reopened ]
- branches:
- - 'main'
- workflow_dispatch: # Manual trigger for edge cases
+ - 'pdm.lock'
+ - 'pyproject.toml'
+ - 'package.json'
+ - 'package-lock.json'
+ - 'Dockerfile'
+ workflow_dispatch:
-permissions: {} # Minimal top-level for OSSF Scorecard Token-Permissions
+permissions: {}
jobs:
- version-check:
+ version-bump:
runs-on: ubuntu-latest
+ # Skip if this push is already an auto-bump commit
+ if: "!contains(github.event.head_commit.message, 'chore: auto-bump version')"
permissions:
- contents: write # Required for pushing version bump
- pull-requests: write # Required for PR comments
+ contents: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
@@ -34,71 +36,49 @@ jobs:
- name: Checkout code
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
- fetch-depth: 0
+ fetch-depth: 2
token: ${{ secrets.PAT_TOKEN }}
- - name: Checkout PR branch
- env:
- HEAD_REF: ${{ github.head_ref }}
+ - name: Check if version was bumped in this push
+ id: check
run: |
- git checkout "${HEAD_REF}"
-
- - name: Set up Python
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
- with:
- python-version: '3.12'
-
- - name: Check and auto-bump version
- if: "!contains(github.event.head_commit.message, 'chore: auto-bump version')"
- env:
- HEAD_REF: ${{ github.head_ref }}
- BASE_REF: ${{ github.base_ref }}
- run: |
- # Skip auto-bump for protected branches (dev, main) - these require PRs for changes
- if [[ "${HEAD_REF}" == "dev" || "${HEAD_REF}" == "main" ]]; then
- echo "::notice::Skipping auto-bump for protected branch '${HEAD_REF}'. Please bump version manually if needed."
- # Check if version was updated and inform
- if ! git diff "origin/${BASE_REF}..HEAD" -G"__version__" | grep -E '\+.*__version__.*='; then
- echo "::warning::Version was not updated in this PR. Consider bumping the version before merging."
- else
- echo "Version has been updated manually. No auto-bump needed."
- fi
- exit 0
- fi
-
- if ! git diff "origin/${BASE_REF}..HEAD" -G"__version__" | grep -E '\+.*__version__.*='; then
- echo "Version not updated. Auto-bumping patch version..."
-
- # Get current version
- current_version=$(grep -oP '(?<=__version__ = ")[^"]*' src/local_deep_research/__version__.py)
- echo "Current version: $current_version"
-
- # Split version into parts
- IFS='.' read -ra VERSION_PARTS <<< "$current_version"
- major=${VERSION_PARTS[0]}
- minor=${VERSION_PARTS[1]}
- patch=${VERSION_PARTS[2]}
-
- # Increment patch version
- new_patch=$((patch + 1))
- new_version="$major.$minor.$new_patch"
- echo "New version: $new_version"
-
- # Update version file
- sed -i "s/__version__ = \"$current_version\"/__version__ = \"$new_version\"/" src/local_deep_research/__version__.py
-
- # Configure git
- git config --local user.email "[email protected]"
- git config --local user.name "GitHub Action"
-
- # Commit the version bump
- git add src/local_deep_research/__version__.py
- git commit -m "chore: auto-bump version to $new_version"
-
- # Push to the PR branch
- git push origin "${HEAD_REF}"
-
- echo "Version automatically bumped to $new_version"
+ # Check if version changed in the commits being pushed
+ if git diff HEAD~1 -G"__version__" -- src/local_deep_research/__version__.py | grep -E '\+.*__version__.*='; then
+ echo "Version was manually bumped in this push"
+ echo "needs_bump=false" >> $GITHUB_OUTPUT
else
- echo "Version has been updated manually. No auto-bump needed."
+ echo "Version not bumped, will auto-bump"
+ echo "needs_bump=true" >> $GITHUB_OUTPUT
fi
+
+ - name: Auto-bump patch version
+ if: steps.check.outputs.needs_bump == 'true'
+ run: |
+ # Get current version
+ current_version=$(grep -oP '(?<=__version__ = ")[^"]*' src/local_deep_research/__version__.py)
+ echo "Current version: $current_version"
+
+ # Split version into parts
+ IFS='.' read -ra VERSION_PARTS <<< "$current_version"
+ major=${VERSION_PARTS[0]}
+ minor=${VERSION_PARTS[1]}
+ patch=${VERSION_PARTS[2]}
+
+ # Increment patch version
+ new_patch=$((patch + 1))
+ new_version="$major.$minor.$new_patch"
+ echo "New version: $new_version"
+
+ # Update version file
+ sed -i "s/__version__ = \"$current_version\"/__version__ = \"$new_version\"/" src/local_deep_research/__version__.py
+
+ # Configure git
+ git config --local user.email "[email protected]"
+ git config --local user.name "GitHub Action"
+
+ # Commit and push
+ git add src/local_deep_research/__version__.py
+ git commit -m "chore: auto-bump version to $new_version"
+ git push
+
+ echo "::notice::Version automatically bumped to $new_version"