Skip to content

Commit

Permalink
Fix build release android failed
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenduythuc committed Oct 30, 2023
1 parent 1801b71 commit c1c9eb0
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ jobs:
with:
serviceAccountJson: ${{ secrets.SERVICE_ACCOUNT_JSON_CONTENT }}
packageName: app.subwallet.mobile
releaseFiles: android/app/build/outputs/bundle/release/*.aab
releaseFiles: android/app/build/outputs/bundle/release/app-release.aab
track: internal
status: completed
whatsNewDirectory: whatsNewDirectory
Expand Down
92 changes: 92 additions & 0 deletions .github/workflows/test-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Release builds

on:
push:
branches: [ "upgrade-ui" ]

jobs:
build-android:
name: Android builds
runs-on: macos-latest
env:
GH_PAT: ${{ secrets.GH_PAT }}
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
KS_PASSWORD: ${{ secrets.KS_PASSWORD }}
NEXTCLOUD_CONFIG: ${{ secrets.NEXTCLOUD_CONFIG }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
COMMIT_MESSAGE: ${{ github.event.pull_request.title }}
REF_NAME: ${{ github.ref_name }}
TRANSAK_API_KEY: ${{ secrets.TRANSAK_API_KEY }}
COINBASE_PAY_ID: ${{ secrets.COINBASE_PAY_ID }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}

# - name: Add APP ENV
# run: |
# cp .env.development.example .env.production
# if [ -f .env.production ]; then
# sed -i '' "s/^TRANSAK_API_KEY=.*/TRANSAK_API_KEY=$TRANSAK_API_KEY/" .env.production
# sed -i '' "s/^COINBASE_PAY_ID=.*/COINBASE_PAY_ID=$COINBASE_PAY_ID/" .env.production
# else
# echo "TRANSAK_API_KEY=$TRANSAK_API_KEY" >> .env.production
# echo "COINBASE_PAY_ID=$COINBASE_PAY_ID" >> .env.production
# fi

# - name: Cache Dependencies
# uses: actions/cache@v2
# with:
# path: ~/.cache/yarn
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-yarn-

# - name: Install dependencies
# run: yarn install --immutable | grep -v 'YN0013'

# - uses: actions/setup-java@v1
# with:
# java-version: '11'

# - name: Cache Gradle Wrapper
# uses: actions/cache@v2
# with:
# path: ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}

# - name: Cache Gradle Dependencies
# uses: actions/cache@v2
# with:
# path: ~/.gradle/caches
# key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-caches-

# - name: Make Gradlew Executable
# run: cd android && chmod +x ./gradlew

- name: Prepare sign datarun
run: |
recent_tag=$(git describe --tags --abbrev=0)
commit_messages=$(git log --pretty=format:"%s" $recent_tag..HEAD)
filtered_messages=$(echo "$commit_messages" | grep -oE '\[issue-[0-9]+\] .+' | sed -E 's/\[issue-([0-9]+)\] (.+)/- \2 (#\1)/')
mkdir -p whatsnew
echo "$filtered_messages" > whatsnew/whatsnew-en-US
# # Build AAB file
# - name: Generate App AAB
# run: |
# cd android && export ENVFILE=.env.production && ./gradlew bundleRelease -PMYAPP_UPLOAD_STORE_FILE=${{ secrets.MYAPP_UPLOAD_STORE_FILE }} -PMYAPP_UPLOAD_STORE_PASSWORD=${{ secrets.ANDROID_KEY_STORE_PASSWORD }} -PMYAPP_UPLOAD_KEY_PASSWORD=${{ secrets.ANDROID_KEY_PASSWORD }} -PMYAPP_UPLOAD_KEY_ALIAS=${{ secrets.ANDROID_ALIAS }}

- name: Upload to Play Store Internal Testing
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON_CONTENT }}
packageName: app.subwallet.mobile
releaseFiles: app-release.aab
track: internal
status: completed
whatsNewDirectory: whatsnew
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ android {
applicationId "app.subwallet.mobile"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 228
versionCode 229
versionName "1.1.5"
missingDimensionStrategy 'react-native-camera', 'general'
}
Expand Down
Binary file added app-release.aab
Binary file not shown.

0 comments on commit c1c9eb0

Please sign in to comment.