Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
chore: add android beta release artifacts (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbillman authored May 3, 2024
1 parent ec6c901 commit 180801f
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 8 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/android-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: DIDPay Android Beta

on:
schedule:
- cron: "0 8 * * *" # 8 AM UTC
workflow_dispatch:

jobs:
android-beta:
name: Android build signed app bundle
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "17"

- name: Init Hermit
uses: cashapp/activate-hermit@v1
with:
cache: true

- name: Install dependencies
run: just get

- name: Create didpay.keystore and key.properties file
run: |
run: echo "${{ secrets.BETA_ANDROID_KEY_STORE }}" | base64 --decode > android/app/didpay.keystore
echo "storePassword=${{ secrets.BETA_ANDROID_KEYSTORE_PASSWORD }}" >> android/key.properties
echo "keyPassword=${{ secrets.BETA_ANDROID_KEYSTORE_PASSWORD }}" >> android/key.properties
echo "keyAlias=didpay" >> android/key.properties
echo "storeFile=didpay.keystore" >> android/key.properties
- name: Setup cider for versioning
run: |
flutter pub global activate cider
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Version the build
id: versioning
run: |
just set-build-number
VERSION_NAME=$(cider version)
echo "Version Name: $VERSION_NAME"
echo "::set-output name=version_name::$VERSION_NAME"
- name: Build appbundle
run: just build-app-bundle

- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: android-beta
path: build/app/outputs/bundle/release/app-release.aab
16 changes: 16 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,19 @@ coverage:
flutter test --coverage
genhtml coverage/lcov.info -o coverage/html
open coverage/html/index.html

# Set build number base on timestamp
set-build-number:
#!/bin/bash
export PATH="$PATH:$HOME/.pub-cache/bin"
if ! command -v cider &> /dev/null
then
flutter pub global activate cider
else
echo "Cider is already installed."
fi
cider bump build --build=$(date '+%s')

# Build android app bundle
android-app-bundle:
flutter build appbundle
19 changes: 16 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ if (localPropertiesFile.exists()) {
}
}

def keyProperties = new Properties()
def keyPropertiesFile = rootProject.file('key.properties')
if (keyPropertiesFile.exists()) {
keyProperties.load(new FileInputStream(keyPropertiesFile))
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand Down Expand Up @@ -51,11 +57,18 @@ android {
versionName flutterVersionName
}

signingConfigs {
release {
keyAlias keyProperties['keyAlias']
keyPassword keyProperties['keyPassword']
storeFile file(keyProperties['storeFile'])
storePassword keyProperties['storePassword']
}
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ packages:
dependency: transitive
description:
name: archive
sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d"
sha256: "0763b45fa9294197a2885c8567927e2830ade852e5c896fd4ab7e0e348d0f373"
url: "https://pub.dev"
source: hosted
version: "3.4.10"
version: "3.5.0"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -313,10 +313,10 @@ packages:
dependency: transitive
description:
name: json_annotation
sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
url: "https://pub.dev"
source: hosted
version: "4.8.1"
version: "4.9.0"
json_schema:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -808,7 +808,7 @@ packages:
description:
path: "packages/web5"
ref: main
resolved-ref: ab92c4bde5662789b4b8c2fa00c5f373c20bfe6f
resolved-ref: "1bc969484bf7613840f921231176adf43a5f0d2c"
url: "https://github.com/TBD54566975/web5-dart.git"
source: git
version: "0.1.0"
Expand Down

0 comments on commit 180801f

Please sign in to comment.