From 82b837ef336b9e9809a4ed022f5a05181fdce89c Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Mon, 5 Feb 2024 08:49:22 -0500 Subject: [PATCH] Update Version Bump workflow logic (#2975) --- .github/workflows/version-bump.yml | 33 ++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 92d7fe374..210b04233 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -36,7 +36,16 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: main - repository: bitwarden/mobile + + - name: Check if RC branch exists + if: ${{ inputs.cut_rc_branch == true }} + run: | + remote_rc_branch_check=$(git ls-remote --heads origin rc | wc -l) + if [[ "${remote_rc_branch_check}" -gt 0 ]]; then + echo "Remote RC branch exists." + echo "Please delete current RC branch before running again." + exit 1 + fi - name: Import GPG key uses: crazy-max/ghaction-import-gpg@d6f3f49f3345e29369fe57596a3ca8f94c4d2ca7 # v5.4.0 @@ -183,14 +192,22 @@ jobs: with: ref: main - - name: Check if RC branch exists + - name: Verify version has been updated + env: + NEW_VERSION: ${{ inputs.version_number }} run: | - remote_rc_branch_check=$(git ls-remote --heads origin rc | wc -l) - if [[ "${remote_rc_branch_check}" -gt 0 ]]; then - echo "Remote RC branch exists." - echo "Please delete current RC branch before running again." - exit 1 - fi + CURRENT_VERSION=$(xmllint --xpath ' + string(/manifest/@*[local-name()="versionName" + and namespace-uri()="http://schemas.android.com/apk/res/android"]) + ' src/Android/Properties/AndroidManifest.xml) + + # Wait for version to change. + while [[ "$NEW_VERSION" != "$CURRENT_VERSION" ]] + do + echo "Waiting for version to be updated..." + sleep 10 + git pull --force + done - name: Cut RC branch run: |