Skip to content

Commit 2c7691c

Browse files
authored
Merge pull request #541 from AVSLab/feature/540-beta-bumper
Auto-increment version number on PR merge into develop
2 parents 0ba9333 + 3e8c5d5 commit 2c7691c

File tree

4 files changed

+49
-1
lines changed

4 files changed

+49
-1
lines changed
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
on:
2+
pull_request:
3+
types:
4+
- closed
5+
branches:
6+
- develop
7+
8+
jobs:
9+
if_merged:
10+
if: github.event.pull_request.merged == true
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Pull repo
14+
uses: actions/checkout@v2
15+
with:
16+
ref: develop
17+
- name: Bump version
18+
run: ./.github/workflows/version-bumper.sh ./docs/source/bskVersion.txt
19+
- name: Commit and push
20+
run: |
21+
git config user.name github-actions
22+
git config user.email github-actions@github.com
23+
git commit -a -m "[AUTO] Bump version number"
24+
git push

.github/workflows/version-bumper.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
regex='([0-9]+\.[0-9]+\.)([0-9]+)'
4+
5+
# Read file line by line and process each line
6+
while IFS= read -r version || [[ -n "$version" ]]; do
7+
if [[ $version =~ $regex ]]; then
8+
# Extract the last number and increment it by one
9+
last_number=${BASH_REMATCH[2]}
10+
incremented_number=$((last_number + 1))
11+
# Replace the last number in the line
12+
updated_version=${BASH_REMATCH[1]}$incremented_number
13+
echo "Bumping from $version to $updated_version"
14+
else
15+
echo "Version $version is not in the format X.Y.Z; not updating version number"
16+
exit 0
17+
fi
18+
done < $1
19+
20+
echo "$updated_version" > $1

docs/source/Support/bskReleaseNotes.rst

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ Version |release|
3636
- Fixed a bug where the legacy variable logging API would either, not log at all or log at a rate different to the
3737
requested rate.
3838
- Fixed a python version checking bug that prevented Basilisk from compiling on Windows
39+
- Updated versioning to better follow the `semantic versioning <https://semver.org>`_ standard, in the format
40+
``MAJOR.MINOR.PATCH``. Releases will increment the minor version number, while pull requests into develop will
41+
automatically increment the patch number. This allows users to reference/require specific versions of Basilisk
42+
outside of the release cycle.
3943

4044
Version 2.2.1 (Dec. 22, 2023)
4145
-----------------------------

docs/source/bskVersion.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.2b0
1+
2.2.2

0 commit comments

Comments
 (0)