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
28 changes: 24 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,38 @@ 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

- 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"

# 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'
run: uv publish
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} # Fallback if Trusted Publishing is not set
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ dev = [

[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
version_variable = ["bestbuyapi/__init__.py:__version__"]
tag_format = "{version}"
build_command = "uv build"

[tool.semantic_release.branches.main]
Expand Down
Loading