feat: 移除代理配置中的 TLS 验证绕过和自定义 CA 设置 #273
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: package | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-package: | |
| name: ${{ matrix.id }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - id: linux-x64 | |
| os: ubuntu-22.04 | |
| triplet: x64-linux | |
| executable: acecode | |
| archive_extension: tar.gz | |
| build_desktop: true | |
| cmake_extra_args: -DACECODE_BUILD_DESKTOP=ON | |
| - id: linux-arm64 | |
| os: ubuntu-22.04-arm | |
| triplet: arm64-linux | |
| executable: acecode | |
| archive_extension: tar.gz | |
| build_desktop: true | |
| cmake_extra_args: -DACECODE_BUILD_DESKTOP=ON | |
| - id: windows-x64 | |
| os: windows-2022 | |
| triplet: x64-windows-static | |
| executable: acecode.exe | |
| archive_extension: zip | |
| msvc_arch: amd64 | |
| build_desktop: true | |
| cmake_extra_args: -DACECODE_BUILD_DESKTOP=ON | |
| - id: macos-x64 | |
| os: macos-15 | |
| triplet: x64-osx | |
| executable: acecode | |
| archive_extension: tar.gz | |
| build_desktop: true | |
| cmake_extra_args: -DCMAKE_OSX_ARCHITECTURES=x86_64 -DACECODE_BUILD_DESKTOP=ON | |
| - id: macos-arm64 | |
| os: macos-15 | |
| triplet: arm64-osx | |
| executable: acecode | |
| archive_extension: tar.gz | |
| build_desktop: true | |
| cmake_extra_args: -DACECODE_BUILD_DESKTOP=ON | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Configure MSVC | |
| if: runner.os == 'Windows' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: ${{ matrix.msvc_arch }} | |
| - name: Run vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| - name: Install Linux desktop dependencies | |
| if: runner.os == 'Linux' && matrix.build_desktop | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: '9' | |
| - name: Build web UI | |
| shell: bash | |
| run: | | |
| cd web | |
| pnpm install --frozen-lockfile | |
| pnpm build | |
| - name: Configure | |
| shell: bash | |
| run: | | |
| cmake -S . -B build -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" \ | |
| -DVCPKG_TARGET_TRIPLET="${{ matrix.triplet }}" \ | |
| -DBUILD_TESTING=OFF \ | |
| ${{ matrix.cmake_extra_args }} | |
| - name: Build | |
| shell: bash | |
| run: cmake --build build --config Release --target acecode | |
| - name: Build desktop | |
| if: matrix.build_desktop | |
| shell: bash | |
| run: cmake --build build --config Release --target acecode-desktop | |
| - name: Build browser host | |
| shell: bash | |
| run: cmake --build build --config Release --target ace-browser-host | |
| - name: Extract debug symbols (Linux) | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| objcopy --only-keep-debug "build/${{ matrix.executable }}" "build/${{ matrix.executable }}.debug" | |
| strip --strip-debug "build/${{ matrix.executable }}" | |
| objcopy --add-gnu-debuglink="build/${{ matrix.executable }}.debug" "build/${{ matrix.executable }}" | |
| - name: Extract desktop debug symbols (Linux) | |
| if: runner.os == 'Linux' && matrix.build_desktop | |
| shell: bash | |
| run: | | |
| objcopy --only-keep-debug "build/acecode-desktop" "build/acecode-desktop.debug" | |
| strip --strip-debug "build/acecode-desktop" | |
| objcopy --add-gnu-debuglink="build/acecode-desktop.debug" "build/acecode-desktop" | |
| - name: Extract debug symbols (macOS) | |
| if: runner.os == 'macOS' | |
| shell: bash | |
| run: | | |
| dsymutil "build/${{ matrix.executable }}" -o "build/${{ matrix.executable }}.dSYM" | |
| strip "build/${{ matrix.executable }}" | |
| - name: Package (Unix) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| package_dir="dist/acecode-${{ matrix.id }}" | |
| mkdir -p "$package_dir" | |
| if [ ! -f "build/${{ matrix.executable }}" ]; then | |
| echo "Missing terminal executable: build/${{ matrix.executable }}" >&2 | |
| exit 1 | |
| fi | |
| cp "build/${{ matrix.executable }}" "$package_dir/" | |
| cp README.md README_CN.md "$package_dir/" | |
| browser_host="" | |
| for candidate in \ | |
| "build/ace-browser-host" \ | |
| "build/Release/ace-browser-host" \ | |
| "build/RelWithDebInfo/ace-browser-host" \ | |
| "build/MinSizeRel/ace-browser-host" \ | |
| "build/Debug/ace-browser-host"; do | |
| if [ -f "$candidate" ]; then | |
| browser_host="$candidate" | |
| break | |
| fi | |
| done | |
| if [ -z "$browser_host" ]; then | |
| echo "Missing browser host executable: ace-browser-host" >&2 | |
| find build -type f -name 'ace-browser-host*' -print >&2 || true | |
| exit 1 | |
| fi | |
| cp "$browser_host" "$package_dir/" | |
| if [ "${{ matrix.build_desktop }}" = "true" ]; then | |
| if [ "$RUNNER_OS" = "macOS" ]; then | |
| if [ ! -d "build/ACECode.app" ]; then | |
| echo "Missing desktop app bundle: build/ACECode.app" >&2 | |
| exit 1 | |
| fi | |
| cp -r "build/ACECode.app" "$package_dir/" | |
| else | |
| if [ ! -f "build/acecode-desktop" ]; then | |
| echo "Missing desktop executable: build/acecode-desktop" >&2 | |
| exit 1 | |
| fi | |
| cp "build/acecode-desktop" "$package_dir/" | |
| cp "web/dist/acecode-logo.png" "$package_dir/" | |
| fi | |
| fi | |
| tar -C dist -czf "acecode-${{ matrix.id }}.tar.gz" "acecode-${{ matrix.id }}" | |
| - name: Package (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $packageDir = "dist/acecode-${{ matrix.id }}" | |
| New-Item -ItemType Directory -Force -Path $packageDir | Out-Null | |
| $terminalExe = "build/${{ matrix.executable }}" | |
| if (-not (Test-Path -LiteralPath $terminalExe)) { | |
| throw "Missing terminal executable: $terminalExe" | |
| } | |
| Copy-Item -LiteralPath $terminalExe -Destination "$packageDir/" | |
| Copy-Item "README.md","README_CN.md" "$packageDir/" | |
| $browserHostCandidates = @( | |
| "build/ace-browser-host.exe", | |
| "build/Release/ace-browser-host.exe", | |
| "build/Debug/ace-browser-host.exe", | |
| "build/RelWithDebInfo/ace-browser-host.exe", | |
| "build/MinSizeRel/ace-browser-host.exe" | |
| ) | |
| $browserHostExe = $browserHostCandidates | Where-Object { Test-Path -LiteralPath $_ } | Select-Object -First 1 | |
| if (-not $browserHostExe) { | |
| $browserHostExe = Get-ChildItem -Path "build" -Recurse -Filter "ace-browser-host.exe" -File | | |
| Select-Object -ExpandProperty FullName -First 1 | |
| } | |
| if (-not $browserHostExe) { | |
| throw "Missing browser host executable: ace-browser-host.exe" | |
| } | |
| Copy-Item -LiteralPath $browserHostExe -Destination "$packageDir/" | |
| if ("${{ matrix.build_desktop }}" -eq "true") { | |
| $desktopCandidates = @( | |
| "build/acecode-desktop.exe", | |
| "build/Release/acecode-desktop.exe", | |
| "build/Debug/acecode-desktop.exe", | |
| "build/RelWithDebInfo/acecode-desktop.exe", | |
| "build/MinSizeRel/acecode-desktop.exe" | |
| ) | |
| $desktopExe = $desktopCandidates | Where-Object { Test-Path -LiteralPath $_ } | Select-Object -First 1 | |
| if (-not $desktopExe) { | |
| $desktopExe = Get-ChildItem -Path "build" -Recurse -Filter "acecode-desktop.exe" -File | | |
| Select-Object -ExpandProperty FullName -First 1 | |
| } | |
| if (-not $desktopExe) { | |
| throw "Missing desktop executable: acecode-desktop.exe" | |
| } | |
| Copy-Item -LiteralPath $desktopExe -Destination "$packageDir/" | |
| } | |
| Compress-Archive -Path "$packageDir/*" -DestinationPath "acecode-${{ matrix.id }}.zip" -Force | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: acecode-${{ matrix.id }} | |
| path: acecode-${{ matrix.id }}.${{ matrix.archive_extension }} | |
| if-no-files-found: error | |
| - name: Upload PDB | |
| if: runner.os == 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: acecode-${{ matrix.id }}-pdb | |
| path: build/**/acecode.pdb | |
| if-no-files-found: warn | |
| - name: Upload desktop PDB | |
| if: runner.os == 'Windows' && matrix.build_desktop | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: acecode-${{ matrix.id }}-desktop-pdb | |
| path: build/**/acecode-desktop.pdb | |
| if-no-files-found: warn | |
| - name: Upload debug symbols (Linux) | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: acecode-${{ matrix.id }}-debug | |
| path: build/${{ matrix.executable }}.debug | |
| if-no-files-found: warn | |
| - name: Upload desktop debug symbols (Linux) | |
| if: runner.os == 'Linux' && matrix.build_desktop | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: acecode-${{ matrix.id }}-desktop-debug | |
| path: build/acecode-desktop.debug | |
| if-no-files-found: warn | |
| - name: Upload dSYM (macOS) | |
| if: runner.os == 'macOS' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: acecode-${{ matrix.id }}-dsym | |
| path: build/${{ matrix.executable }}.dSYM | |
| if-no-files-found: warn | |
| build-linux-old-package: | |
| name: ${{ matrix.id }} | |
| runs-on: ${{ matrix.os }} | |
| container: | |
| image: buildpack-deps:buster | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| VCPKG_BINARY_SOURCES: clear | |
| VCPKG_FORCE_SYSTEM_BINARIES: 1 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - id: linux-old-x64 | |
| os: ubuntu-22.04 | |
| triplet: x64-linux | |
| executable: acecode | |
| archive_extension: tar.gz | |
| - id: linux-old-arm64 | |
| os: ubuntu-22.04-arm | |
| triplet: arm64-linux | |
| executable: acecode | |
| archive_extension: tar.gz | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install old Linux dependencies | |
| shell: bash | |
| run: | | |
| sed -i \ | |
| -e 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' \ | |
| -e 's|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' \ | |
| -e 's|http://deb.debian.org/debian-security|http://archive.debian.org/debian-security|g' \ | |
| /etc/apt/sources.list | |
| printf 'Acquire::Check-Valid-Until "false";\n' > /etc/apt/apt.conf.d/99no-check-valid-until | |
| apt-get update | |
| apt-get install -y --no-install-recommends \ | |
| binutils \ | |
| build-essential \ | |
| ca-certificates \ | |
| curl \ | |
| file \ | |
| git \ | |
| libgtk-3-dev \ | |
| libwebkit2gtk-4.0-dev \ | |
| ninja-build \ | |
| perl \ | |
| pkg-config \ | |
| python3 \ | |
| python3-pip \ | |
| tar \ | |
| unzip \ | |
| zip | |
| rm -rf /var/lib/apt/lists/* | |
| - name: Set up CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: '3.29.x' | |
| - name: Run vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: '9' | |
| - name: Build web UI | |
| shell: bash | |
| run: | | |
| cd web | |
| pnpm install --frozen-lockfile | |
| pnpm build | |
| - name: Configure | |
| shell: bash | |
| run: | | |
| cmake -S . -B build -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" \ | |
| -DVCPKG_TARGET_TRIPLET="${{ matrix.triplet }}" \ | |
| -DBUILD_TESTING=OFF \ | |
| -DACECODE_BUILD_DESKTOP=ON \ | |
| -DWEBVIEW_WEBKITGTK_API=4.0 | |
| - name: Build | |
| shell: bash | |
| run: cmake --build build --config Release --target acecode | |
| - name: Build desktop | |
| shell: bash | |
| run: cmake --build build --config Release --target acecode-desktop | |
| - name: Build browser host | |
| shell: bash | |
| run: cmake --build build --config Release --target ace-browser-host | |
| - name: Verify old Linux ABI | |
| shell: bash | |
| run: | | |
| browser_host="" | |
| for candidate in \ | |
| "build/ace-browser-host" \ | |
| "build/Release/ace-browser-host" \ | |
| "build/RelWithDebInfo/ace-browser-host" \ | |
| "build/MinSizeRel/ace-browser-host" \ | |
| "build/Debug/ace-browser-host"; do | |
| if [ -f "$candidate" ]; then | |
| browser_host="$candidate" | |
| break | |
| fi | |
| done | |
| if [ -z "$browser_host" ]; then | |
| echo "Missing browser host executable: ace-browser-host" >&2 | |
| find build -type f -name 'ace-browser-host*' -print >&2 || true | |
| exit 1 | |
| fi | |
| max_glibc="$( | |
| strings build/acecode build/acecode-desktop "$browser_host" | | |
| grep -Eo 'GLIBC_[0-9]+\.[0-9]+' | | |
| sed 's/GLIBC_//' | | |
| sort -Vu | | |
| tail -n1 | |
| )" | |
| if [ -z "$max_glibc" ]; then | |
| echo "No GLIBC symbol versions found" >&2 | |
| exit 1 | |
| fi | |
| echo "Max GLIBC symbol: GLIBC_$max_glibc" | |
| if [ "$(printf '%s\n%s\n' "$max_glibc" "2.28" | sort -V | tail -n1)" != "2.28" ]; then | |
| echo "Old Linux package requires GLIBC_$max_glibc, expected <= GLIBC_2.28" >&2 | |
| exit 1 | |
| fi | |
| ldd build/acecode-desktop | tee build/acecode-desktop.ldd | |
| grep -E 'libwebkit2gtk-4\.0\.so\.37' build/acecode-desktop.ldd | |
| if grep -E 'libwebkit2gtk-4\.1|libwebkitgtk-6' build/acecode-desktop.ldd; then | |
| echo "Old Linux desktop linked against a newer WebKitGTK ABI" >&2 | |
| exit 1 | |
| fi | |
| - name: Extract debug symbols | |
| shell: bash | |
| run: | | |
| objcopy --only-keep-debug "build/${{ matrix.executable }}" "build/${{ matrix.executable }}.debug" | |
| strip --strip-debug "build/${{ matrix.executable }}" | |
| objcopy --add-gnu-debuglink="build/${{ matrix.executable }}.debug" "build/${{ matrix.executable }}" | |
| objcopy --only-keep-debug "build/acecode-desktop" "build/acecode-desktop.debug" | |
| strip --strip-debug "build/acecode-desktop" | |
| objcopy --add-gnu-debuglink="build/acecode-desktop.debug" "build/acecode-desktop" | |
| - name: Package | |
| shell: bash | |
| run: | | |
| package_dir="dist/acecode-${{ matrix.id }}" | |
| mkdir -p "$package_dir" | |
| if [ ! -f "build/${{ matrix.executable }}" ]; then | |
| echo "Missing terminal executable: build/${{ matrix.executable }}" >&2 | |
| exit 1 | |
| fi | |
| cp "build/${{ matrix.executable }}" "$package_dir/" | |
| cp README.md README_CN.md "$package_dir/" | |
| browser_host="" | |
| for candidate in \ | |
| "build/ace-browser-host" \ | |
| "build/Release/ace-browser-host" \ | |
| "build/RelWithDebInfo/ace-browser-host" \ | |
| "build/MinSizeRel/ace-browser-host" \ | |
| "build/Debug/ace-browser-host"; do | |
| if [ -f "$candidate" ]; then | |
| browser_host="$candidate" | |
| break | |
| fi | |
| done | |
| if [ -z "$browser_host" ]; then | |
| echo "Missing browser host executable: ace-browser-host" >&2 | |
| find build -type f -name 'ace-browser-host*' -print >&2 || true | |
| exit 1 | |
| fi | |
| cp "$browser_host" "$package_dir/" | |
| if [ ! -f "build/acecode-desktop" ]; then | |
| echo "Missing desktop executable: build/acecode-desktop" >&2 | |
| exit 1 | |
| fi | |
| cp "build/acecode-desktop" "$package_dir/" | |
| cp "web/dist/acecode-logo.png" "$package_dir/" | |
| tar -C dist -czf "acecode-${{ matrix.id }}.tar.gz" "acecode-${{ matrix.id }}" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: acecode-${{ matrix.id }} | |
| path: acecode-${{ matrix.id }}.${{ matrix.archive_extension }} | |
| if-no-files-found: error | |
| - name: Upload debug symbols | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: acecode-${{ matrix.id }}-debug | |
| path: build/${{ matrix.executable }}.debug | |
| if-no-files-found: warn | |
| - name: Upload desktop debug symbols | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: acecode-${{ matrix.id }}-desktop-debug | |
| path: build/acecode-desktop.debug | |
| if-no-files-found: warn | |
| package-browser-extension: | |
| name: ace-browser-bridge | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Package Chrome extension | |
| shell: bash | |
| run: | | |
| python3 - <<'PY' | |
| from pathlib import Path | |
| from zipfile import ZipFile, ZIP_DEFLATED | |
| root = Path("ace-browser-bridge") | |
| required = [ | |
| root / "manifest.json", | |
| root / "service_worker.js", | |
| root / "content" / "virtual-cursor.js", | |
| ] | |
| missing = [str(path) for path in required if not path.is_file()] | |
| if missing: | |
| raise SystemExit("Missing Chrome extension files: " + ", ".join(missing)) | |
| out = Path("ace-browser-bridge.zip") | |
| if out.exists(): | |
| out.unlink() | |
| with ZipFile(out, "w", ZIP_DEFLATED) as archive: | |
| for path in sorted(root.rglob("*")): | |
| if path.is_file(): | |
| archive.write(path, path.as_posix()) | |
| with ZipFile(out) as archive: | |
| names = set(archive.namelist()) | |
| for path in required: | |
| entry = path.as_posix() | |
| if entry not in names: | |
| raise SystemExit(f"Chrome extension zip missing {entry}") | |
| PY | |
| - name: Upload Chrome extension artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ace-browser-bridge | |
| path: ace-browser-bridge.zip | |
| if-no-files-found: error | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: | |
| - build-and-package | |
| - build-linux-old-package | |
| - package-browser-extension | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: false | |
| - name: Collect release assets | |
| shell: bash | |
| run: | | |
| mkdir -p release-assets | |
| find artifacts -type f \( -name '*.tar.gz' -o -name '*.zip' \) -print0 | | |
| while IFS= read -r -d '' file; do | |
| cp "$file" "release-assets/$(basename "$file")" | |
| done | |
| find artifacts -type f \( -name '*.pdb' -o -name '*.debug' \) -print0 | | |
| while IFS= read -r -d '' file; do | |
| relative="${file#artifacts/}" | |
| artifact_name="${relative%%/*}" | |
| cp "$file" "release-assets/[dev_only]${artifact_name}-$(basename "$file")" | |
| done | |
| # Package dSYM directories as tar.gz | |
| find artifacts -type d -name '*.dSYM' -print0 | | |
| while IFS= read -r -d '' dsym; do | |
| relative="${dsym#artifacts/}" | |
| artifact_name="${relative%%/*}" | |
| dsym_name="$(basename "$dsym")" | |
| tar -czf "release-assets/[dev_only]${artifact_name}-${dsym_name}.tar.gz" -C "$(dirname "$dsym")" "$dsym_name" | |
| done | |
| ls -lh release-assets/ | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: release-assets/* |