forked from mosip/inji-wallet
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from tw-mosip/beta-release
feat(#INJI-173) [Adityan] Added a beta release workflow when tagged
- Loading branch information
Showing
10 changed files
with
201 additions
and
64 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
name: Android Beta Build | ||
|
||
env: | ||
backendServiceDefaultUrl: https://api.sandbox.mosip.net | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag to be published' | ||
required: true | ||
default: 'v1.2.3' | ||
type: string | ||
body: | ||
description: 'Release body message' | ||
required: true | ||
default: 'Changes in this Release' | ||
type: string | ||
pre-release: | ||
description: 'Pre-release? True/False' | ||
required: true | ||
default: False | ||
type: string | ||
backendServiceUrl: | ||
description: 'Backend service URL' | ||
required: true | ||
default: 'https://api.sandbox.mosip.net' | ||
type: string | ||
theme: | ||
description: 'Application Theme' | ||
required: true | ||
default: 'orange' | ||
type: choice | ||
options: | ||
- orange | ||
- purple | ||
buildDescription: | ||
description: 'What to test' | ||
required: true | ||
default: 'QA-Triple environment' | ||
type: string | ||
registry_edit: | ||
description: 'Edit Registry' | ||
required: true | ||
default: 'true' | ||
type: choice | ||
options: | ||
- false | ||
- true | ||
|
||
jobs: | ||
build-android: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: ${{ github.event.inputs.tag }} | ||
release_name: ${{ github.event.inputs.tag }} | ||
body: ${{ github.event.inputs.body }} | ||
draft: false | ||
prerelease: ${{fromJSON(github.event.inputs.pre-release)}} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Check for git tag | ||
run: | | ||
cd android/scripts | ||
./git-tag.sh | ||
- name: Install npm dependencies | ||
run: | | ||
npm ci | ||
- name: Create .env.local file | ||
run: | | ||
echo "${{ secrets.ENV_FILE }}" > .env.local > android/local.properties | ||
- name: Setup branch and env | ||
run: | | ||
# Strip git ref prefix from version | ||
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV | ||
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV | ||
- name: Setup branch and GPG public key | ||
run: | | ||
# Strip git ref prefix from version | ||
echo ${{ env.BRANCH_NAME }} | ||
echo ${{ env.GPG_TTY }} | ||
sudo apt-get --yes install gnupg2 | ||
gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg | ||
gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg | ||
- name: Setup Firebase | ||
run: | | ||
cd android | ||
if [ ! -z "$FIREBASE_SECRET" ] && [ -f app/google-services.json.gpg ];then rm -f app/google-services.json;gpg2 --quiet --batch --passphrase=$FIREBASE_SECRET --pinentry-mode loopback --decrypt --output app/google-services.json app/mosip-google-services.json.gpg;fi | ||
env: | ||
FIREBASE_SECRET: ${{ secrets.GPG_SECRET }} | ||
|
||
- name: Generate keystore | ||
run: | | ||
echo "$ANDROID_KEYSTORE_FILE" > release.keystore.b64 | ||
base64 -d -i release.keystore.b64 > android/app/release.keystore | ||
env: | ||
ANDROID_KEYSTORE_FILE: ${{ secrets.INJI_ANDROID_RELEASE_KEYSTORE }} | ||
|
||
- name: Export variables for keystore | ||
run: | | ||
cd android/app | ||
export RELEASE_KEYSTORE_ALIAS=androidreleasekey | ||
export RELEASE_KEYSTORE_PASSWORD=$RELEASE_KEYSTORE_PASSWORD | ||
env: | ||
RELEASE_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_RELEASE_STOREPASS}}' | ||
|
||
- name: Create Google Play Config file | ||
run : | | ||
cd android | ||
echo "$INJI_ANDROID_PLAY_STORE_CONFIG_JSON" > play_config.json.b64 | ||
base64 -d -i play_config.json.b64 > play_config.json | ||
env: | ||
INJI_ANDROID_PLAY_STORE_CONFIG_JSON: ${{ secrets.INJI_ANDROID_PLAY_STORE_CONFIG_JSON }} | ||
|
||
- name: Run Build | ||
run: | | ||
cd android/scripts | ||
./beta-build.sh | ||
env: | ||
MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }} | ||
APPLICATION_THEME: ${{ github.event.inputs.theme }} | ||
RELEASE_KEYSTORE_ALIAS: androidreleasekey | ||
RELEASE_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_RELEASE_STOREPASS}}' | ||
SLACK_URL: '${{ secrets.SLACK_WEBHOOK_DEVOPS }}' | ||
PLAY_CONSOLE_RELEASE_DESCRIPTION: ${{ github.event.inputs.buildDescription }} | ||
CREDENTIAL_REGISTRY_EDIT: ${{ github.event.inputs.registry_edit }} |
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cd .. | ||
|
||
yes | sudo gem install bundler | ||
|
||
yes | sudo fastlane install_plugins | ||
|
||
bundle exec fastlane android_build_beta |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
TAG=$(git describe --abbrev=0 --tags --exact-match HEAD 2>/dev/null) | ||
|
||
if [[ -z "$TAG" ]]; then | ||
echo "No tag found for the current commit. Please provide a Tag to proceed with the Build." | ||
exit 1 | ||
else | ||
echo "Tag for the current commit: $TAG" | ||
fi |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cd .. | ||
|
||
yes | sudo gem install bundler | ||
|
||
yes | sudo fastlane install_plugins | ||
|
||
bundle exec fastlane android_build_verify |