mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Improvements to version check CI script (#3455)
* Improvements to version check CI script * Fix typo * Allow duplicate version tags for 'stable' branch
This commit is contained in:
		| @@ -87,8 +87,16 @@ if __name__ == '__main__': | |||||||
|     # GITHUB_REF may be either 'refs/heads/<branch>' or 'refs/heads/<tag>' |     # GITHUB_REF may be either 'refs/heads/<branch>' or 'refs/heads/<tag>' | ||||||
|     GITHUB_REF = os.environ['GITHUB_REF'] |     GITHUB_REF = os.environ['GITHUB_REF'] | ||||||
|  |  | ||||||
|  |     GITHUB_REF_NAME = os.environ['GITHUB_REF_NAME'] | ||||||
|  |  | ||||||
|     GITHUB_BASE_REF = os.environ['GITHUB_BASE_REF'] |     GITHUB_BASE_REF = os.environ['GITHUB_BASE_REF'] | ||||||
|  |  | ||||||
|  |     # Print out version information, makes debugging actions *much* easier! | ||||||
|  |     print(f"GITHUB_REF: {GITHUB_REF}") | ||||||
|  |     print(f"GITHUB_REF_NAME: {GITHUB_REF_NAME}") | ||||||
|  |     print(f"GITHUB_REF_TYPE: {GITHUB_REF_TYPE}") | ||||||
|  |     print(f"GITHUB_BASE_REF: {GITHUB_BASE_REF}") | ||||||
|  |  | ||||||
|     version_file = os.path.join(here, '..', 'InvenTree', 'InvenTree', 'version.py') |     version_file = os.path.join(here, '..', 'InvenTree', 'InvenTree', 'version.py') | ||||||
|  |  | ||||||
|     version = None |     version = None | ||||||
| @@ -109,8 +117,19 @@ if __name__ == '__main__': | |||||||
|     print(f"InvenTree Version: '{version}'") |     print(f"InvenTree Version: '{version}'") | ||||||
|  |  | ||||||
|     # Check version number and look for existing versions |     # Check version number and look for existing versions | ||||||
|     # Note that on a 'tag' (release) we *must* allow duplicate versions, as this *is* the version that has just been released |     # If a release is found which matches the current tag, throw an error | ||||||
|     highest_release = check_version_number(version, allow_duplicate=GITHUB_REF_TYPE == 'tag') |  | ||||||
|  |     allow_duplicate = False | ||||||
|  |  | ||||||
|  |     # Note: on a 'tag' (release) we *must* allow duplicate versions, as this *is* the version that has just been released | ||||||
|  |     if GITHUB_REF_TYPE == 'tag': | ||||||
|  |         allow_duplicate = True | ||||||
|  |  | ||||||
|  |     # Note: on a push to 'stable' branch we also allow duplicates | ||||||
|  |     if GITHUB_BASE_REF == 'stable': | ||||||
|  |         allow_duplicate = True | ||||||
|  |  | ||||||
|  |     highest_release = check_version_number(version, allow_duplicate=allow_duplicate) | ||||||
|  |  | ||||||
|     # Determine which docker tag we are going to use |     # Determine which docker tag we are going to use | ||||||
|     docker_tags = None |     docker_tags = None | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user