-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4548561
commit 7107534
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Build Android | ||
run-name: Creating Production Ready Android App | ||
on: push | ||
|
||
jobs: | ||
build: | ||
name: Build APK | ||
runs-on: ubuntu-latest | ||
# TODO: add the default directory - COMMENT IF IT'S NOT IN SUBFOLDER | ||
# defaults: | ||
# run: | ||
# working-directory: ./frontend | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
# TODO: add your branch to checkout | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: install dependencies | ||
run: npm ci | ||
|
||
- name: Create Build Folder | ||
run: npm run build | ||
|
||
- name: Build app bundle | ||
run: cd android && ./gradlew bundle && ./gradlew assembleDebug | ||
|
||
- name: Extract Android signing key from env | ||
run: | | ||
echo "${{ secrets.RELEASE_KEYSTORE }}" > android/release.jks.base64 | ||
base64 -d android/release.jks.base64 > android/release.decrypted.jks | ||
- name: Sign dev build | ||
run: jarsigner -keystore android/release.decrypted.jks -storepass "${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" -signedjar ./android/app/build/outputs/bundle/release/app-release-signed.aab ./android/app/build/outputs/bundle/release/app-release.aab release | ||
|
||
- name: Check folder content of android output | ||
run: ls ./android/app/build/outputs/bundle/release | ||
|
||
- name: Set Tag | ||
id: current-datetime | ||
run: echo "CURRENT_DATETIME=$(date +'%Y-%m-%d-%H_%M_%S%z')" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Build Release | ||
shell: bash | ||
run: | | ||
hub release create ${{ steps.current-datetime.outputs.CURRENT_DATETIME }} \ | ||
-m ${{ steps.current-datetime.outputs.CURRENT_DATETIME }} \ | ||
-a ./android/app/build/outputs/bundle/release/app-release-signed.aab \ | ||
-a ./android/app/build/outputs/apk/debug/app-debug.apk | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} |