Skip to content

Commit

Permalink
Add script to deploy android (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanCDev authored Feb 21, 2024
1 parent 3c8f47a commit c4c8361
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions bin/upload_apk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

branch_name="Add-release-apk-$(date +%d)/$(date +%m)/$(date +%Y)"

# Generate the apk
cd android && \
./gradlew assembleRelease && \

# Rename the apk
mv app/build/outputs/apk/release/app-release.apk app/build/outputs/apk/release/NoLoSay.apk && \

# Sign the apk
cd ../
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA256 -keystore ./android/app/NoLoSayKey.keystore ./android/app/build/outputs/apk/release/NoLoSay.apk NoLoSayAppAndroid && \

# Copy the apk to the web repository
cp ./android/app/build/outputs/apk/release/NoLoSay.apk ../NoLoWeb/public/. && \

# Commit the apk to the web repository
cd ../NoLoWeb && \
git pull && \
git checkout -b $branch_name && \

git add ./public/NoLoSay.apk && \
git commit -m "Add new apk" && \
git push origin $branch_name && \
gh pr create --title "Add APK of $branch_name" --body "New apk for NoLoApp" --label "application" --base main --head $branch_name
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'",
"start-server": "cd ../MonoLoBack && nx serve api",
"android-release": "cd android && ./gradlew assembleRelease && echo 'apk is in android/app/build/outputs/apk/release'",
"deploy-apk": "./bin/upload_apk",
"lint": "eslint '**/*.{tsx,ts,jsx,js}' --config './.eslintrc.js' --fix-dry-run",
"documentation": "typedoc --options ./typedoc.json",
"test": "jest --coverage",
Expand Down

0 comments on commit c4c8361

Please sign in to comment.