diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index a2d73e38f..5dcebc7fb 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -1,15 +1,18 @@ name: Release dev on: - push: - branches: [ main ] + workflow_dispatch: + schedule: + - cron: "0 0 * * *" + # push: + # branches: [main] defaults: run: working-directory: ./ jobs: - release: + release-shinkai-visor: runs-on: ubuntu-latest environment: development steps: @@ -27,7 +30,7 @@ jobs: node-version: 18 check-latest: false registry-url: https://registry.npmjs.org - cache: "npm" + cache: 'npm' cache-dependency-path: package-lock.json - name: Install dependencies @@ -35,9 +38,8 @@ jobs: npm cache verify npm ci --no-audit --prefer-offline - # shinkai-visor - name: Run NX build on shinkai-visor - run: npx nx build shinkai-visor --skip-nx-cache --verbose + run: npx nx build shinkai-visor --skip-nx-cache env: VERSION: 0.0.0.${{github.run_number}} NAME_PREFIX: '[Dev] ' @@ -55,7 +57,40 @@ jobs: client-id: ${{ secrets.CHROME_CLIENT_ID }} client-secret: ${{ secrets.CHROME_CLIENT_SECRET }} refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }} - publish: true + publish: false + + - uses: actions/upload-artifact@v3 + with: + name: shinkai-visor + path: dist/apps/shinkai-visor + if-no-files-found: error + retention-days: 5 + + release-shinkai-app-android: + runs-on: ubuntu-latest + environment: development + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use nx set shas + uses: nrwl/nx-set-shas@v3 + + - name: Setup Node version + uses: actions/setup-node@v3 + with: + node-version: 18 + check-latest: false + registry-url: https://registry.npmjs.org + cache: 'npm' + cache-dependency-path: package-lock.json + + - name: Install dependencies + run: | + npm cache verify + npm ci --no-audit --prefer-offline - uses: actions/upload-artifact@v3 with: @@ -64,32 +99,42 @@ jobs: if-no-files-found: error retention-days: 5 - # shinkai-app-android - uses: actions/setup-java@v3 with: java-version: '17' distribution: 'temurin' - - name: Run NX build on shinkai-app-android + - name: Set mobile apps version run: | npx capacitor-set-version -v $VERSION -b $BUILD $APP_PATH env: VERSION: 0.0.0 - BUILD: ${{github.run_number}} + BUILD: ${{ github.run_number }} APP_PATH: ./apps/shinkai-app + - name: Mount shinkai android keystore from secret + run: | + echo $KEYSTORE_BASE_64_STRING > $KEYSTORE_BASE_64_FILE_NAME + base64 -d $KEYSTORE_BASE_64_FILE_NAME > $KEYSTORE_FILE_PATH + env: + KEYSTORE_BASE_64_STRING: ${{ secrets.ANDROID_KEYSTORE_BASE_64 }} + KEYSTORE_BASE_64_FILE_NAME: shinkai-keystore-android-upload-base-64 + KEYSTORE_FILE_PATH: ./apps/shinkai-app/android/shinkai-keystore-android + - name: Run NX build on shinkai-app-android run: | - npx nx build:android shinkai-app --verbose + npx nx build:android shinkai-app env: - ANDROID_KEYSTORE_FILE_PATH: ${{ secrets.ANDROID_KEYSTORE_FILE_PATH }} + ANDROID_KEYSTORE_FILE_PATH: shinkai-keystore-android ANDROID_KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }} ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }} ANDROID_KEYSTORE_ALIAS_PASS: ${{ secrets.ANDROID_KEYSTORE_ALIAS_PASS }} - - uses: actions/upload-artifact@v3 + - name: Upload signed android .AAB file to Google Play Store + uses: r0adkll/upload-google-play@v1 with: - name: shinkai-app-android - path: dist/apps/shinkai-app-android - if-no-files-found: error - retention-days: 5 + serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT_JSON }} + packageName: com.shinkai.app + releaseFiles: ./dist/apps/shinkai-app-android/app-release-signed.aab + track: internal + status: draft diff --git a/apps/shinkai-app/android/app/build.gradle b/apps/shinkai-app/android/app/build.gradle index 2571cb459..2528c90ce 100644 --- a/apps/shinkai-app/android/app/build.gradle +++ b/apps/shinkai-app/android/app/build.gradle @@ -1,14 +1,14 @@ apply plugin: 'com.android.application' android { - namespace "io.dcspark.shinkai" + namespace "com.shinkai.app" compileSdkVersion rootProject.ext.compileSdkVersion defaultConfig { - applicationId "io.dcspark.shinkai" + applicationId "com.shinkai.app" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 - versionName "1.0" + versionName "0.0.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/apps/shinkai-app/android/app/src/main/java/io/dcspark/shinkai/MainActivity.java b/apps/shinkai-app/android/app/src/main/java/io/dcspark/shinkai/MainActivity.java index 3330ab681..b944d47f2 100644 --- a/apps/shinkai-app/android/app/src/main/java/io/dcspark/shinkai/MainActivity.java +++ b/apps/shinkai-app/android/app/src/main/java/io/dcspark/shinkai/MainActivity.java @@ -1,4 +1,4 @@ -package io.dcspark.shinkai; +package com.shinkai.app; import com.getcapacitor.BridgeActivity; diff --git a/apps/shinkai-app/android/app/src/main/res/values/strings.xml b/apps/shinkai-app/android/app/src/main/res/values/strings.xml index cd39b67c7..30fcb7321 100644 --- a/apps/shinkai-app/android/app/src/main/res/values/strings.xml +++ b/apps/shinkai-app/android/app/src/main/res/values/strings.xml @@ -1,7 +1,7 @@ - ShinkaiApp - ShinkaiApp - io.dcspark.shinkai - io.dcspark.shinkai + Shinkai + Shinkai + com.shinkai.app + com.shinkai.app diff --git a/apps/shinkai-app/capacitor.config.ts b/apps/shinkai-app/capacitor.config.ts index b2665aa0d..99faaa0b0 100644 --- a/apps/shinkai-app/capacitor.config.ts +++ b/apps/shinkai-app/capacitor.config.ts @@ -1,11 +1,13 @@ import { CapacitorConfig } from '@capacitor/cli'; const config: CapacitorConfig = { - appId: 'io.dcspark.shinkai', - appName: 'ShinkaiApp', + appId: 'com.shinkai.app', + appName: 'Shinkai', webDir: '../../dist/apps/shinkai-app', server: { - androidScheme: 'https' + androidScheme: 'https', + url: process.env.SERVE ? 'http://10.0.2.2:9000' : undefined, + cleartext: process.env.SERVE ? true : false, } }; diff --git a/apps/shinkai-app/ionic.config.json b/apps/shinkai-app/ionic.config.json index 72ee5fb82..ef85e4469 100644 --- a/apps/shinkai-app/ionic.config.json +++ b/apps/shinkai-app/ionic.config.json @@ -1,5 +1,5 @@ { - "name": "ShinkaiApp", + "name": "Shinkai", "integrations": { "capacitor": {} }, diff --git a/apps/shinkai-app/ios/App/App.xcodeproj/project.pbxproj b/apps/shinkai-app/ios/App/App.xcodeproj/project.pbxproj index 05bc35ff1..001b9597d 100644 --- a/apps/shinkai-app/ios/App/App.xcodeproj/project.pbxproj +++ b/apps/shinkai-app/ios/App/App.xcodeproj/project.pbxproj @@ -350,9 +350,9 @@ INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 0.0.1; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; - PRODUCT_BUNDLE_IDENTIFIER = io.dcspark.shinkai; + PRODUCT_BUNDLE_IDENTIFIER = com.shinkai.app; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_VERSION = 5.0; @@ -370,8 +370,8 @@ INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = io.dcspark.shinkai; + MARKETING_VERSION = 0.0.1; + PRODUCT_BUNDLE_IDENTIFIER = com.shinkai.app; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = ""; SWIFT_VERSION = 5.0; diff --git a/apps/shinkai-app/ios/App/App/Info.plist b/apps/shinkai-app/ios/App/App/Info.plist index 3fb69a0af..3dfac5f89 100644 --- a/apps/shinkai-app/ios/App/App/Info.plist +++ b/apps/shinkai-app/ios/App/App/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion en CFBundleDisplayName - ShinkaiApp + Shinkai CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier diff --git a/apps/shinkai-app/package.json b/apps/shinkai-app/package.json index 122aa365c..e262f4878 100644 --- a/apps/shinkai-app/package.json +++ b/apps/shinkai-app/package.json @@ -3,5 +3,8 @@ "private": true, "version": "0.0.1", "type": "module", - "description": "Shinkai Multiplatform App" + "description": "Shinkai Multiplatform App", + "scripts": { + "serve:android": "SERVE=true npx cap run android" + } } diff --git a/apps/shinkai-app/project.json b/apps/shinkai-app/project.json index 53319d1e4..45f9358f8 100644 --- a/apps/shinkai-app/project.json +++ b/apps/shinkai-app/project.json @@ -57,7 +57,8 @@ "executor": "@nx/vite:dev-server", "defaultConfiguration": "development", "options": { - "buildTarget": "shinkai-app:build" + "buildTarget": "shinkai-app:build", + "port": 9000 }, "configurations": { "development": { @@ -70,6 +71,18 @@ } } }, + "serve:android": { + "executor": "nx:run-script", + "defaultConfiguration": "development", + "options": { + "cwd": "apps/shinkai-app", + "script": "serve:android" + }, + "configurations": { + "development": {}, + "production": {} + } + }, "preview": { "executor": "@nx/vite:preview-server", "defaultConfiguration": "development", diff --git a/apps/shinkai-app/vite.config.ts b/apps/shinkai-app/vite.config.ts index 0dc09a047..f78725b0b 100644 --- a/apps/shinkai-app/vite.config.ts +++ b/apps/shinkai-app/vite.config.ts @@ -10,7 +10,7 @@ export default defineConfig({ server: { port: 4200, - host: 'localhost', + host: true, fs: { // Important to server files two levels ahead of the project folder allow: ['../../'],