Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-increment version number on PR merge into develop #541

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
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
24 changes: 24 additions & 0 deletions .github/workflows/pull-request-closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
pull_request:
types:
- closed
branches:
- develop

jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Pull repo
uses: actions/checkout@v2
with:
ref: develop
- name: Bump version
run: ./.github/workflows/version-bumper.sh ./docs/source/bskVersion.txt
- name: Commit and push
run: |
git config user.name github-actions
git config user.email [email protected]
git commit -a -m "[AUTO] Bump version number"
git push
20 changes: 20 additions & 0 deletions .github/workflows/version-bumper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

regex='([0-9]+\.[0-9]+\.)([0-9]+)'

# Read file line by line and process each line
while IFS= read -r version || [[ -n "$version" ]]; do
if [[ $version =~ $regex ]]; then
# Extract the last number and increment it by one
last_number=${BASH_REMATCH[2]}
incremented_number=$((last_number + 1))
# Replace the last number in the line
updated_version=${BASH_REMATCH[1]}$incremented_number
echo "Bumping from $version to $updated_version"
else
echo "Version $version is not in the format X.Y.Z; not updating version number"
exit 0
fi
done < $1

echo "$updated_version" > $1
4 changes: 4 additions & 0 deletions docs/source/Support/bskReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Version |release|
- Fixed a bug where the legacy variable logging API would either, not log at all or log at a rate different to the
requested rate.
- Fixed a python version checking bug that prevented Basilisk from compiling on Windows
- Updated versioning to better follow the `semantic versioning <https://semver.org>`_ standard, in the format
``MAJOR.MINOR.PATCH``. Releases will increment the minor version number, while pull requests into develop will
automatically increment the patch number. This allows users to reference/require specific versions of Basilisk
outside of the release cycle.

Version 2.2.1 (Dec. 22, 2023)
-----------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/bskVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.2b0
2.2.2
Loading