Skip to content

Make pythonjsonlogger import compatible with v2 and v3.1+, and restore get_lang #106

Make pythonjsonlogger import compatible with v2 and v3.1+, and restore get_lang

Make pythonjsonlogger import compatible with v2 and v3.1+, and restore get_lang #106

name: Increment version
on:
pull_request:
types: [opened, reopened]
jobs:
bump-version:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
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@4ac542a8ebf91f4edc224cbe3a19cc086826ae77 # 1.1.0
with:
current-version: ${{ steps.latest_tag.outputs.tag}}
version-fragment: 'bug'
- name: Install the latest version of uv
uses: astral-sh/setup-uv@e779db74266a80753577425b0f4ee823649f251d # v3
- 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 "fsd@levellingup.gov.uk"
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