chore: update Homebrew formula to v2.4.0 #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Pre-Release Gate | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| previous_version: | |
| description: "Previous version to upgrade from (e.g. 2.1.0)" | |
| required: false | |
| jobs: | |
| upgrade-path: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # need tags for version detection | |
| - uses: astral-sh/setup-uv@v4 | |
| with: | |
| python-version: "3.12" | |
| - name: Determine previous version | |
| id: prev | |
| run: | | |
| if [ -n "${{ github.event.inputs.previous_version }}" ]; then | |
| echo "version=${{ github.event.inputs.previous_version }}" >> "$GITHUB_OUTPUT" | |
| else | |
| # Get the second-most-recent tag (current tag is most recent) | |
| prev=$(git tag --sort=-v:refname | grep '^v' | sed -n '2p' | sed 's/^v//') | |
| if [ -z "$prev" ]; then | |
| echo "No previous version found — skipping upgrade test" | |
| echo "skip=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "version=$prev" >> "$GITHUB_OUTPUT" | |
| fi | |
| fi | |
| - name: Install previous version from PyPI | |
| if: steps.prev.outputs.skip != 'true' | |
| run: | | |
| echo "Installing studyctl==${{ steps.prev.outputs.version }} from PyPI..." | |
| uv venv /tmp/upgrade-test | |
| uv pip install --python /tmp/upgrade-test/bin/python \ | |
| "studyctl==${{ steps.prev.outputs.version }}" 2>/dev/null || { | |
| echo "::warning::Previous version ${{ steps.prev.outputs.version }} not on PyPI — skipping upgrade test" | |
| exit 0 | |
| } | |
| - name: Create test database with previous version | |
| if: steps.prev.outputs.skip != 'true' | |
| run: | | |
| export PATH="/tmp/upgrade-test/bin:$PATH" | |
| mkdir -p ~/.config/studyctl | |
| # Run doctor to create default config state | |
| studyctl doctor --json > /dev/null 2>&1 || true | |
| - name: Upgrade to current version | |
| if: steps.prev.outputs.skip != 'true' | |
| run: | | |
| echo "Upgrading to current commit..." | |
| uv sync --all-packages --extra dev --extra test | |
| - name: Run doctor after upgrade | |
| if: steps.prev.outputs.skip != 'true' | |
| run: | | |
| output=$(uv run studyctl doctor --json) || true | |
| echo "$output" | python3 -c " | |
| import json, sys | |
| checks = json.load(sys.stdin) | |
| failed = [c for c in checks if c['status'] == 'fail'] | |
| passed = [c for c in checks if c['status'] == 'pass'] | |
| print(f'Post-upgrade doctor: {len(passed)} passed, {len(failed)} failed') | |
| for f in failed: | |
| print(f' FAIL: {f[\"category\"]}/{f[\"name\"]} — {f[\"message\"]}') | |
| core_fails = [f for f in failed if f['category'] in ('core', 'database', 'config')] | |
| if core_fails: | |
| print(f'::error::Post-upgrade: {len(core_fails)} core check(s) failed') | |
| sys.exit(1) | |
| " | |
| - name: Verify CLI still works after upgrade | |
| if: steps.prev.outputs.skip != 'true' | |
| run: uv run studyctl --version | |
| # Gate: this job must pass before the Release workflow's publish job runs. | |
| # The Release workflow (publish.yml) also triggers on v* tags but runs | |
| # independently. To block publish on failure, add this as a required | |
| # status check in GitHub branch protection rules. | |
| gate: | |
| needs: upgrade-path | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: echo "Pre-release gate passed" |