mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
Fix/prod build (#51)
* chore: add CI secrets management and local testing script - Added ci-secrets.example.json to provide a template for CI secrets configuration. - Introduced test-ci-local.sh script to facilitate local testing of the package-and-publish workflow using act. - Updated .gitignore to exclude the actual ci-secrets.json file containing sensitive tokens. * chore: enhance local testing and environment loading scripts - Added scripts to load environment variables from .env and JSON files, improving local development setup. - Introduced ci-event.json to simulate GitHub event payloads for local CI testing. - Updated test-ci-local.sh to utilize the new event JSON for better integration with local testing workflows. - Modified .gitignore to include ci-secrets.local.json for local secret management. * chore: enhance environment loading and improve V8 memory management - Updated load-env.sh to conditionally load ci-secrets.local.json and set APPLE_PASSWORD for notarization. - Introduced a delay in auto-starting skills to prevent memory spikes during initialization. - Adjusted V8 runtime memory settings to minimize initial heap allocation, reducing the risk of OOM errors. * chore: update version bump workflow to modify tauri.conf.json - Changed the version update process to reflect changes in tauri.conf.json instead of Cargo.toml. - Adjusted the commit message to indicate the inclusion of tauri.conf.json in the version bump process. * chore: migrate from V8 to QuickJS runtime and update related configurations - Replaced V8 runtime references with QuickJS throughout the codebase, including updates to initialization and error handling. - Modified package.json to change the build command for macOS to source environment variables correctly. - Updated Cargo.toml to remove deno_core dependency and include rquickjs with appropriate features. - Cleaned up unused V8-related code and comments in the runtime modules. - Adjusted skill manifest checks to support QuickJS compatibility. * refactor: implement QuickJS runtime and remove V8 references - Replaced V8 engine with QuickJS in the runtime module, updating related imports and initialization logic. - Introduced new `qjs_engine.rs` and `qjs_skill_instance.rs` files to handle QuickJS-specific functionality. - Removed the deprecated `v8_skill_instance.rs` and associated V8-related code. - Updated JavaScript bootstrap code to align with QuickJS operations and APIs. - Adjusted documentation and comments to reflect the transition to QuickJS. * refactor: update IdbStorage to use parking_lot::Mutex for improved concurrency - Changed the connection management in IdbStorage from RwLock to parking_lot::Mutex for better performance. - Updated related methods to reflect the new locking mechanism, enhancing the efficiency of database operations. - Adjusted the IdbOpenResult struct to include serde::Serialize for potential serialization needs. * refactor: update QuickJS skill instance and timer management - Modified memory limit and stack size settings in QjsSkillInstance to be asynchronous, improving performance. - Cleaned up imports in qjs_ops.rs by removing unused dependencies and enhancing function definitions for clarity. - Refactored timer management functions for better readability and efficiency, including renaming and restructuring comments. * chore: update package.json scripts and clean up build.rs - Added a new script for running the Tauri app with environment variable loading. - Simplified the macOS development command to use a dedicated build script. - Removed unnecessary environment variable logging from build.rs to streamline the build process. - Cleaned up commented-out sections in the GitHub Actions workflow for Android packaging.
This commit is contained in:
@@ -402,127 +402,6 @@ jobs:
|
||||
name: ${{ steps.file-info.outputs.filename }}
|
||||
path: ${{ steps.file-info.outputs.path }}/${{ steps.file-info.outputs.filename }}
|
||||
|
||||
# package-android:
|
||||
# name: Build and package Android APK
|
||||
# needs: [get-version, check-version, create-release]
|
||||
# if: ${{ !failure() && !cancelled() && needs.check-version.outputs.should-skip != 'true' }}
|
||||
# environment: ${{ github.ref == 'refs/heads/main' && 'Production' || '' }}
|
||||
# runs-on: ubuntu-22.04
|
||||
# permissions:
|
||||
# contents: write
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v4
|
||||
# with:
|
||||
# fetch-depth: 1
|
||||
# ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref }}
|
||||
|
||||
# - name: Setup Node.js 24.x
|
||||
# uses: actions/setup-node@v4
|
||||
# with:
|
||||
# node-version: 24.x
|
||||
# cache: 'yarn'
|
||||
|
||||
# - name: Install Rust stable
|
||||
# uses: dtolnay/rust-toolchain@stable
|
||||
# with:
|
||||
# targets: aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android
|
||||
|
||||
# - name: Setup Java 17
|
||||
# uses: actions/setup-java@v4
|
||||
# with:
|
||||
# distribution: 'temurin'
|
||||
# java-version: '17'
|
||||
|
||||
# - name: Setup Android SDK
|
||||
# uses: android-actions/setup-android@v3
|
||||
|
||||
# - name: Install Android NDK
|
||||
# run: sdkmanager --install "ndk;27.0.12077973"
|
||||
|
||||
# - name: Set NDK path
|
||||
# run: echo "NDK_HOME=$ANDROID_HOME/ndk/27.0.12077973" >> $GITHUB_ENV
|
||||
|
||||
# - name: Cache node modules
|
||||
# id: yarn-cache
|
||||
# uses: actions/cache@v4
|
||||
# with:
|
||||
# path: node_modules
|
||||
# key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
|
||||
# restore-keys: |
|
||||
# ${{ runner.os }}-build-
|
||||
|
||||
# - name: Install dependencies
|
||||
# if: steps.yarn-cache.outputs.cache-hit != 'true'
|
||||
# run: yarn install --frozen-lockfile
|
||||
|
||||
# - name: Build frontend
|
||||
# run: yarn build
|
||||
# env:
|
||||
# NODE_ENV: production
|
||||
# VITE_BACKEND_URL: ${{ vars.VITE_BACKEND_URL }}
|
||||
# VITE_TELEGRAM_BOT_USERNAME: ${{ secrets.VITE_TELEGRAM_BOT_USERNAME }}
|
||||
# VITE_TELEGRAM_BOT_ID: ${{ secrets.VITE_TELEGRAM_BOT_ID }}
|
||||
# VITE_TELEGRAM_API_ID: ${{ secrets.VITE_TELEGRAM_API_ID }}
|
||||
# VITE_TELEGRAM_API_HASH: ${{ secrets.VITE_TELEGRAM_API_HASH }}
|
||||
# VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
|
||||
# VITE_SKILLS_GITHUB_REPO: ${{ vars.VITE_SKILLS_GITHUB_REPO }}
|
||||
# VITE_DEBUG: ${{ vars.VITE_DEBUG }}
|
||||
|
||||
# - name: Initialize Tauri Android
|
||||
# run: npx tauri android init
|
||||
|
||||
# - name: Decode keystore
|
||||
# if: needs.get-version.outputs.should-publish != ''
|
||||
# env:
|
||||
# ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
|
||||
# run: |
|
||||
# echo "$ANDROID_KEYSTORE" | base64 --decode > ${{ github.workspace }}/release.jks
|
||||
|
||||
# - name: Build Android APK (signed)
|
||||
# if: needs.get-version.outputs.should-publish != ''
|
||||
# env:
|
||||
# BASE_URL: ${{ vars.BASE_URL }}
|
||||
# ANDROID_KEYSTORE_PATH: ${{ github.workspace }}/release.jks
|
||||
# ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
||||
# ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
||||
# ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||
# run: npx tauri android build --apk
|
||||
|
||||
# - name: Build Android APK (unsigned)
|
||||
# if: needs.get-version.outputs.should-publish == ''
|
||||
# env:
|
||||
# BASE_URL: ${{ vars.BASE_URL }}
|
||||
# run: npx tauri android build --apk
|
||||
|
||||
# - name: Find APK
|
||||
# id: find-apk
|
||||
# run: |
|
||||
# APK_PATH=$(find gen/android -name '*.apk' -type f | head -1)
|
||||
# if [ -z "$APK_PATH" ]; then
|
||||
# echo "No APK found"
|
||||
# exit 1
|
||||
# fi
|
||||
# APK_FILENAME=$(basename "$APK_PATH")
|
||||
# echo "path=$APK_PATH" >> $GITHUB_OUTPUT
|
||||
# echo "filename=$APK_FILENAME" >> $GITHUB_OUTPUT
|
||||
|
||||
# - name: Upload APK artifact
|
||||
# uses: actions/upload-artifact@v4
|
||||
# with:
|
||||
# name: android-apk
|
||||
# path: ${{ steps.find-apk.outputs.path }}
|
||||
|
||||
# - name: Upload APK to release
|
||||
# if: needs.get-version.outputs.should-publish != ''
|
||||
# env:
|
||||
# RELEASE_ID: ${{ needs.create-release.outputs.releaseId }}
|
||||
# run: |
|
||||
# curl -X POST -H "Authorization: Bearer $XGH_TOKEN" \
|
||||
# -H "Content-Type: application/octet-stream" \
|
||||
# --data-binary "@${{ steps.find-apk.outputs.path }}" \
|
||||
# "https://uploads.github.com/repos/$PUBLISH_REPO/releases/$RELEASE_ID/assets?name=${{ steps.find-apk.outputs.filename }}"
|
||||
|
||||
publish-release:
|
||||
runs-on: ubuntu-latest
|
||||
# needs: [get-version, check-version, create-release, package-tauri, package-android]
|
||||
|
||||
@@ -75,11 +75,15 @@ jobs:
|
||||
require('fs').writeFileSync('package.json', JSON.stringify(p, null, 2) + '\n');
|
||||
"
|
||||
|
||||
# Update Cargo.toml to match
|
||||
sed -i 's/^version = .*/version = "'"$NEW_VERSION"'"/' src-tauri/Cargo.toml
|
||||
# Update tauri.conf.json to match
|
||||
node -e "
|
||||
const c = require('./src-tauri/tauri.conf.json');
|
||||
c.version = process.env.NEW_VERSION;
|
||||
require('fs').writeFileSync('src-tauri/tauri.conf.json', JSON.stringify(c, null, 2) + '\n');
|
||||
"
|
||||
|
||||
# Single commit and tag for both npm and Cargo
|
||||
git add package.json src-tauri/Cargo.toml
|
||||
# Single commit and tag for package.json and tauri.conf.json
|
||||
git add package.json src-tauri/tauri.conf.json
|
||||
git commit -m "chore: bump version to $NEW_VERSION [skip ci]"
|
||||
git tag "v$NEW_VERSION"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user