2021-04-05 19:11:28 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								#!/bin/bash
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set  -euxo pipefail 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-13 15:02:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  [ [  ! ${ RELEASE_SKIP_TEST :- }  ] ] ;  then  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									../gradlew build  # also runs tests 
							 
						 
					
						
							
								
									
										
										
										
											2023-01-18 02:55:07 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								elif  [ [  ! ${ RELEASE_SKIP_INSTALL :- }  ] ] ;  then  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									../gradlew install
							 
						 
					
						
							
								
									
										
										
										
											2021-07-13 15:02:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								fi  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-25 21:15:22 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Check packaging constraint.  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								python -c 'import setuptools; where="./src"; assert setuptools.find_packages(where) == setuptools.find_namespace_packages(where), "you seem to be missing or have extra __init__.py files"' 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 12:15:52 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  [ [  ${ RELEASE_VERSION :- }  ] ] ;  then  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # Replace version with RELEASE_VERSION env variable 
							 
						 
					
						
							
								
									
										
										
										
											2024-01-22 11:46:04 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    sed -i.bak " s/__version__ = \"1\!0.0.0.dev0\"/__version__ = \" $( echo  $RELEASE_VERSION | sed s/-/+/) \"/ "  src/datahub/__init__.py
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 12:15:52 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								else  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    vim src/datahub/__init__.py
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								fi  
						 
					
						
							
								
									
										
										
										
											2021-04-05 19:11:28 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								rm -rf build dist ||  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								python -m build
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 15:11:25 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  [ [  ! ${ RELEASE_SKIP_UPLOAD :- }  ] ] ;  then  
						 
					
						
							
								
									
										
										
										
											2021-11-16 12:15:52 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    python -m twine upload 'dist/*' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								fi  
						 
					
						
							
								
									
										
										
										
											2021-07-13 15:02:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								git restore src/datahub/__init__.py