Skip to content

Merge pull request #34 from RowlandOti/release/2024/07/12-1 #49

Merge pull request #34 from RowlandOti/release/2024/07/12-1

Merge pull request #34 from RowlandOti/release/2024/07/12-1 #49

Workflow file for this run

name: Deploying to distribution lists
on:
push:
branches:
- main
jobs:
lint-check:
name: Lint Check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.DUKA_MERCHANT_SDK_KEY }}
- uses: actions/checkout@v2.3.1
with:
token: ${{secrets.GA_TOKEN}}
submodules: recursive
lfs: false
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v1
with:
java-version: 17
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Configure Keystore
run: |
echo "$ANDROID_KEYSTORE_FILE" > ./.buildsystem/keystore.jks.b64
base64 -d -i ./.buildsystem/keystore.jks.b64 > ./.buildsystem/keystore.jks
echo "storeFile=../.buildsystem/keystore.jks" >> ./.buildsystem/keystore.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> ./.buildsystem/keystore.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> ./.buildsystem/keystore.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> ./.buildsystem/keystore.properties
env:
ANDROID_KEYSTORE_FILE: ${{ secrets.ANDROID_KEYSTORE_FILE }}
KEYSTORE_KEY_ALIAS: ${{ secrets.ANDROID_KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_STORE_PASSWORD }}
- name: Lint checks
run: ./gradlew -Pci --console=plain lintDebug
spotless-check:
name: Spotless Check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.DUKA_MERCHANT_SDK_KEY }}
- uses: actions/checkout@v2.3.1
with:
token: ${{secrets.GA_TOKEN}}
submodules: recursive
lfs: false
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v1
with:
java-version: 17
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Configure Keystore
run: |
echo "$ANDROID_KEYSTORE_FILE" > ./.buildsystem/keystore.jks.b64
base64 -d -i ./.buildsystem/keystore.jks.b64 > ./.buildsystem/keystore.jks
echo "storeFile=../.buildsystem/keystore.jks" >> ./.buildsystem/keystore.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> ./.buildsystem/keystore.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> ./.buildsystem/keystore.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> ./.buildsystem/keystore.properties
env:
ANDROID_KEYSTORE_FILE: ${{ secrets.ANDROID_KEYSTORE_FILE }}
KEYSTORE_KEY_ALIAS: ${{ secrets.ANDROID_KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_STORE_PASSWORD }}
- name: Spotless check
run: ./gradlew -Pci --console=plain spotlessCheck
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.DUKA_MERCHANT_SDK_KEY }}
- uses: actions/checkout@v2.3.1
with:
token: ${{secrets.GA_TOKEN}}
submodules: recursive
lfs: false
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v1
with:
java-version: 17
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Configure Keystore
run: |
echo "$ANDROID_KEYSTORE_FILE" > ./.buildsystem/keystore.jks.b64
base64 -d -i ./.buildsystem/keystore.jks.b64 > ./.buildsystem/keystore.jks
echo "storeFile=../.buildsystem/keystore.jks" >> ./.buildsystem/keystore.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> ./.buildsystem/keystore.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> ./.buildsystem/keystore.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> ./.buildsystem/keystore.properties
env:
ANDROID_KEYSTORE_FILE: ${{ secrets.ANDROID_KEYSTORE_FILE }}
KEYSTORE_KEY_ALIAS: ${{ secrets.ANDROID_KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_STORE_PASSWORD }}
- name: Unit tests
run: ./gradlew -Pci --console=plain testDebugUnitTest
deploy:
name: Deploy to Firebase Distribution
runs-on: ubuntu-latest
needs: [lint-check, spotless-check, unit-tests]
steps:
- uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.DUKA_MERCHANT_SDK_KEY }}
- uses: actions/checkout@v3
with:
token: ${{secrets.GA_TOKEN}}
submodules: recursive
lfs: false
fetch-depth: 0
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v3
with:
distribution: 'adopt-hotspot'
java-version: 17
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Cache Ruby - Bundler
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Grant Permission to Execute
run: chmod +x gradlew
- name: Install bundle
run: |
gem update bundler
bundle update --bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Configure Keystore
run: |
echo "$ANDROID_KEYSTORE_FILE" > ./.buildsystem/keystore.jks.b64
base64 -d -i ./.buildsystem/keystore.jks.b64 > ./.buildsystem/keystore.jks
echo "storeFile=../.buildsystem/keystore.jks" >> ./.buildsystem/keystore.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> ./.buildsystem/keystore.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> ./.buildsystem/keystore.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> ./.buildsystem/keystore.properties
env:
ANDROID_KEYSTORE_FILE: ${{ secrets.ANDROID_KEYSTORE_FILE }}
KEYSTORE_KEY_ALIAS: ${{ secrets.ANDROID_KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_STORE_PASSWORD }}
- name: Create Firebase Service Config file
run: |
echo "$FIREBASE_SERVICES_CONFIG" > ./.buildsystem/firebase_services_config.json.b64
base64 -d -i ./.buildsystem/firebase_services_config.json.b64 > ./.buildsystem/firebase_services_config.json
env:
FIREBASE_SERVICES_CONFIG: ${{ secrets.FIREBASE_SERVICES_CONFIG }}
- name: Distribute app with Firebase App Distribution 🚀
run: bundle exec fastlane deployDistribute
env:
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}