Skip to content

Conversation

@bkeryan
Copy link
Collaborator

@bkeryan bkeryan commented May 21, 2025

What does this Pull Request accomplish?

Add the check-project-version action, which uses poetry version to get the project version and checks it against the GitHub release tag or a provided input.

Add the update-project-version action, which uses poetry version to bump the project version and then creates a pull request.

Update the version tags in README.md to @v0.2:

  • The next release of the action will be v0.2.0 because it adds new functionality in a backwards compatible manner.
  • Remove the patch/update version from the examples.

Add a table of contents to README.md, generated with the Markdown All In One VS Code extension.

Add PR/CI workflows which test the actions.

Why should this Pull Request be merged?

Enable automatic version bumps without pushing to main.

In https://github.com/ni/measurement-plugin-python we have been using a workflow that sets the version in pyproject.toml based on the release tag and uses https://github.com/casperwa/push-protected to push the version updates to main. We haven't been happy with this approach because the release tag/archive contain files with the wrong version number ( ni/measurement-plugin-python#162 ), and because failures during publishing tend to leave branch protections disabled.

What testing has been done?

@bkeryan bkeryan requested a review from mshafer-NI as a code owner May 21, 2025 22:04
@bkeryan
Copy link
Collaborator Author

bkeryan commented May 21, 2025

update_version.py testing:

PS C:\dev\nitypes-python> python C:\dev\python-actions\update-project-version\update_version.py major --dev
Bumping version from 1.0.0 to 2.0.0
Bumping version from 2.0.0 to 2.0.0.dev0
PS C:\dev\nitypes-python> python C:\dev\python-actions\update-project-version\update_version.py major --dev
Bumping version from 2.0.0.dev0 to 2.0.0.dev1
PS C:\dev\nitypes-python> python C:\dev\python-actions\update-project-version\update_version.py major --dev
Bumping version from 2.0.0.dev1 to 2.0.0.dev2
<edit file manually>
PS C:\dev\nitypes-python> python C:\dev\python-actions\update-project-version\update_version.py minor --dev
Bumping version from 2.0.0 to 2.1.0
Bumping version from 2.1.0 to 2.1.0.dev0
PS C:\dev\nitypes-python> python C:\dev\python-actions\update-project-version\update_version.py minor --dev
Bumping version from 2.1.0.dev0 to 2.1.0.dev1
PS C:\dev\nitypes-python> python C:\dev\python-actions\update-project-version\update_version.py minor --dev
Bumping version from 2.1.0.dev1 to 2.1.0.dev2
PS C:\dev\nitypes-python> python C:\dev\python-actions\update-project-version\update_version.py minor --dev
Bumping version from 2.1.0.dev2 to 2.1.0.dev3
PS C:\dev\nitypes-python> python C:\dev\python-actions\update-project-version\update_version.py minor --dev
Bumping version from 2.1.0.dev3 to 2.1.0.dev4
PS C:\dev\nitypes-python> python C:\dev\python-actions\update-project-version\update_version.py minor
Bumping version from 2.1.0.dev4 to 2.1.0
PS C:\dev\nitypes-python> python C:\dev\python-actions\update-project-version\update_version.py patch --dev
Bumping version from 2.1.0 to 2.1.1
Bumping version from 2.1.1 to 2.1.1.dev0
PS C:\dev\nitypes-python> python C:\dev\python-actions\update-project-version\update_version.py patch --dev
Bumping version from 2.1.1.dev0 to 2.1.1.dev1

@bkeryan
Copy link
Collaborator Author

bkeryan commented May 22, 2025

The project version error looks like this:

image

@bkeryan
Copy link
Collaborator Author

bkeryan commented May 22, 2025

The project version error looks like this:

also, on the summary page: https://github.com/ni/nitypes-python/actions/runs/15192239280

image

@bkeryan bkeryan changed the title Add update-project-version action Add check-project-version and update-project-version actions Jun 3, 2025
@bkeryan bkeryan force-pushed the users/bkeryan/update-project-version branch from e4fbd17 to b3e9a55 Compare June 4, 2025 21:07
@bkeryan bkeryan merged commit 2c946e7 into main Jun 4, 2025
2 checks passed
@bkeryan bkeryan deleted the users/bkeryan/update-project-version branch June 4, 2025 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants