fix(ci): move pyproject.toml update to script file
This commit is contained in:
		
							
								
								
									
										8
									
								
								.github/workflows/publish.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.github/workflows/publish.yml
									
									
									
									
										vendored
									
									
								
							@@ -34,13 +34,7 @@ jobs:
 | 
			
		||||
        uses: abatilo/actions-poetry@v3
 | 
			
		||||
      - name: Update pyproject.toml
 | 
			
		||||
        run:
 | 
			
		||||
          OLD_VERSION=$(grep ^version pyproject.toml | cut -d '"' -f 2)
 | 
			
		||||
          OLD_VERSION="\"$OLD_VERSION\""
 | 
			
		||||
          NEW_VERSION=$(echo "${{ needs.create_release.outputs.release_name }}" | cut -d '"' -f 2 | cut -d 'v' -f 2)
 | 
			
		||||
          NEW_VERSION="\"$NEW_VERSION\""
 | 
			
		||||
          sed -i "s+version = $OLD_VERSION+version = $NEW_VERSION+g" pyproject.toml
 | 
			
		||||
          cat pyproject.toml
 | 
			
		||||
          exit 1
 | 
			
		||||
          ./tools/update_pyproject.sh ${{ needs.create_release.outputs.release_name }}
 | 
			
		||||
      - name: Install dependencies
 | 
			
		||||
        run: poetry install
 | 
			
		||||
      - name: Build wheel file
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										9
									
								
								tools/update_pyproject.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										9
									
								
								tools/update_pyproject.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
OLD_VERSION=$(grep ^version pyproject.toml | cut -d '"' -f 2)
 | 
			
		||||
echo "OLD_VERSION: $OLD_VERSION"
 | 
			
		||||
OLD_VERSION="\"$OLD_VERSION\""
 | 
			
		||||
NEW_VERSION=$(echo "$1" | cut -d '"' -f 2 | cut -d 'v' -f 2)
 | 
			
		||||
echo "NEW_VERSION: $NEW_VERSION"
 | 
			
		||||
NEW_VERSION="\"$NEW_VERSION\""
 | 
			
		||||
sed -i "s+version = $OLD_VERSION+version = $NEW_VERSION+g" pyproject.toml
 | 
			
		||||
		Reference in New Issue
	
	Block a user