From eb488c4e36e846567ff45c1fa974eb7659aa07e2 Mon Sep 17 00:00:00 2001 From: Miles Wells Date: Wed, 6 Mar 2024 13:50:06 -0500 Subject: [PATCH] Fix workflow fetch remote --- .github/workflows/main.yaml | 31 ++++++++++++++++++------------- pyproject.toml | 2 +- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4682789..3749ce6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -10,27 +10,32 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v2 + - name: Setup Python + uses: actions/setup-python@v4 with: python-version: '3.11' + cache: 'pip' + cache-dependency-path: 'pyproject.toml' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and check version + pip install --editable . + pip install packaging + - name: Fetch versions + run: | + git fetch origin --tags + previous_version=$(git describe --tags --match="[0-9]*" origin/main) + latest_version=$(pip show project_extraction | awk '/^Version: / {sub("^Version: ", ""); print}') + echo "Version tag on main: $previous_version" + echo "Version tag on this branch: $latest_version" + echo "PREVIOUS_VERSION=$previous_version" >> $GITHUB_ENV + echo "LATEST_VERSION=latest_version" >> $GITHUB_ENV + - name: Assert 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"))) + sys.exit(int(version.parse("$PREVIOUS_VERSION") >= version.parse("$LATEST_VERSION"))) EOP - RC=$? - echo "Exit code $RC" - name: Push tag run: | - git tag -a "$new" HEAD + git tag -a "$new" HEAD -m "Version v$new" git push origin "$new" diff --git a/pyproject.toml b/pyproject.toml index 5ff5c27..134f002 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "project_extraction" -version = "0.2.1" +version = "0.2.1.post0" description = "Custom extractors for satellite tasks" dynamic = [ "readme" ] keywords = [ "IBL", "neuro-science" ]