Skip to content

[Core Library] ZMQ Network Recovery after Network Loss #46

[Core Library] ZMQ Network Recovery after Network Loss

[Core Library] ZMQ Network Recovery after Network Loss #46

name: Version Check
on:
pull_request:
branches:
- master
paths:
- "omnibus/**"
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Check for version change
run: |
VERSION_FILE="setup.py"
# Add the 'omnibus' directory to the Python path
PYTHONPATH="$PYTHONPATH:$(pwd)/omnibus"
export PYTHONPATH
# Extract current version
CURRENT_VERSION=$(cat setup.py | grep version | cut -d "=" -f2 | cut -d "," -f1)
echo "Current version: $CURRENT_VERSION"
# Fetch the file content from the master branch
git fetch origin master:refs/remotes/origin/master
# Extract previous version
PREVIOUS_VERSION=$(git show origin/master:$VERSION_FILE | grep version | cut -d "=" -f2 | cut -d "," -f1)
echo "Previous version: $PREVIOUS_VERSION"
if [ "$PREVIOUS_VERSION" != "$CURRENT_VERSION" ]; then
echo "Version changed: $PREVIOUS_VERSION -> $CURRENT_VERSION"
else
echo "Action detected changes in Omnibus core library without a version update."
echo "Please increment the minor or major version number to reflect these changes."
exit 1
fi