CI CD automation build and deploy - inspireui/support GitHub Wiki

CI/CD: Auto upload build to Store use Codemagic.io

Create API key access Store

1. Create google service account and download file credenticials

Step 1: In Google Play Console, navigate to Settings > API access.

Step 2: Click on the Create Service Account button.

image

Step 3: Click on link to Google API Console.

image

Step 4: In Google API Console, click on the Create Service Account button.

image

Step 5: Enter service acttount name and click CREATE

image

Step 6: cick Select a role, select Service Account User and click CONTINUE

image

image

Step 7: click CREATE KEY

image

  • Choose JSON and click CRATE to download file credenticials

image

Step 8: Back in Google Play Console, click Done to close the dialog.

image

  • Click GRANT ACCESS

image

  • Choose Role is Release manager and Add an app. Final click ADD USER

image

2. Create key store app android

  • Create keystore
    keytool -genkey -v -keystore nameKey.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias name_alias_key
  • Create file key.properties
    storePassword=password
    keyPassword=password
    keyAlias=name_alias_key
    storeFile=nameKey.keystore

3. Setup code magic

Build Trigger

image

Setup variable environment

    FCI_KEY_ALIAS
    FCI_KEYSTORE_PASSWORD
    FCI_KEY_PASSWORD
    FCI_KEYSTORE_FILE

image

Create FCI_KEYSTORE_FILE

By terminal

  • Step 1: run command:
    openssl base64 -in <nameKey.keystore> -out <reuslt.txt>
  • Step 2: After run comment, open file result.txt and copy content add to FCI_KEYSTORE_FILE in codemagic

By codemagic

  • Step 1: Open the project settings page in codemagic and do the following:

CLick to Encrypt environment variable

  • Step 2: Choose a file keystore of android

image

  • Step 3: copy data after encode file keystore

image

Dependecy caching

image

Add script create key store

  • Before option Text, click to button ADD

image

  • Add script
    #!/usr/bin/env sh
    set -e # exit on first failed commandset
    echo $FCI_KEYSTORE_FILE | base64 --decode > $FCI_BUILD_DIR/nameKey.keystore

image

Publishing ANDROID

  • Add android code signing image

  • Upload file credentials google

image

Publishing IOS

  • Add info certificate and provisioning profiles
    • Provisioning profiles get in https://developer.apple.com/
    • Certificate is the file that was taken from the MAC computer that built the app for the first time. Specifically, this certificate must be registered in the provisioning profiles.

image

image

Run build


⚠️ **GitHub.com Fallback** ⚠️