Skip to content
Merged
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
19 changes: 10 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,26 @@ jobs:

- name: Bump version (automatic)
if: ${{ !inputs.force_version }}
id: auto_version
run: |
semantic-release version --no-push --no-commit
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Bump version (forced)
if: ${{ inputs.force_version }}
id: forced_version
run: |
sed -i 's/^version = ".*"/version = "${{ inputs.force_version }}"/' pyproject.toml

- name: Get version
id: version
run: |
VERSION=$(grep '^version = "' pyproject.toml | cut -d'"' -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "version=${{ inputs.force_version }}" >> $GITHUB_OUTPUT

- name: Commit and tag
env:
VERSION: ${{ steps.forced_version.outputs.version || steps.auto_version.outputs.version }}
run: |
git add pyproject.toml CHANGELOG.md 2>/dev/null || git add pyproject.toml
git commit -m "chore(release): bump version to ${{ steps.version.outputs.version }}" || echo "No changes to commit"
git tag -a "v${{ steps.version.outputs.version }}" -m "Release v${{ steps.version.outputs.version }}"
git commit -m "chore(release): bump version to $VERSION" || echo "No changes to commit"
git tag -a "v$VERSION" -m "Release v$VERSION"
git push origin main --tags

- uses: astral-sh/setup-uv@v3
Expand All @@ -71,6 +72,6 @@ jobs:
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.version }}
tag_name: v${{ steps.forced_version.outputs.version || steps.auto_version.outputs.version }}
generate_release_notes: true
files: dist/*