Skip to content

Commit

Permalink
Merge pull request #276 from shocknet/test
Browse files Browse the repository at this point in the history
android ci
  • Loading branch information
shocknet-justin authored Sep 12, 2024
2 parents 2b46cf7 + 4034d28 commit 1cd49b7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ on:
push:
tags:
- 'v*'
branches:
- test

env:
ACTIONS_RUNNER_DEBUG: true
ACTIONS_STEP_DEBUG: true
APP_NAME: "shockwallet" # Hardcoded app name
VERSION: ${{ github.ref_name }} # Use the tag name as the version
APP_NAME: "shockwallet"
VERSION: ${{ github.ref_name }}

jobs:
build:
runs-on: ubuntu-22.04

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -43,7 +46,7 @@ jobs:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
distribution: 'temurin'
java-version: '17'

- name: Cache Gradle packages
Expand All @@ -64,8 +67,8 @@ jobs:
cd android
./gradlew assembleRelease
- name: Ensure base64 is installed
run: sudo apt-get install -y coreutils
- name: Set up Android SDK
uses: android-actions/setup-android@v3

- name: Decode Keystore
run: |
Expand All @@ -79,13 +82,12 @@ jobs:

- name: Sign APK
run: |
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore -storepass ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} -keypass ${{ secrets.ANDROID_KEY_PASSWORD }} android/app/build/outputs/apk/release/app-release-unsigned.apk ${{ secrets.ANDROID_KEY_ALIAS }}
zipalign -v 4 android/app/build/outputs/apk/release/app-release-unsigned.apk android/app/build/outputs/apk/release/${{ env.APP_NAME }}-${{ env.VERSION }}.apk
$ANDROID_SDK_ROOT/build-tools/33.0.0/apksigner sign --ks my-release-key.keystore --ks-pass pass:${{ secrets.ANDROID_KEYSTORE_PASSWORD }} --key-pass pass:${{ secrets.ANDROID_KEY_PASSWORD }} --out android/app/build/outputs/apk/release/${{ env.APP_NAME }}-${{ env.VERSION }}.apk android/app/build/outputs/apk/release/app-release-unsigned.apk
shell: bash

- name: Verify APK
run: |
apksigner verify android/app/build/outputs/apk/release/${{ env.APP_NAME }}-${{ env.VERSION }}.apk
$ANDROID_SDK_ROOT/build-tools/33.0.0/apksigner verify android/app/build/outputs/apk/release/${{ env.APP_NAME }}-${{ env.VERSION }}.apk
shell: bash

- name: Upload APK
Expand Down

0 comments on commit 1cd49b7

Please sign in to comment.