Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
apps/dashboard/android/gradlew text eol=lf
157 changes: 157 additions & 0 deletions .github/workflows/wallet-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: Wallet release

on:
workflow_dispatch:
push:
tags:
- "wallet-v*"

permissions:
contents: write

jobs:
desktop:
name: Desktop wallet (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: windows
os: windows-latest
command: npm run desktop:installer:win
artifact: apps/dashboard/release/*
- name: macos
os: macos-latest
command: npm run desktop:installer:mac
artifact: apps/dashboard/release/*
- name: linux
os: ubuntu-latest
command: npm run desktop:installer:linux
artifact: apps/dashboard/release/*

defaults:
run:
working-directory: apps/dashboard

env:
CSC_IDENTITY_AUTO_DISCOVERY: "false"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "24"
cache: npm
cache-dependency-path: apps/dashboard/package-lock.json

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Build desktop app
run: ${{ matrix.command }}

- name: Upload desktop artifact
uses: actions/upload-artifact@v4
with:
name: flowchain-wallet-desktop-${{ matrix.name }}
path: ${{ matrix.artifact }}
if-no-files-found: error

android:
name: Android wallet APK
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/dashboard
env:
HAS_ANDROID_RELEASE_KEYSTORE: ${{ secrets.FLOWCHAIN_ANDROID_KEYSTORE_BASE64 != '' }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "24"
cache: npm
cache-dependency-path: apps/dashboard/package-lock.json

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"

- name: Install dependencies
run: npm ci

- name: Sync Android project
run: npm run mobile:android:sync

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
working-directory: apps/dashboard/android

- name: Build debug APK
run: ./gradlew assembleDebug
working-directory: apps/dashboard/android

- name: Decode Android release keystore
if: env.HAS_ANDROID_RELEASE_KEYSTORE == 'true'
shell: bash
run: |
echo "$FLOWCHAIN_ANDROID_KEYSTORE_BASE64" | base64 -d > flowchain-release.keystore
env:
FLOWCHAIN_ANDROID_KEYSTORE_BASE64: ${{ secrets.FLOWCHAIN_ANDROID_KEYSTORE_BASE64 }}

- name: Build signed release APK
if: env.HAS_ANDROID_RELEASE_KEYSTORE == 'true'
run: ./gradlew assembleRelease
working-directory: apps/dashboard/android
env:
FLOWCHAIN_ANDROID_KEYSTORE_FILE: ${{ github.workspace }}/apps/dashboard/flowchain-release.keystore
FLOWCHAIN_ANDROID_KEYSTORE_PASSWORD: ${{ secrets.FLOWCHAIN_ANDROID_KEYSTORE_PASSWORD }}
FLOWCHAIN_ANDROID_KEY_ALIAS: ${{ secrets.FLOWCHAIN_ANDROID_KEY_ALIAS }}
FLOWCHAIN_ANDROID_KEY_PASSWORD: ${{ secrets.FLOWCHAIN_ANDROID_KEY_PASSWORD }}

- name: Upload Android APKs
uses: actions/upload-artifact@v4
with:
name: flowchain-wallet-android
path: |
apps/dashboard/android/app/build/outputs/apk/debug/*.apk
apps/dashboard/android/app/build/outputs/apk/release/*.apk
if-no-files-found: error

github-release:
name: Publish tagged GitHub release
runs-on: ubuntu-latest
needs:
- desktop
- android
if: startsWith(github.ref, 'refs/tags/wallet-v')
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts

- name: Publish release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
gh release create "$GITHUB_REF_NAME" \
--title "Flowchain Wallet $GITHUB_REF_NAME" \
--notes "Desktop and Android wallet builds generated from $GITHUB_SHA."
find release-artifacts -type f -print0 \
| xargs -0 -I {} gh release upload "$GITHUB_REF_NAME" "{}" --clobber
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cache=./devnet/local/npm-cache
update-notifier=false
1 change: 1 addition & 0 deletions apps/dashboard/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
dist/
release/
.vite/
coverage/
*.tsbuildinfo
Expand Down
43 changes: 43 additions & 0 deletions apps/dashboard/WALLET_DISTRIBUTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Flowchain Wallet Distribution

The wallet is distributed as native desktop builds through Electron and as a native Android shell through Capacitor.

## Local Windows Desktop Build

```powershell
npm run desktop:installer:win --prefix apps/dashboard
```

Artifacts are written to `apps/dashboard/release/`.

For a local unsigned unpacked build plus zip:

```powershell
npm run desktop:pack --prefix apps/dashboard
```

## Android Build

The Android app source lives in `apps/dashboard/android`.

```powershell
npm run mobile:android:sync --prefix apps/dashboard
```

Building an APK requires Java and the Android SDK. On CI, `.github/workflows/wallet-release.yml` builds a debug APK automatically. For a signed release APK, add these repository secrets:

- `FLOWCHAIN_ANDROID_KEYSTORE_BASE64`
- `FLOWCHAIN_ANDROID_KEYSTORE_PASSWORD`
- `FLOWCHAIN_ANDROID_KEY_ALIAS`
- `FLOWCHAIN_ANDROID_KEY_PASSWORD`

## Public Downloads

Run the `Wallet release` GitHub workflow manually for downloadable CI artifacts, or push a tag like:

```powershell
git tag wallet-v0.0.0
git push origin wallet-v0.0.0
```

Tagged runs publish a GitHub Release containing the desktop and Android artifacts.
101 changes: 101 additions & 0 deletions apps/dashboard/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore

# Built application files
*.apk
*.aar
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/

# Google Services (e.g. APIs or Firebase)
# google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# Version control
vcs.xml

# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/

# Android Profiling
*.hprof

# Cordova plugins for Capacitor
capacitor-cordova-android-plugins

# Copied web assets
app/src/main/assets/public

# Generated Config files
app/src/main/assets/capacitor.config.json
app/src/main/assets/capacitor.plugins.json
app/src/main/res/xml/config.xml
2 changes: 2 additions & 0 deletions apps/dashboard/android/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build/*
!/build/.npmkeep
76 changes: 76 additions & 0 deletions apps/dashboard/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apply plugin: 'com.android.application'

def flowchainReleaseKeystore = System.getenv("FLOWCHAIN_ANDROID_KEYSTORE_FILE")
def flowchainReleaseStorePassword = System.getenv("FLOWCHAIN_ANDROID_KEYSTORE_PASSWORD")
def flowchainReleaseKeyAlias = System.getenv("FLOWCHAIN_ANDROID_KEY_ALIAS")
def flowchainReleaseKeyPassword = System.getenv("FLOWCHAIN_ANDROID_KEY_PASSWORD")
def hasFlowchainReleaseSigning = flowchainReleaseKeystore
&& flowchainReleaseStorePassword
&& flowchainReleaseKeyAlias
&& flowchainReleaseKeyPassword

android {
namespace = "ai.flowmemory.flowchain.wallet"
compileSdk = rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "ai.flowmemory.flowchain.wallet"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}
signingConfigs {
release {
if (hasFlowchainReleaseSigning) {
storeFile file(flowchainReleaseKeystore)
storePassword flowchainReleaseStorePassword
keyAlias flowchainReleaseKeyAlias
keyPassword flowchainReleaseKeyPassword
}
}
}
buildTypes {
release {
minifyEnabled false
if (hasFlowchainReleaseSigning) {
signingConfig signingConfigs.release
}
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

repositories {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
implementation project(':capacitor-android')
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation project(':capacitor-cordova-android-plugins')
}

apply from: 'capacitor.build.gradle'

try {
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
}
} catch(Exception e) {
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}
Loading
Loading