Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aab action flow #324

Merged
merged 9 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/android-release-bundle-ontag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Create AAB Release Bundle
on:
release:
types: [published]
jobs:
build_android_release_artifacts:
if: ${{ startsWith(github.event.release.tag_name, 'androidRelease') }}
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v2

- name: set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17

- name: Setup build tool version variable
run: |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
echo Last build tool version is: $BUILD_TOOL_VERSION

- name: Setup local.properties
run: |
echo STAGING_URL="${{ vars.STAGING_URL }}" >> ./local.properties
echo PRODUCTION_URL="${{ vars.PRODUCTION_URL }}" >> ./local.properties
echo GOOGLE_AUTH_CLIENT_ID="${{ vars.GOOGLE_AUTH_CLIENT_ID }}" >> ./local.properties

echo "RECAPTCHA_SITE_KEY=${{ secrets.RECAPTCHA_SITE_KEY }}" >> ./local.properties
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> ./local.properties
echo "ANDROID_SENTRY_DSN=${{ secrets.ANDROID_SENTRY_DSN }}" >> ./local.properties
echo "auth.token=${{ secrets.ANDROID_SENTRY_AUTH_TOKEN}}" >> ./sentry.properties

- name: create google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ vars.GOOGLE_SERVICES_JSON }}
run: echo $GOOGLE_SERVICES_JSON > ./android/app-newm/google-services.json

- name: build android apk
run: ./gradlew :android:app-newm:assembleProductionRelease

- name: build bundle production
run: ./gradlew :android:app-newm:bundleProduction

- uses: r0adkll/sign-android-release@v1
name: Sign app APK
# ID used to access action output
id: sign_app
with:
releaseDirectory: android/app-newm/build/outputs/apk/production/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}

- uses: r0adkll/sign-android-release@v1
name: Sing app bundle
# ID used to access action output
id: sign_aab
with:
releaseDirectory: android/app-newm/build/outputs/bundle/productionRelease
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}

- uses: actions/upload-artifact@v4
with:
name: apk
path: ${{steps.sign_app.outputs.signedReleaseFile}}

- uses: actions/upload-artifact@v4
with:
name: aab
path: ${{steps.sign_aab.outputs.signedReleaseFile}}

- name: Upload artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{secrets.FIREBASE_ANDROID_APP_ID}}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
groups: newm-team
file: ${{steps.sign_app.outputs.signedReleaseFile}}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Gradle
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
org.gradle.jvmargs=-Xmx4096M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx4096M"
org.gradle.caching=true
org.gradle.configuration-cache=true

Expand Down
Loading