From 6057ce9646fda9f276b39969c56f222c0b5e7fcb Mon Sep 17 00:00:00 2001 From: Miles Wells Date: Wed, 6 Mar 2024 13:32:23 -0500 Subject: [PATCH] Workflow to assert version increase on merge --- .github/workflows/main.yaml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/main.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..4682789 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,36 @@ +name: Version Check + +on: + pull_request: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and check version + run: | + git fetch --tags + python setup.py sdist bdist_wheel + current=$(git describe --tags --match="[0-9]*" HEAD) + new=$(pip show ibllib | awk '/^Version: / {sub("^Version: ", ""); print}') + python <= version.parse("$new"))) + EOP + RC=$? + echo "Exit code $RC" + - name: Push tag + run: | + git tag -a "$new" HEAD + git push origin "$new"