Skip to content

Commit

Permalink
fix signing and upload path
Browse files Browse the repository at this point in the history
  • Loading branch information
danparisd authored Dec 15, 2023
1 parent ab021a4 commit 07149b0
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
on: [workflow_dispatch]
on:
workflow_dispatch:
push:
jobs:
build:
runs-on: ubuntu-latest
name: Build the project
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: FranzDiebold/[email protected]
- name: Setup java
uses: actions/setup-java@v3
with:
Expand All @@ -25,9 +28,10 @@ jobs:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
AWS_KEY_ID: "op://DevOps/cloudflare-r2-token/access-key-id"
AWS_SECRET_ACCESS_KEY: "op://DevOps/cloudflare-r2-token/secret-access-key"
RELEASE_KEYSTORE: "op://DevOps/btt-android-keystore-key/base64-encoded-jks"
RELEASE_KEYSTORE_PASSWORD: "op://DevOps/btt-android-keystore-key/keystore-password"
RELEASE_KEYSTORE_NAME: "op://DevOps/btt-android-keystore-key/key0-password"
KEYSTORE: "op://DevOps/btt-android-keystore-key/base64-encoded-jks"
KEYSTORE_PASSWORD: "op://DevOps/btt-android-keystore-key/text-details/storePassword"
KEY_ALIAS: "op://DevOps/btt-android-keystore-key/text-details/keyAlias"
KEY_PASSWORD: "op://DevOps/btt-android-keystore-key/text-details/keyPassword"
ENDPOINT: "op://DevOps/cloudflare-r2-token/endpoint"
- name:
Install JS dependencies and build
Expand All @@ -44,16 +48,23 @@ jobs:
run: cd android && ./gradlew bundle
- name: Extract Android signing key from env
run: |
echo "${{ env.RELEASE_KEYSTORE }}" > android/release.jks.base64
echo "${{ env.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 "${{ env.RELEASE_KEYSTORE_PASSWORD }}" -signedjar ./android/app/build/outputs/bundle/release/app-release-signed.aab ./android/app/build/outputs/bundle/release/app-release.aab ${{env.RELEASE_KEYSTORE_NAME}}
- name: Sign dev build aab
run: jarsigner -keystore android/release.decrypted.jks -storepass "${{ env.KEYSTORE_PASSWORD }}" -keypass "${{ env.KEY_PASSWORD }}" -signedjar ./outputs/app-release-signed.aab ./android/app/build/outputs/bundle/release/app-release.aab "${{env.KEY_ALIAS}}"
- name: Sign dev build apk
run: |
# jarsigner -keystore android/release.decrypted.jks -storepass "${{ env.KEYSTORE_PASSWORD }}" -keypass "${{ env.KEY_PASSWORD }}" -signedjar ./outputs/app-release-signed.apk ./android/app/build/outputs/apk/release/app-release.apk "${{env.KEY_ALIAS}}"
ls ./android/app/build/outputs/apk/release/
ls -r ./android/app/build/outputs/apk/
- name: set s3 destination_dir for nightly-builds
run: echo "CURRENT_S3_DESTINATION=$CI_REPOSITORY_OWNER/$CI_REPOSITORY_NAME/$CI_REF_NAME_SLUG/$CI_RUN_NUMBER" >> $GITHUB_ENV
- name: Upload Android to R2
uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ env.AWS_KEY_ID }}
aws_secret_access_key: ${{ env.AWS_SECRET_ACCESS_KEY}}
aws_bucket: dot-mobile
source_dir: "./android/app/build/outputs/bundle/release"
destination_dir: "android/${{steps.date.outputs.date}}"
source_dir: "./outputs"
destination_dir: ${{ env.CURRENT_S3_DESTINATION }}
endpoint: ${{ env.ENDPOINT }}

0 comments on commit 07149b0

Please sign in to comment.