Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeflash-optimize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fetch-depth: 0

- name: 🐍 Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
python-version: 3.11.6

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-async.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
fi
- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
python-version: 3.11.6

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-bubblesort-benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
fi
- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
python-version: 3.11.6

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-bubblesort-pytest-nogit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
fi
- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
python-version: 3.11.6

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-bubblesort-unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
fi
- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
python-version: 3.11.6

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-coverage-optimization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
fi
- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
python-version: 3.11.6

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-futurehouse-structure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
fi
- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
python-version: 3.11.6

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-init-optimization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
fi
- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
python-version: 3.11.6

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-topological-sort.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
fi
- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
python-version: 3.11.6

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tracer-replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
python-version: 3.11.6

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
version: "0.5.30"

Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: "Publish"

on:
push:
branches:
- main
paths:
- 'codeflash/version.py'

jobs:
publish:
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
contents: write # Changed from 'read' to 'write' to allow tag creation
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0 # Fetch all history for proper versioning

- name: Extract version from version.py
id: extract_version
run: |
VERSION=$(grep -oP '__version__ = "\K[^"]+' codeflash/version.py)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"
- name: Check if tag already exists
id: check_tag
run: |
if git rev-parse "v${{ steps.extract_version.outputs.version }}" >/dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "Tag v${{ steps.extract_version.outputs.version }} already exists, skipping release"
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "Tag v${{ steps.extract_version.outputs.version }} does not exist, proceeding with release"
fi
- name: Create and push git tag
if: steps.check_tag.outputs.exists == 'false'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "${{ steps.extract_version.outputs.tag }}" -m "Release ${{ steps.extract_version.outputs.tag }}"
git push origin "${{ steps.extract_version.outputs.tag }}"
- name: Install uv
if: steps.check_tag.outputs.exists == 'false'
uses: astral-sh/setup-uv@v6

- name: Build
if: steps.check_tag.outputs.exists == 'false'
run: uv build

# Check that basic features work and we didn't miss to include crucial files
- name: Smoke test (wheel)
if: steps.check_tag.outputs.exists == 'false'
run: uv run --isolated --no-project --with dist/*.whl tests/smoke_test.py

- name: Smoke test (source distribution)
if: steps.check_tag.outputs.exists == 'false'
run: uv run --isolated --no-project --with dist/*.tar.gz tests/smoke_test.py

- name: Publish to PyPI
if: steps.check_tag.outputs.exists == 'false'
run: uv publish

- name: Create GitHub Release
if: steps.check_tag.outputs.exists == 'false'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.extract_version.outputs.tag }}
name: Release ${{ steps.extract_version.outputs.tag }}
body: |
## What's Changed
Release ${{ steps.extract_version.outputs.version }} of codeflash.
**Full Changelog**: https://github.com/${{ github.repository }}/commits/${{ steps.extract_version.outputs.tag }}
draft: false
prerelease: false
generate_release_notes: true
files: |
dist/*
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
python-version: "3.13"

Expand Down
Loading