GA stage - From BETA to GA #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "GA stage - From BETA to GA" | |
on: | |
workflow_dispatch: | |
inputs: | |
version_for_beta_channel: | |
description: 'Version of BETA app in format {major}-{minor}-{patch}-{releaseAutoIncrement}' | |
required: true | |
env: | |
# PACKAGE_APP_NAME -> no empty spaces or special character | |
APP_NAME: Hubis App | |
PACKAGE_APP_NAME: hubisapp | |
PACKAGE_ROOT_NAME: com.ocfulfillment | |
jobs: | |
build: | |
runs-on: buildjet-8vcpu-ubuntu-2204 | |
steps: | |
############################################################################################## | |
# SETUP | |
############################################################################################## | |
- name: Sourcecode checkout | |
uses: actions/checkout@v3 | |
- name: Format version from input into major.minor.patch-iterator | |
run: echo "APP_VERSION_NAME_DOTS=$(./.github/workflows/scripts/formatVersionDashToDots.sh ${{ github.event.inputs.version_for_beta_channel }})" >> $GITHUB_ENV | |
shell: bash | |
############################################################################################## | |
# CHECK CURRENT STAGE STATUS | |
############################################################################################## | |
- name: Get Google Cloud Platform access | |
uses: google-github-actions/setup-gcloud@v0.2.1 | |
with: | |
project_id: 'ocff-infra-artifacts-v1' | |
service_account_key: ${{ secrets.GOOGLE_BUCKET_CREDENTIALS }} | |
export_default_credentials: true | |
- name: Check that ALPHA stage is set (Google Cloud Storage) | |
run: ./.github/workflows/scripts/stageExistsCheck.sh ${{ github.event.inputs.version_for_beta_channel }} alpha ${{ env.PACKAGE_APP_NAME }} | |
shell: bash | |
- name: Check that BETA stage is set (Google Cloud Storage) | |
run: ./.github/workflows/scripts/stageExistsCheck.sh ${{ github.event.inputs.version_for_beta_channel }} beta ${{ env.PACKAGE_APP_NAME }} | |
shell: bash | |
- name: Check that no GA stage is set (Google Cloud Storage) | |
run: ./.github/workflows/scripts/stageDoesntExistsCheck.sh ${{ github.event.inputs.version_for_beta_channel }} ga ${{ env.PACKAGE_APP_NAME }} | |
shell: bash | |
############################################################################################## | |
# GIT TAG HANDLING | |
############################################################################################## | |
# TODO - MOVE TO BOTTOM UNDER "MOVE FROM ALPHA TO BETA STAGE"! | |
- name: Rename GitHub Release & Tag | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release edit "${{ env.PACKAGE_APP_NAME }}_${{ env.APP_VERSION_NAME_DOTS }}" --title="${{ env.PACKAGE_APP_NAME }}_${{ env.APP_VERSION_NAME_DOTS }}" --prerelease=false --latest=true | |
############################################################################################## | |
# MOVE FROM BETA TO GA STAGE | |
############################################################################################## | |
- name: Move app from BETA to GA stage (Google Cloud Storage) | |
run: gcloud storage cp -r gs://ocff-deployment-mobileapps/$PACKAGE_APP_NAME/android/releases/${{ github.event.inputs.version_for_beta_channel }}/beta gs://ocff-deployment-mobileapps/$PACKAGE_APP_NAME/android/releases/${{ github.event.inputs.version_for_beta_channel }}/ga | |
- name: Download files from GA stage for Google Play Store upload | |
run: | | |
mkdir downloads | |
gcloud storage cp -r gs://ocff-deployment-mobileapps/$PACKAGE_APP_NAME/android/releases/${{ github.event.inputs.version_for_beta_channel }}/ga ./downloads | |
- name: Upload Android App Bundle (*.aab) to Google Play Store (GA track) | |
uses: r0adkll/upload-google-play@8c2ebfdb6e1b439d3a31d35772b3f0f489d688c9 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }} | |
packageName: ${{ env.PACKAGE_ROOT_NAME }} | |
releaseFiles: ./downloads/ga/${{ env.PACKAGE_APP_NAME }}_${{ github.event.inputs.version_for_beta_channel }}_release.aab | |
releaseName: ${{ env.APP_NAME }} (${{ env.APP_VERSION_NAME_DOTS }}) | |
track: production | |
status: completed | |
mappingFile: ./downloads/ga/mapping.txt |