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

Feature/ci maintain #228

Merged
merged 1 commit into from
Feb 27, 2025
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
30 changes: 30 additions & 0 deletions .github/workflows/pull_request_closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Pull Request Closed"

on:
pull_request:
types:
- closed
branches:
- develop
workflow_dispatch:

jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Pull repo
uses: actions/checkout@v4
with:
ref: develop
fetch-depth: 0
token: ${{ secrets.BOT_ACCESS_TOKEN }}
- name: Bump version
run: ./.github/workflows/version-bumper.sh ./pyproject.toml
- name: Commit and push
run: |
git config user.name "AVSlabBot"
git config user.email "[email protected]"
git commit -a -m "[AUTO] Bump minor version number"
git push

34 changes: 34 additions & 0 deletions .github/workflows/version_bumper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

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

# Check if argument is provided
if [[ -z "$1" ]]; then
echo "Usage: $0 <path-to-pyproject.toml>"
exit 1
fi

file="$1"

# Check if file exists
if [[ ! -f "$file" ]]; then
echo "Error: File $file not found!"
exit 1
fi

# Extract the version line
version_line=$(grep '^version =' "$file")
if [[ $version_line =~ $regex ]]; then
# Extract and increment the last number
last_number=${BASH_REMATCH[2]}
incremented_number=$((last_number + 1))
updated_version=${BASH_REMATCH[1]}$incremented_number

# Update the version in the pyproject.toml file
sed -i '' "s/version = \"${BASH_REMATCH[1]}${last_number}\"/version = \"$updated_version\"/" "$file"

echo "Version updated to $updated_version in $file"
else
echo "Error: Version not found in $file or not in X.Y.Z format"
exit 1
fi
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
# sys.path.insert(0, os.path.abspath(os.path.join("..", "..", "src")))
now = datetime.datetime.now()

project = "BSK-RL"
release = metadata.version("bsk_rl")
project = "BSK-RL v" + release
copyright = str(now.year) + ", Autonomous Vehicle Systems (AVS) Laboratory"
author = "Mark Stephenson"
release = metadata.version("bsk_rl")
version = "Version " + release

# -- General configuration ---------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions docs/source/release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Release Notes
=============

Development Version
-------------------
*Release Date: MMM. DD, YYYY*
Development - |version|
-----------------------
.. *Release Date: MMM. DD, YYYY*

* Add ability in :class:`~bsk_rl.obs.SatProperties` to define new observations with
a custom function.
Expand Down
Loading