fix: updated function to access secrets #21
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: Dev Deployment | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
dev-distribution: | |
runs-on: ubuntu-latest | |
name: Development Distribution | |
env: | |
MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.ANDROID_SIGNING_ALIAS }} | |
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} | |
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v3 | |
# Cache npm dependencies (from GitHub docs) | |
- name: Cache node modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
# If there's a cache miss | |
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
name: List the state of node modules | |
continue-on-error: true | |
run: npm list | |
# Caching process complete | |
- name: Install dependencies | |
run: npm install | |
- name: Lint check | |
run: npm run lint | |
- name: Run tests | |
run: npm run test | |
- name: Cache Gradle Wrapper | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Cache Gradle Dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
restore-keys: ${{ runner.os }}-gradle-caches- | |
# Start the build process | |
- name: Make Gradlew Executable | |
run: | | |
cd android && chmod +x ./gradlew | |
- name: Generate App APK | |
run: | | |
cd android && ./gradlew assembleRelease --no-daemon | |
# - name: Build Android App Bundle | |
# run: cd android && ./gradlew bundleRelease --no-daemon | |
- name: Check if keystore file is present (debug) | |
run: | | |
ls -a android/app/build/outputs/apk/release | |
# ls -a android/app/build/outputs/bundle/release | |
- name: Sign generated APK | |
id: sign_app | |
uses: r0adkll/sign-android-release@v1 | |
with: | |
releaseDirectory: android/app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} | |
alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} | |
keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} | |
- name: Check app directory after signing (debug) | |
run: | | |
ls -a android/app/build/outputs/apk/release | |
# - name: Sign App Bundle | |
# id: sign_app | |
# uses: r0adkll/sign-android-release@v1 | |
# with: | |
# releaseDirectory: android/app/build/outputs/bundle/release | |
# signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} | |
# alias: ${{ secrets.ANDROID_SIGNING_ALIAS }} | |
# keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} | |
# keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} | |
# - name: Upload Artifact | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: Signed App Bundle | |
# path: ${{steps.sign_app.outputs.signedReleaseFile}} | |
# - name: Deploy to Play Store (Internal testing) | |
# uses: r0adkll/upload-google-play@v1 | |
# with: | |
# serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT }} | |
# packageName: com.thebest.gamchha | |
# releaseFile: a${{steps.sign_app.outputs.signedReleaseFile}} | |
# track: beta | |
# inAppUpdatePriority: 3 | |
# userFraction: 0.5 | |
# whatsNewDirectory: android/release-notes/ |