diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index d47d3335b3..d0fa06b5ff 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -35,6 +35,7 @@ jobs: uses: actions/checkout@v2 - name: Version Check run: | + pip install requests python3 ci/version_check.py echo "git_commit_hash=$(git rev-parse --short HEAD)" >> $GITHUB_ENV echo "git_commit_date=$(git show -s --format=%ci)" >> $GITHUB_ENV diff --git a/.github/workflows/qc_checks.yaml b/.github/workflows/qc_checks.yaml index b3c9e18a78..9aa655545f 100644 --- a/.github/workflows/qc_checks.yaml +++ b/.github/workflows/qc_checks.yaml @@ -91,6 +91,10 @@ jobs: cache: 'pip' - name: Run pre-commit Checks uses: pre-commit/action@v2.0.3 + - name: Check Version + run: | + pip install requests + python3 ci/version_check.py python: name: Tests - inventree-python diff --git a/ci/version_check.py b/ci/version_check.py index 1b0aed83ff..b72074d91d 100644 --- a/ci/version_check.py +++ b/ci/version_check.py @@ -114,7 +114,7 @@ if __name__ == '__main__': docker_tags = None if GITHUB_REF_TYPE == 'tag': - # GITHUB_REF should be of th eform /refs/heads/ + # GITHUB_REF should be of the form /refs/heads/ version_tag = GITHUB_REF.split('/')[-1] print(f"Checking requirements for tagged release - '{version_tag}':") @@ -122,8 +122,6 @@ if __name__ == '__main__': print(f"Version number '{version}' does not match tag '{version_tag}'") sys.exit - # TODO: Check if there is already a release with this tag! - if highest_release: docker_tags = [version_tag, 'stable'] else: @@ -131,17 +129,6 @@ if __name__ == '__main__': elif GITHUB_REF_TYPE == 'branch': # Otherwise we know we are targetting the 'master' branch - print("Checking requirements for 'master' development branch:") - - pattern = r"^\d+(\.\d+)+ dev$" - result = re.match(pattern, version) - - if result is None: - print(f"Version number '{version}' does not match required pattern for development branch") - sys.exit(1) - else: - print(f"Version number '{version}' matches development branch") - docker_tags = ['latest'] else: @@ -153,7 +140,7 @@ if __name__ == '__main__': sys.exit(1) if docker_tags is None: - print("Docker tag could not be determined") + print("Docker tags could not be determined") sys.exit(1) print(f"Version check passed for '{version}'!")