prevent deployment race conditions (#3416)
This commit is contained in:
		
							parent
							
								
									46c112edfd
								
							
						
					
					
						commit
						443dfb5c3e
					
				
					 2 changed files with 23 additions and 6 deletions
				
			
		
							
								
								
									
										27
									
								
								.github/workflows/bundle-deploy-eas-update.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										27
									
								
								.github/workflows/bundle-deploy-eas-update.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -18,6 +18,10 @@ on: | |||
|         description: Runtime version (in x.x.x format) that this update is for | ||||
|         required: true | ||||
| 
 | ||||
| concurrency: | ||||
|     group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | ||||
|     cancel-in-progress: true | ||||
| 
 | ||||
| jobs: | ||||
|   bundleDeploy: | ||||
|     name: Bundle and Deploy EAS Update | ||||
|  | @ -44,7 +48,18 @@ jobs: | |||
|       - name: ⬇️ Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|         with: | ||||
|           fetch-depth: 100 | ||||
|           fetch-depth: 0 | ||||
| 
 | ||||
|       - name: ⬇️ Get last successful deployment commit from the cache | ||||
|         id: get-base-commit | ||||
|         uses: actions/cache@v4 | ||||
|         with: | ||||
|           path: last-successful-commit-hash.txt | ||||
|           key: last-successful-deployment-commit-${{ github.ref_name }} | ||||
| 
 | ||||
|       - name: Add the last successful deployment commit to the output | ||||
|         id: last-successful-commit | ||||
|         run: echo base-commit=$(cat last-successful-commit-hash.txt) >> "$GITHUB_OUTPUT" | ||||
| 
 | ||||
|       - name: ⬇️ Fetch commits from base branch | ||||
|         if: ${{ github.ref != 'refs/heads/main' }} | ||||
|  | @ -57,12 +72,12 @@ jobs: | |||
|           if [ -z "${{ inputs.channel == 'production' }}" ]; then | ||||
|             echo base-commit=$(git show-ref -s ${{ inputs.runtimeVersion }}) >> "$GITHUB_OUTPUT" | ||||
|           else | ||||
|             echo base-commit=$(git log -n 1 --skip 1 main --pretty=format:'%H') >> "$GITHUB_OUTPUT" | ||||
|             echo base-commit=${{ steps.last-successful-commit.base-commit }} >> "$GITHUB_OUTPUT" | ||||
|           fi | ||||
| 
 | ||||
|       - name: ✓ Make sure we found a base commit | ||||
|         run: | | ||||
|           if [ -z "${{ steps.base-commit.outputs.base-commit }}" ]; then | ||||
|           if [ -z "${{ steps.base-commit.outputs.base-commit }}" && ${{ inputs.channel == 'production' }} ]; then | ||||
|             echo "Could not find a base commit for this release. Exiting." | ||||
|             exit 1 | ||||
|           fi | ||||
|  | @ -82,7 +97,6 @@ jobs: | |||
|         uses: expo/expo-github-action/fingerprint@main | ||||
|         with: | ||||
|           previous-git-commit: ${{ steps.base-commit.outputs.base-commit }} | ||||
|           args: | ||||
| 
 | ||||
|       - name: 👀 Debug fingerprint | ||||
|         id: fingerprint-debug | ||||
|  | @ -90,7 +104,8 @@ jobs: | |||
|           echo "previousGitCommit=${{ steps.fingerprint.outputs.previous-git-commit }} currentGitCommit=${{ steps.fingerprint.outputs.current-git-commit }}" | ||||
|           echo "isPreviousFingerprintEmpty=${{ steps.fingerprint.outputs.previous-fingerprint == '' }}" | ||||
|            | ||||
|           fingerprintDiff="${{ steps.fingerprint.outputs.fingerprint-diff }}" | ||||
|           fingerprintDiff='$(echo "${{ steps.fingerprint.outputs.fingerprint-diff }}")' | ||||
|            | ||||
|           if [[ $fingerprintDiff =~ "bareRncliAutolinking" || $fingerprintDiff =~ "expoAutolinkingAndroid" || $fingerprintDiff =~ "expoAutolinkingIos" ]]; then | ||||
|             echo fingerprint-is-different="true" >> "$GITHUB_OUTPUT" | ||||
|           else | ||||
|  | @ -144,6 +159,8 @@ jobs: | |||
|           RUNTIME_VERSION: ${{ inputs.runtimeVersion }} | ||||
|           CHANNEL_NAME: ${{ inputs.channel || 'testflight' }} | ||||
| 
 | ||||
|       - name: Save successful deployment commit hash | ||||
|         run: echo ${{ steps.fingerprint.outputs.current-git-commit }} > last-successful-commit-hash.txt | ||||
| 
 | ||||
|   # GitHub actions are horrible so let's just copy paste this in | ||||
|   buildIfNecessaryIOS: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue