@@ -74,10 +74,12 @@ runs:
7474 shell : bash
7575
7676 - name : Compute VERSIONCODE (iOS)
77+ id : compute-versioncode-ios
7778 if : ${{ inputs.os == 'ios' }}
7879 shell : bash
7980 run : |
80- bundle exec fastlane ios get_testflight_version
81+ VERSIONCODE=$(bundle exec fastlane ios get_testflight_version | tail -n1)
82+ echo "LATEST_VERSIONCODE=$VERSIONCODE" >> $GITHUB_OUTPUT
8183 working-directory : ios
8284 env :
8385 MATCH_KEYCHAIN_NAME : ${{ inputs.MATCH_KEYCHAIN_NAME }}
@@ -88,22 +90,21 @@ runs:
8890 FASTLANE_REPO_PAT : ${{ inputs.FASTLANE_REPO_PAT }}
8991
9092 - name : Compute VERSIONCODE (Android)
93+ id : compute-versioncode-android
9194 if : ${{ inputs.os == 'android' }}
9295 shell : bash
9396 run : |
94- bundle exec fastlane android version_code
97+ VERSIONCODE=$(bundle exec fastlane android version_code | tail -n1)
98+ echo "LATEST_VERSIONCODE=$VERSIONCODE" >> $GITHUB_OUTPUT
9599 working-directory : android
96100
97101 - name : Compute VERSIONCODE
98102 id : compute
99103 shell : bash
100104 env :
101- GITHUB_RUN_NUMBER : ${{ github.run_number }}
105+ LATEST_VERSIONCODE : ${{ steps.compute-versioncode-ios.outputs.LATEST_VERSIONCODE }} || ${{ steps.compute-versioncode-android.outputs.LATEST_VERSIONCODE }}
102106 run : |
103- # This offset is from CircleCI after we migrated to Github Actions in order to have sequential builds
104-
105- OFFSET=92000
106- VERSIONCODE=$((OFFSET + GITHUB_RUN_NUMBER))
107+ VERSIONCODE=$((LATEST_VERSIONCODE + 1))
107108 echo "VERSIONCODE=$VERSIONCODE" >> $GITHUB_OUTPUT
108109
109110 echo "### 📦 Version Code Generated" >> $GITHUB_STEP_SUMMARY
0 commit comments