Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e3745a7
refactor(build): 将安装依赖步骤转移至build.yaml
VillagerTom May 26, 2026
f71ff51
feat(ci): 添加手动触发 test build
VillagerTom Apr 4, 2026
4b77c8b
feat(build): add "targets" parameter to setup.dart
VillagerTom Apr 4, 2026
0a9b77c
chore(build): 修改易混淆的变量名称
VillagerTom May 26, 2026
0e9a928
feat(build): add dep checks in setup.dart
VillagerTom May 26, 2026
033485c
fix(build): Fix build failure with Clang>=21 and libayatana-appindica…
VillagerTom May 20, 2026
8ed0732
refactor(build): 内联 _setMacOSCompatibleBuild()
VillagerTom Apr 29, 2026
1765fd4
feat(build): use system arch as default arch for non-android platform…
VillagerTom May 3, 2026
edb4500
docs: 添加本地构建文档; 整理 README 章节顺序
VillagerTom Apr 23, 2026
2ada6e2
fix(build): macOS 根据 arch 参数正确构建 app, core 的架构
VillagerTom May 3, 2026
6c896af
chore(build): display arch names when building core of multiple archs
VillagerTom May 3, 2026
2fd5dc2
fix(build): 修复错误的命令选项及其 help
VillagerTom May 8, 2026
d9dada4
fix(build): prevent cross-builds for windows
VillagerTom May 13, 2026
cca55d6
docs(build): update tool versions
VillagerTom May 27, 2026
54010e1
chore(README): 折叠“从源码构建”章节
VillagerTom May 29, 2026
8f7a607
feat(build): add parameter 'build-only' to skip packaging the app bundle
VillagerTom May 29, 2026
b7cae77
feat(build): out=core,helper
VillagerTom Jun 6, 2026
c35a478
chore(build):update makefile
VillagerTom Jun 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ on:
push:
tags:
- 'v*'
workflow_dispatch:

env:
IS_STABLE: ${{ !contains(github.ref, '-') }}
IS_STABLE: ${{ github.ref_type == 'tag' && !contains(github.ref, '-') }}
IS_PRERELEASE: ${{ contains(github.ref_name, 'pre') }}
SHOULD_RELEASE: ${{ !contains(github.ref, '-') || contains(github.ref_name, 'pre') }}
GRADLE_OPTS: -Dorg.gradle.vfs.watch=false
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
SENTRY_BACKEND: none

jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -100,7 +103,25 @@ jobs:
if: matrix.platform == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev ninja-build libgtk-3-dev rpm
sudo apt-get install -y \
libcurl4-openssl-dev \
ninja-build \
libgtk-3-dev \
libayatana-appindicator3-dev \
libkeybinder-3.0-dev \
locate \
p7zip \
${{ matrix.arch == 'amd64' && 'rpm patchelf libfuse2' || '' }}

_arch=${{ matrix.arch == 'amd64' && 'x86_64' || 'aarch64' }}
wget -O appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${_arch}.AppImage
chmod +x appimagetool
sudo mv appimagetool /usr/local/bin/

- name: Install Dependencies (macOS)
if: matrix.platform == 'macos'
run: |
npm install -g appdmg

- name: Setup Golang
uses: actions/setup-go@v6
Expand Down Expand Up @@ -136,7 +157,14 @@ jobs:
run: |
flutter pub get
dart run build_runner build -d
dart setup.dart ${{ matrix.platform }} --arch ${{ matrix.arch }} ${{ env.IS_STABLE == 'true' && '--env stable' || '' }} ${{ matrix.compatible == true && '--compatible' || '' }}
dart setup.dart \
${{ matrix.platform }} \
--arch ${{ matrix.arch }} \
${{ env.IS_STABLE == 'true' && '--env stable' || '' }} \
${{ matrix.compatible == true && '--compatible' || '' }} \
${{ matrix.platform == 'linux' && '--targets' || ''}} \
${{ matrix.platform == 'linux' && matrix.arch == 'amd64' && 'deb,rpm,appimage' || '' }} \
${{ matrix.platform == 'linux' && matrix.arch == 'arm64' && 'deb' || '' }}

- name: Upload Artifacts
uses: actions/upload-artifact@v6
Expand Down Expand Up @@ -178,7 +206,7 @@ jobs:
fi

- name: Release
if: ${{ env.SHOULD_RELEASE == 'true' }}
if: ${{ env.IS_STABLE == 'true' || env.IS_PRERELEASE == 'true' }}
uses: softprops/action-gh-release@v3.0.0
with:
files: ./dist/*
Expand Down
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ migrate_working_dir/
/specs/
/dist/
.test/
.vscode/
.vscode/*
/services/helper/target/

# Symbolication related
Expand All @@ -60,7 +60,14 @@ app.*.map.json

#jniLibs
/android/app/src/main/jniLibs/
/android/core/src/main/jniLibs/

# FVM Version Cache
.fvm/
.fvmrc

# Version Managers
.fvmrc
mise.toml

# VS Code Configs
!.vscode/launch.json
34 changes: 34 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Bettbox",
"request": "launch",
"type": "dart",
"args": [
"--dart-define-from-file=libclash/windows/.core_sha256"
]
},
{
"name": "Bettbox (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile",
"args": [
"--dart-define-from-file=libclash/windows/.core_sha256"
]
},
{
"name": "Bettbox (release mode)",
"request": "launch",
"type": "dart",
"flutterMode": "release",
"args": [
"--dart-define-from-file=libclash/windows/.core_sha256"
]
}
]
}
60 changes: 53 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,56 @@
android_arm64:
dart ./setup.dart android --arch arm64
macos_arm64:
macos_app:
dart ./setup.dart macos

macos_app_arm64:
dart ./setup.dart macos --arch arm64
android_app:

macos_app_amd64:
dart ./setup.dart macos --arch amd64

macos_app_universal:
dart .setup.dart macos --arch universal

macos_core:
dart ./setup.dart macos --out core

macos_core_arm64:
dart ./setup.dart macos --arch arm64 --out core

macos_core_amd64:
dart ./setup.dart macos --arch amd64 --out core

android_app_all:
dart ./setup.dart android
android_arm64_core:

android_app_arm64:
dart ./setup.dart android --arch arm64

android_app_universal:
dart ./setup.dart android --arch universal

android_core_arm64:
dart ./setup.dart android --arch arm64 --out core
macos_arm64_core:
dart ./setup.dart macos --arch arm64 --out core

windows_core_and_helper:
dart ./setup.dart windows --out core,helper

windows_core_and_helper_amd64_compatible:
dart ./setup.dart windows --out core,helper --arch amd64 --compatible

windows_app:
dart ./setup.dart windows

windows_app_amd64_compatible:
dart ./setup.dart windows --arch amd64 --compatible

linux:
dart ./setup.dart linux --build-only

linux_amd64_compatible:
dart ./setup.dart linux --arch amd64 --compatible --build-only

linux_core:
dart ./setup.dart linux --out core

linux_core_amd64_compatible:
dart ./setup.dart linux --out core --arch amd64 --compatible
Loading