同步完整源码 - 2026-05-25

This commit is contained in:
xiaoxue
2026-05-25 00:25:42 +08:00
commit 0e8a88584d
351 changed files with 50404 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
name: Build & deploy
on:
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.32.5'
- name: Get dependencies
run: flutter pub get
- name: Build release project
run: flutter build web --base-href /chatmcp/
- name: Upload production-ready build files
uses: actions/upload-artifact@v4
with:
name: production-files
path: build/web
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: production-files
path: build/web
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.MY_GITHUB_TOKEN }}
publish_dir: build/web
+145
View File
@@ -0,0 +1,145 @@
name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
include:
- os: ubuntu-22.04
apk_build: true
- os: macos-latest
apk_build: false
- os: windows-latest
apk_build: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup Java
if: matrix.apk_build
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Android SDK
if: matrix.apk_build
uses: android-actions/setup-android@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.32.5'
- name: Create empty .env file
run: touch .env
- name: Install dependencies
run: flutter pub get
- name: Setup Android Signing
if: matrix.apk_build && github.event_name != 'pull_request'
env:
SIGNING_KEYSTORE: ${{ secrets.SIGNING_KEYSTORE }}
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
run: |
mkdir -p android/app/keystore
if [ -n "$SIGNING_KEYSTORE" ]; then
echo "$SIGNING_KEYSTORE" | base64 -d > android/app/keystore/release.jks
echo "SIGNING_STORE_PATH=keystore/release.jks" >> $GITHUB_ENV
echo "SIGNING_KEY_ALIAS=$SIGNING_KEY_ALIAS" >> $GITHUB_ENV
echo "SIGNING_STORE_PASSWORD=$SIGNING_STORE_PASSWORD" >> $GITHUB_ENV
echo "SIGNING_KEY_PASSWORD=$SIGNING_KEY_PASSWORD" >> $GITHUB_ENV
echo "✅ Android Signature Config Set"
else
echo "⚠️ No signature config found, using debug signing"
fi
- name: Activate FastForge
run: dart pub global activate fastforge
- name: Build linux/android package
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build libgtk-3-dev locate libsqlite3-dev fuse libfuse2 libstdc++-12-dev patchelf
sudo updatedb
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x appimagetool
sudo mv appimagetool /usr/local/bin/
fastforge release --name=linux
fastforge release --name=android
- name: Verify AppImage GLIBC compatibility (Pop!_OS 22.04)
if: matrix.os == 'ubuntu-22.04'
run: |
set -e
shopt -s nullglob
found=0
for f in dist/**/*AppImage dist/*.AppImage; do
echo "Checking $f"
chmod +x "$f"
"$f" --appimage-extract >/dev/null 2>&1 || true
if [ -d squashfs-root/usr/lib ]; then
if strings squashfs-root/usr/lib/libstdc++.so.6 | grep -E 'GLIBC_2\.(36|37|38|39)' -q; then
echo "❌ $f contains libstdc++ requiring newer GLIBC" >&2
exit 1
fi
fi
rm -rf squashfs-root
found=1
done
if [ "$found" -eq 0 ]; then
echo "No AppImage files found under dist/. Skipping check."
else
echo "✅ AppImage libstdc++ is compatible with GLIBC 2.35 hosts."
fi
- name: Setup Node.js for macOS
if: matrix.os == 'macos-latest'
uses: actions/setup-node@v3
with:
node-version: '20'
- name: macos npm install
if: matrix.os == 'macos-latest'
run: |
npm install -g appdmg
- name: Build macos package
if: matrix.os == 'macos-latest'
run: |
fastforge release --name=macos
- name: Build windows package
if: matrix.os == 'windows-latest'
run: |
fastforge release --name=windows
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.os }}
path: |
dist/*/*
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
dist/*/*
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
+34
View File
@@ -0,0 +1,34 @@
name: check-format
on:
pull_request:
branches: [ "**" ]
push:
branches: [ main, master ]
jobs:
dart-format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install dependencies
run: flutter pub get
- name: Check formatting (dry-run, excluding generated)
run: |
set -e
FILES=$(git ls-files '*.dart' ':!lib/generated/**')
if [ -z "$FILES" ]; then
echo "No Dart files to check."
exit 0
fi
dart --version
dart format --output=none --set-exit-if-changed $FILES