From d530a8eab01b5d03ae4076aa08c62e6d9858a4ce Mon Sep 17 00:00:00 2001 From: lv10 Date: Sat, 14 Mar 2026 03:05:56 -0400 Subject: [PATCH 1/3] fix(ci): fix uv path in semantic-release and tag_format for versioning --- .github/workflows/release.yml | 18 ++++++++++++++---- pyproject.toml | 1 + 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a1253a..83f60cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,14 +22,24 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - name: Set up Python + run: uv python install + + - name: Install dependencies + run: uv sync --all-extras --dev + - name: Python Semantic Release id: release - uses: python-semantic-release/python-semantic-release@v9.15.2 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.name "github-actions [bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + uv run semantic-release version + uv run semantic-release publish - name: Publish to PyPI if: steps.release.outputs.released == 'true' run: uv publish env: - UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} # Fallback if Trusted Publishing is not set + UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index a5396c4..1daea62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ dev = [ [tool.semantic_release] version_toml = ["pyproject.toml:project.version"] +tag_format = "{version}" build_command = "uv build" [tool.semantic_release.branches.main] From 211dcfd9eb7e61c6485b9c261ea42cb57f5d2e34 Mon Sep 17 00:00:00 2001 From: lv10 Date: Sat, 14 Mar 2026 03:09:38 -0400 Subject: [PATCH 2/3] fix(ci): strictly use uv run for semantic-release and add version_variable --- .github/workflows/release.yml | 14 ++++++++++++-- pyproject.toml | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83f60cb..904dcc9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,9 +18,12 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} - name: Install uv uses: astral-sh/setup-uv@v5 + with: + enable-cache: true - name: Set up Python run: uv python install @@ -35,8 +38,15 @@ jobs: run: | git config --global user.name "github-actions [bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - uv run semantic-release version - uv run semantic-release publish + + # We run versioning and publishing manually via uv to ensure it has access to the environment + uv run semantic-release -v version + uv run semantic-release -v publish + + # Set output for the next step + if [ -f ".release_version" ]; then + echo "released=true" >> $GITHUB_OUTPUT + fi - name: Publish to PyPI if: steps.release.outputs.released == 'true' diff --git a/pyproject.toml b/pyproject.toml index 1daea62..b6eb469 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ dev = [ [tool.semantic_release] version_toml = ["pyproject.toml:project.version"] +version_variable = ["bestbuyapi/__init__.py:__version__"] tag_format = "{version}" build_command = "uv build" From aebad3caa10e1c4c49e0f7148e0390d4871d2f47 Mon Sep 17 00:00:00 2001 From: lv10 Date: Sat, 14 Mar 2026 03:11:15 -0400 Subject: [PATCH 3/3] whitespace issue fixed --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 904dcc9..bb04d4a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,11 +38,11 @@ jobs: run: | git config --global user.name "github-actions [bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - + # We run versioning and publishing manually via uv to ensure it has access to the environment uv run semantic-release -v version uv run semantic-release -v publish - + # Set output for the next step if [ -f ".release_version" ]; then echo "released=true" >> $GITHUB_OUTPUT