diff --git a/.github/workflows/hardReleaseTele.yml b/.github/workflows/hardReleaseTele.yml index 4280a6b8..e2e55663 100644 --- a/.github/workflows/hardReleaseTele.yml +++ b/.github/workflows/hardReleaseTele.yml @@ -49,13 +49,13 @@ jobs: token: ${{ secrets.MY_REPO_PAT }} submodules: recursive - name: update codepush key QA - if: (inputs.environment == 'QA' || inputs.environment == 'QA') + if: inputs.environment == 'QA' run: sed -i "s/pastekeyhere/${{ secrets.CODEPUSH_QA_KEY }}/" android/app/src/main/res/values/strings.xml && cat android/app/src/main/res/values/strings.xml - name: update codepush key PROD - if: (inputs.environment == 'Prod' || inputs.environment == 'Prod') + if: inputs.environment == 'Prod' run: sed -i "s/pastekeyhere/${{ secrets.TELE_CODE_PUSH_PROD_KEY }}/" android/app/src/main/res/values/strings.xml && cat android/app/src/main/res/values/strings.xml - name: Generate keystore - if: (inputs.type == 'release' || inputs.type == 'release') + if: inputs.type == 'release' run: echo "${{ secrets.KEY_STORE }}" > keystore.asc && gpg -d --passphrase "${{ secrets.PASSPHARASE }}" --batch keystore.asc > android/app/my-upload-key.keystore - name: Set Node.js 16.x uses: actions/setup-node@v3 @@ -74,8 +74,8 @@ jobs: - name: Log Build Metadata run: | echo "Commit SHA: ${{ github.sha }}" - echo "Build Environment: ${{ inputs.environment || inputs.environment }}" - echo "Build Type: ${{ inputs.type || inputs.type }}" + echo "Build Environment: ${{ inputs.environment }}" + echo "Build Type: ${{ inputs.type }}" echo "App Version Code: $(awk '/VERSION_CODE/ {print $4}' app/build.gradle)" echo "App Version Name: $(awk '/VERSION_NAME/ {print $4}' app/build.gradle | tr -d '"')" - name: Set up JDK 18 @@ -90,24 +90,24 @@ jobs: - name: Create local.properties run: cd android && touch local.properties && echo "sdk.dir = /home/USERNAME/Android/Sdk" > local.properties - name: Assemble with Stacktrace - Calling QA release - if: ((inputs.environment == 'QA' || inputs.environment == 'QA')) + if: inputs.environment == 'QA' run: yarn move:qa && cd android && ./gradlew assemblecallingAgentsQARelease - name: Assemble with Stacktrace - Calling PROD release - if: ((inputs.environment == 'Prod' || inputs.environment == 'Prod')) + if: inputs.environment == 'Prod' run: yarn move:prod && cd android && ./gradlew assemblefieldAgentsProdRelease - name: Give server ack - if: ((inputs.releaseType != 'TEST_BUILD' || inputs.releaseType != 'TEST_BUILD')) + if: inputs.releaseType != 'TEST_BUILD' run: | ls ls -asl pwd baseUrl=${{secrets.LONGHORN_QA_BASE_URL}} - if [ "${{ inputs.environment }}" == "Prod" ] || [ "${{ inputs.environment }}" == "Prod" ]; then + if [ "${{ inputs.environment }}" == "Prod" ]; then echo "Prod" baseUrl=${{secrets.LONGHORN_PROD_BASE_URL}} fi echo "$baseUrl" - getPreSignedURL="$baseUrl/app/upload-url?appType=callingAgents&buildNumber=${{inputs.version_code || inputs.version_code}}&appVersion=${{inputs.version_name || inputs.version_name}}&releaseType=${{inputs.releaseType || inputs.releaseType}}" + getPreSignedURL="$baseUrl/app/upload-url?appType=callingAgents&buildNumber=${{inputs.version_code}}&appVersion=${{inputs.version_name}}&releaseType=${{inputs.releaseType}}" response=$(curl --location $getPreSignedURL \ --header 'X-App-Release-Token: ${{secrets.LONGHORN_HEADER}}' ) @@ -122,7 +122,7 @@ jobs: ls - apk_path="./android/app/build/outputs/apk/callingAgentsProd/${{inputs.type || inputs.type}}/app-callingAgentsProd-release" + apk_path="./android/app/build/outputs/apk/callingAgentsProd/${{inputs.type}}/app-callingAgentsProd-release" echo "$apk_path" @@ -142,7 +142,7 @@ jobs: echo "ack url" - ack_url=("$baseUrl/app/upload-ack?referenceId=${id}&releaseType=${{inputs.releaseType || inputs.releaseType}}") + ack_url=("$baseUrl/app/upload-ack?referenceId=${id}&releaseType=${{inputs.releaseType}}") echo "$ack_url" @@ -151,14 +151,14 @@ jobs: - name: Upload APK as Artifact uses: actions/upload-artifact@v3 with: - name: app-${{ inputs.type || inputs.type }}-v${{ inputs.version_code || inputs.version_code }}-name-${{inputs.version_name || inputs.version_name}} - path: android/app/build/outputs/apk/callingAgentsProd/${{inputs.type || inputs.type}} + name: app-${{ inputs.type }}-v${{ inputs.version_code }}-name-${{inputs.version_name}} + path: android/app/build/outputs/apk/callingAgentsProd/${{inputs.type}} retention-days: 30 generate_source_map: needs: generate runs-on: [default] - if: success() && (inputs.environment == 'Prod') && (inputs.releaseType == 'HARD_RELEASE' || inputs.releaseType == 'HARD_RELEASE') # Only create source map for Prod releases and not for test builds + if: success() && inputs.environment == 'Prod' && inputs.releaseType == 'HARD_RELEASE' # Only create source map for Prod releases and not for test builds steps: - name: Checkout uses: actions/checkout@v2 @@ -220,7 +220,7 @@ jobs: create_release_tag: needs: generate_source_map runs-on: [default] - if: success() && (inputs.environment == 'Prod') && (inputs.releaseType == 'HARD_RELEASE' || inputs.releaseType == 'HARD_RELEASE') # Only create source map for Prod releases and not for test builds + if: success() && inputs.environment == 'Prod' && inputs.releaseType == 'HARD_RELEASE' # Only create source map for Prod releases and not for test builds steps: - name: Checkout uses: actions/checkout@v2 @@ -231,7 +231,7 @@ jobs: - name: Check if tag exists id: check_tag run: | - TAG_NAME="${{inputs.version_name || inputs.version_name}}" + TAG_NAME="${{inputs.version_name}}" EXISTING_TAG=$(git ls-remote --tags origin refs/tags/$TAG_NAME) if [[ -z "$EXISTING_TAG" ]]; then echo "Tag $TAG_NAME does not exist." @@ -244,7 +244,7 @@ jobs: - name: Create and push tag if: env.tag_exists == 'false' run: | - TAG_NAME="${{inputs.version_name || inputs.version_name}}" + TAG_NAME="${{inputs.version_name}}" # git config --local user.email "${{ github.actor }}@github.com" git config --local user.name "${{ github.actor }}" git tag $TAG_NAME @@ -253,7 +253,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.MY_REPO_PAT }} - name: Create release tag run: | - TAG_NAME="${{inputs.version_name || inputs.version_name}}" + TAG_NAME="${{inputs.version_name}}" BUILD_NUMBER="${{ needs.generate.outputs.build_number }}" RELEASE_NAME="$TAG_NAME (build $BUILD_NUMBER) code push" DESCRIPTION="${{ inputs.description }}" diff --git a/.github/workflows/newBuild.yml b/.github/workflows/newBuild.yml index d11bc6e8..e3db009f 100644 --- a/.github/workflows/newBuild.yml +++ b/.github/workflows/newBuild.yml @@ -59,7 +59,7 @@ jobs: token: ${{ secrets.MY_REPO_PAT }} submodules: recursive - name: Update CodePush key for QA - if: (inputs.environment == 'QA' || inputs.environment == 'QA') + if: inputs.environment == 'QA' run: | if [[ "${{inputs.runnerType}}" == "macos" ]]; then sed -i "" "s/pastekeyhere/${{ secrets.CODEPUSH_QA_KEY }}/" android/app/src/main/res/values/strings.xml @@ -68,7 +68,7 @@ jobs: fi cat android/app/src/main/res/values/strings.xml - name: Update CodePush key for PROD - if: (inputs.environment == 'Prod' || inputs.environment == 'Prod') + if: inputs.environment == 'Prod' run: | if [[ "${{inputs.runnerType}}" == "macos" ]]; then sed -i "" "s/pastekeyhere/${{ secrets.CODEPUSH_PROD_KEY }}/" android/app/src/main/res/values/strings.xml @@ -77,7 +77,7 @@ jobs: fi cat android/app/src/main/res/values/strings.xml - name: Generate keystore - if: (inputs.type == 'release' || inputs.type == 'release') + if: inputs.type == 'release' run: echo "${{ secrets.KEY_STORE }}" > keystore.asc && gpg -d --passphrase "${{ secrets.PASSPHARASE }}" --batch keystore.asc > android/app/my-upload-key.keystore - name: Set Node.js 16.x uses: actions/setup-node@v3 @@ -106,8 +106,8 @@ jobs: - name: Log Build Metadata run: | echo "Commit SHA: ${{ github.sha }}" - echo "Build Environment: ${{ inputs.environment || inputs.environment }}" - echo "Build Type: ${{ inputs.type || inputs.type }}" + echo "Build Environment: ${{ inputs.environment }}" + echo "Build Type: ${{ inputs.type }}" echo "App Version Code: $(awk '/VERSION_CODE/ {print $4}' app/build.gradle)" echo "App Version Name: $(awk '/VERSION_NAME/ {print $4}' app/build.gradle | tr -d '"')" - name: Set up JDK 18 @@ -122,30 +122,30 @@ jobs: - name: Create local.properties run: cd android && touch local.properties && echo "sdk.dir = /home/USERNAME/Android/Sdk" > local.properties - name: Assemble with Stacktrace - Field QA release - if: ((inputs.environment == 'QA' || inputs.environment == 'QA') && (flavor.type == 'fieldAgents' || inputs.flavor == 'fieldAgents')) + if: (inputs.environment == 'QA' && inputs.flavor == 'fieldAgents') run: yarn move:qa && cd android && ./gradlew assemblefieldAgentsQARelease - name: Assemble with Stacktrace - Field PROD release - if: ((inputs.environment == 'Prod' || inputs.environment == 'Prod') && (flavor.type == 'fieldAgents' || inputs.flavor == 'fieldAgents')) + if: (inputs.environment == 'Prod' && inputs.flavor == 'fieldAgents') run: yarn move:prod && cd android && ./gradlew assemblefieldAgentsProdRelease - name: Assemble with Stacktrace - Calling QA release - if: ((inputs.environment == 'QA' || inputs.environment == 'QA') && (flavor.type == 'callingAgents' || inputs.flavor == 'callingAgents')) + if: (inputs.environment == 'QA' && inputs.flavor == 'callingAgents') run: yarn move:qa && cd android && ./gradlew assemblecallingAgentsQARelease - name: Assemble with Stacktrace - Calling PROD release - if: ((inputs.environment == 'Prod' || inputs.environment == 'Prod') && (flavor.type == 'callingAgents' || inputs.flavor == 'callingAgents')) + if: (inputs.environment == 'Prod' && inputs.flavor == 'callingAgents') run: yarn move:prod && cd android && ./gradlew assemblefieldAgentsProdRelease - name: Give server ack - if: ((inputs.releaseType != 'TEST_BUILD' || inputs.releaseType != 'TEST_BUILD')) + if: (inputs.releaseType != 'TEST_BUILD') run: | ls ls -asl pwd baseUrl=${{secrets.LONGHORN_QA_BASE_URL}} - if [ "${{ inputs.environment }}" == "Prod" ] || [ "${{ inputs.environment }}" == "Prod" ]; then + if [ "${{ inputs.environment }}" == "Prod" ]; then echo "Prod" baseUrl=${{secrets.LONGHORN_PROD_BASE_URL}} fi echo "$baseUrl" - getPreSignedURL="$baseUrl/app/upload-url?appType=${{inputs.flavor || inputs.flavor}}&buildNumber=${{inputs.version_code || inputs.version_code}}&appVersion=${{inputs.version_name || inputs.version_name}}&releaseType=${{inputs.releaseType || inputs.releaseType}}" + getPreSignedURL="$baseUrl/app/upload-url?appType=${{inputs.flavor}}&buildNumber=${{inputs.version_code}}&appVersion=${{inputs.version_name}}&releaseType=${{inputs.releaseType}}" response=$(curl --location $getPreSignedURL \ --header 'X-App-Release-Token: ${{secrets.LONGHORN_HEADER}}' ) @@ -160,7 +160,7 @@ jobs: ls - apk_path="./android/app/build/outputs/apk/${{ inputs.flavor || inputs.flavor }}${{inputs.environment || inputs.environment}}/${{inputs.type || inputs.type}}/app-${{ inputs.flavor || inputs.flavor }}${{inputs.environment || inputs.environment}}-release.apk" + apk_path="./android/app/build/outputs/apk/${{ inputs.flavor }}${{inputs.environment}}/${{inputs.type}}/app-${{ inputs.flavor }}${{inputs.environment}}-release.apk" echo "$apk_path" @@ -180,7 +180,7 @@ jobs: echo "ack url" - ack_url=("$baseUrl/app/upload-ack?referenceId=${id}&releaseType=${{inputs.releaseType || inputs.releaseType}}") + ack_url=("$baseUrl/app/upload-ack?referenceId=${id}&releaseType=${{inputs.releaseType}}") echo "$ack_url" @@ -189,8 +189,8 @@ jobs: - name: Upload APK as Artifact uses: actions/upload-artifact@v4 with: - name: app-${{ inputs.type || inputs.type }}-v${{ inputs.version_code || inputs.version_code }}-name-${{inputs.version_name || inputs.version_name}} - path: android/app/build/outputs/apk/${{ inputs.flavor || inputs.flavor }}${{inputs.environment || inputs.environment}}/${{inputs.type || inputs.type}} + name: app-${{ inputs.type }}-v${{ inputs.version_code }}-name-${{inputs.version_name}} + path: android/app/build/outputs/apk/${{ inputs.flavor }}${{inputs.environment}}/${{inputs.type}} retention-days: 30 generate_source_map: @@ -199,7 +199,7 @@ jobs: outputs: package_version: ${{ needs.generate.outputs.package_version }} build_number: ${{ needs.generate.outputs.build_number }} - if: success() && (inputs.environment == 'Prod') && (inputs.releaseType == 'HARD_RELEASE' || inputs.releaseType == 'HARD_RELEASE') # Only create source map for Prod releases and not for test builds + if: success() && inputs.environment == 'Prod' && inputs.releaseType == 'HARD_RELEASE' # Only create source map for Prod releases and not for test builds steps: - name: Checkout uses: actions/checkout@v2 @@ -266,7 +266,7 @@ jobs: upload_sourcemap_cybertron: needs: generate_source_map runs-on: ${{ inputs.runnerType }} - if: success() && (inputs.environment == 'Prod') + if: success() && inputs.environment == 'Prod' steps: - name: Download Source Map uses: actions/download-artifact@v4 @@ -299,7 +299,7 @@ jobs: create_release_tag: needs: generate_source_map runs-on: ${{ inputs.runnerType }} - if: success() && (inputs.environment == 'Prod') && (inputs.releaseType == 'HARD_RELEASE' || inputs.releaseType == 'HARD_RELEASE') # Only create source map for Prod releases and not for test builds + if: success() && inputs.environment == 'Prod' && inputs.releaseType == 'HARD_RELEASE' # Only create source map for Prod releases and not for test builds steps: - name: Checkout uses: actions/checkout@v2 @@ -310,7 +310,7 @@ jobs: - name: Check if tag exists id: check_tag run: | - TAG_NAME="${{inputs.version_name || inputs.version_name}}" + TAG_NAME="${{inputs.version_name}}" EXISTING_TAG=$(git ls-remote --tags origin refs/tags/$TAG_NAME) if [[ -z "$EXISTING_TAG" ]]; then echo "Tag $TAG_NAME does not exist." @@ -323,7 +323,7 @@ jobs: - name: Create and push tag if: env.tag_exists == 'false' run: | - TAG_NAME="${{inputs.version_name || inputs.version_name}}" + TAG_NAME="${{inputs.version_name}}" # git config --local user.email "${{ github.actor }}@github.com" git config --local user.name "${{ github.actor }}" git tag $TAG_NAME @@ -332,7 +332,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.MY_REPO_PAT }} - name: Create release tag run: | - TAG_NAME="${{inputs.version_name || inputs.version_name}}" + TAG_NAME="${{inputs.version_name}}" BUILD_NUMBER="${{ needs.generate.outputs.build_number }}" RELEASE_NAME="$TAG_NAME (build $BUILD_NUMBER) code push" DESCRIPTION="${{ inputs.description }}"