Update Ruff updates to v0.9.3 #114
This file contains 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: Increment version | |
on: | |
pull_request: | |
types: [opened, reopened] | |
jobs: | |
bump-version: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Setup python | |
id: setup_python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 | |
with: | |
python-version: '3.10' | |
- name: Get package version | |
id: package_version | |
run: echo "app_version="$(python setup.py --version) >> $GITHUB_OUTPUT | |
- name: 'Get latest tag' | |
id: latest_tag | |
run: | | |
echo "tag="$(git for-each-ref --sort=-creatordate --count 1 --format="%(refname:short)" "refs/tags/*") >> $GITHUB_OUTPUT | |
- name: Bump release version | |
id: bump_version | |
uses: christian-draeger/increment-semantic-version@18746485477492fd90f2664f8470b34d9208fa17 # 1.2.3 | |
with: | |
current-version: ${{ steps.latest_tag.outputs.tag}} | |
version-fragment: 'bug' | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@b5f58b2abc5763ade55e4e9d0fe52cd1ff7979ca # v5 | |
- name: Update version in pyproject.toml | |
id: update_version | |
run: | | |
echo Updating version from ${{ steps.package_version.outputs.app_version}} to ${{ steps.bump_version.outputs.next-version }} | |
sed -i 's/version = "${{ steps.package_version.outputs.app_version}}"/version = "${{ steps.bump_version.outputs.next-version }}"/' pyproject.toml | |
uv lock | |
git config user.name 'FSD Github Actions' | |
git config user.email "[email protected]" | |
git add pyproject.toml | |
git add uv.lock | |
git commit -m "Update version to ${{ steps.bump_version.outputs.next-version }}" | |
git push origin $GITHUB_HEAD_REF | |
echo "Updated pyproject.toml with version ${{ steps.bump_version.outputs.next-version }}" >> $GITHUB_STEP_SUMMARY |