Discard commits to sync fork. #569
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: ID PASS - MOSIP Resident Application | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
- demobranch | |
tags: | |
- '*' | |
jobs: | |
build-android: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
# Cache stuff for faster build | |
- name: Cache local npm repository | |
uses: actions/[email protected] | |
with: | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
path: ~/.npm | |
- name: Cache local gradle repository | |
uses: actions/[email protected] | |
with: | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
- 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: Build App Newlogic Release | |
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 | |
./gradlew :app:assembleNewlogicRelease | |
env: | |
FIREBASE_SECRET: ${{ secrets.GPG_SECRET }} | |
- name: Upload Artifact | |
uses: actions/[email protected] | |
with: | |
name: output | |
path: android/app/build/outputs/apk/newlogic/release/ | |
retention-days: 1 |