Skip to content

feat: add version bump script and action#8

Merged
znorgaard merged 11 commits intomainfrom
zn_versioning
Nov 18, 2024
Merged

feat: add version bump script and action#8
znorgaard merged 11 commits intomainfrom
zn_versioning

Conversation

@znorgaard
Copy link
Copy Markdown
Collaborator

This PR adds a ci/update-version script which can be used to update the version stored in pyproject.toml.

It also adds a github action triggered by a workflow dispatch (GUI) that will:

  1. Checkout this repository
  2. Compare the new version to the previous version to ensure it's higher
  3. Checkout a new branch
  4. Update the pyproject.toml script
  5. Commit the change and push up to github
  6. Open a pull request with the change

One thing to note is that we're using the github action token for these steps, so the initial commit and pull request will not trigger other automations. When a user merges the pull request, that merge commit will trigger other automations.

See this action trigger: https://github.com/seqwell/longplexpy/actions/runs/11746405567
From this PR: #7

Remaining automation steps:

  1. Add an action that will tag the commit with the chore(#.#.#) commit message
  2. Add an action that will generate a release when a tag is added to main matching the versioning pattern
  3. Add an action that will build and push the docker image to dockerhub on any merge to main (versioning of the image is handled in the docker-build-image script).

Comment on lines +43 to +56
echo "Updating pyproject.toml to version: ${VERSION}"

case "$OSTYPE" in
darwin*|bsd*)
echo "Using BSD sed style"
sed_no_backup=( -i '' )
;;
*)
echo "Using GNU sed style"
sed_no_backup=( -i )
;;
esac

sed -E "${sed_no_backup[@]}" "s/^(version[[:space:]]+=[[:space:]])\"(.*)\"/\1\"${VERSION}\"/" pyproject.toml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize if poetry is available you could do: poetry version ${NEW_VERSION}. And it will Just Work!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poetry is way cleaner! That's a great solution.

@clintval clintval removed their assignment Nov 13, 2024
Base automatically changed from zn_docker to main November 18, 2024 22:11
@znorgaard znorgaard merged commit be2642d into main Nov 18, 2024
@znorgaard znorgaard deleted the zn_versioning branch November 18, 2024 22:12
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