mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-04-23 00:27:06 +08:00
ci: rewrite build workflows (#2089)
This commit is contained in:
+35
-54
@@ -1,29 +1,40 @@
|
|||||||
[target.x86_64-unknown-linux-musl]
|
# region Native
|
||||||
linker = "rust-lld"
|
|
||||||
rustflags = ["-C", "linker-flavor=ld.lld"]
|
[target.x86_64-unknown-linux-gnu]
|
||||||
|
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
|
||||||
|
|
||||||
[target.aarch64-unknown-linux-gnu]
|
[target.aarch64-unknown-linux-gnu]
|
||||||
linker = "aarch64-linux-gnu-gcc"
|
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
|
||||||
|
|
||||||
[target.aarch64-unknown-linux-ohos]
|
[target.'cfg(all(windows, target_env = "msvc"))']
|
||||||
ar = "/usr/local/ohos-sdk/linux/native/llvm/bin/llvm-ar"
|
rustflags = ["-C", "target-feature=+crt-static"]
|
||||||
linker = "/home/runner/sdk/native/llvm/aarch64-unknown-linux-ohos-clang.sh"
|
|
||||||
|
|
||||||
[target.aarch64-unknown-linux-ohos.env]
|
# region
|
||||||
PKG_CONFIG_PATH = "/usr/local/ohos-sdk/linux/native/sysroot/usr/lib/pkgconfig:/usr/local/ohos-sdk/linux/native/sysroot/usr/local/lib/pkgconfig"
|
|
||||||
PKG_CONFIG_LIBDIR = "/usr/local/ohos-sdk/linux/native/sysroot/usr/lib:/usr/local/ohos-sdk/linux/native/sysroot/usr/local/lib"
|
# region CI
|
||||||
PKG_CONFIG_SYSROOT_DIR = "/usr/local/ohos-sdk/linux/native/sysroot"
|
|
||||||
SYSROOT = "/usr/local/ohos-sdk/linux/native/sysroot"
|
[target.x86_64-unknown-linux-musl]
|
||||||
|
rustflags = ["-C", "target-feature=+crt-static"]
|
||||||
|
|
||||||
[target.aarch64-unknown-linux-musl]
|
[target.aarch64-unknown-linux-musl]
|
||||||
linker = "aarch64-unknown-linux-musl-gcc"
|
|
||||||
rustflags = ["-C", "target-feature=+crt-static"]
|
rustflags = ["-C", "target-feature=+crt-static"]
|
||||||
|
|
||||||
[target.riscv64gc-unknown-linux-musl]
|
[target.riscv64gc-unknown-linux-musl]
|
||||||
linker = "riscv64-unknown-linux-musl-gcc"
|
|
||||||
rustflags = ["-C", "target-feature=+crt-static"]
|
rustflags = ["-C", "target-feature=+crt-static"]
|
||||||
|
|
||||||
[target.'cfg(all(windows, target_env = "msvc"))']
|
[target.armv7-unknown-linux-musleabihf]
|
||||||
|
rustflags = ["-C", "target-feature=+crt-static"]
|
||||||
|
|
||||||
|
[target.armv7-unknown-linux-musleabi]
|
||||||
|
rustflags = ["-C", "target-feature=+crt-static"]
|
||||||
|
|
||||||
|
[target.arm-unknown-linux-musleabihf]
|
||||||
|
rustflags = ["-C", "target-feature=+crt-static"]
|
||||||
|
|
||||||
|
[target.arm-unknown-linux-musleabi]
|
||||||
|
rustflags = ["-C", "target-feature=+crt-static"]
|
||||||
|
|
||||||
|
[target.loongarch64-unknown-linux-musl]
|
||||||
rustflags = ["-C", "target-feature=+crt-static"]
|
rustflags = ["-C", "target-feature=+crt-static"]
|
||||||
|
|
||||||
[target.mipsel-unknown-linux-musl]
|
[target.mipsel-unknown-linux-musl]
|
||||||
@@ -64,44 +75,14 @@ rustflags = [
|
|||||||
"gcc",
|
"gcc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[target.armv7-unknown-linux-musleabihf]
|
[target.aarch64-unknown-linux-ohos]
|
||||||
linker = "armv7-unknown-linux-musleabihf-gcc"
|
ar = "/usr/local/ohos-sdk/linux/native/llvm/bin/llvm-ar"
|
||||||
rustflags = ["-C", "target-feature=+crt-static"]
|
linker = "/home/runner/sdk/native/llvm/aarch64-unknown-linux-ohos-clang.sh"
|
||||||
|
|
||||||
[target.armv7-unknown-linux-musleabi]
|
[target.aarch64-unknown-linux-ohos.env]
|
||||||
linker = "armv7-unknown-linux-musleabi-gcc"
|
PKG_CONFIG_PATH = "/usr/local/ohos-sdk/linux/native/sysroot/usr/lib/pkgconfig:/usr/local/ohos-sdk/linux/native/sysroot/usr/local/lib/pkgconfig"
|
||||||
rustflags = ["-C", "target-feature=+crt-static"]
|
PKG_CONFIG_LIBDIR = "/usr/local/ohos-sdk/linux/native/sysroot/usr/lib:/usr/local/ohos-sdk/linux/native/sysroot/usr/local/lib"
|
||||||
|
PKG_CONFIG_SYSROOT_DIR = "/usr/local/ohos-sdk/linux/native/sysroot"
|
||||||
|
SYSROOT = "/usr/local/ohos-sdk/linux/native/sysroot"
|
||||||
|
|
||||||
[target.loongarch64-unknown-linux-musl]
|
# endregion
|
||||||
linker = "loongarch64-unknown-linux-musl-gcc"
|
|
||||||
rustflags = ["-C", "target-feature=+crt-static"]
|
|
||||||
|
|
||||||
[target.arm-unknown-linux-musleabihf]
|
|
||||||
linker = "arm-unknown-linux-musleabihf-gcc"
|
|
||||||
rustflags = [
|
|
||||||
"-C",
|
|
||||||
"target-feature=+crt-static",
|
|
||||||
"-L",
|
|
||||||
"./musl_gcc/arm-unknown-linux-musleabihf/arm-unknown-linux-musleabihf/lib",
|
|
||||||
"-L",
|
|
||||||
"./musl_gcc/arm-unknown-linux-musleabihf/lib/gcc/arm-unknown-linux-musleabihf/15.1.0",
|
|
||||||
"-l",
|
|
||||||
"atomic",
|
|
||||||
"-l",
|
|
||||||
"gcc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[target.arm-unknown-linux-musleabi]
|
|
||||||
linker = "arm-unknown-linux-musleabi-gcc"
|
|
||||||
rustflags = [
|
|
||||||
"-C",
|
|
||||||
"target-feature=+crt-static",
|
|
||||||
"-L",
|
|
||||||
"./musl_gcc/arm-unknown-linux-musleabi/arm-unknown-linux-musleabi/lib",
|
|
||||||
"-L",
|
|
||||||
"./musl_gcc/arm-unknown-linux-musleabi/lib/gcc/arm-unknown-linux-musleabi/15.1.0",
|
|
||||||
"-l",
|
|
||||||
"atomic",
|
|
||||||
"-l",
|
|
||||||
"gcc",
|
|
||||||
]
|
|
||||||
|
|||||||
@@ -2,10 +2,17 @@ name: prepare-build
|
|||||||
author: Luna
|
author: Luna
|
||||||
description: Prepare build environment
|
description: Prepare build environment
|
||||||
inputs:
|
inputs:
|
||||||
web:
|
target:
|
||||||
description: 'Whether to prepare the web build environment'
|
description: 'The target to build for'
|
||||||
|
required: false
|
||||||
|
pnpm:
|
||||||
|
description: 'Whether to run pnpm build'
|
||||||
required: true
|
required: true
|
||||||
default: 'true'
|
default: 'true'
|
||||||
|
pnpm-build-filter:
|
||||||
|
description: 'The filter argument for pnpm build (e.g. ./easytier-web/*)'
|
||||||
|
required: false
|
||||||
|
default: './easytier-web/*'
|
||||||
gui:
|
gui:
|
||||||
description: 'Whether to prepare the GUI build environment'
|
description: 'Whether to prepare the GUI build environment'
|
||||||
required: true
|
required: true
|
||||||
@@ -19,21 +26,63 @@ runs:
|
|||||||
- run: mkdir -p easytier-gui/dist
|
- run: mkdir -p easytier-gui/dist
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Setup Frontend Environment
|
- name: Install dependencies
|
||||||
if: ${{ inputs.web == 'true' }}
|
if: ${{ runner.os == 'Linux' }}
|
||||||
uses: ./.github/actions/prepare-pnpm
|
|
||||||
with:
|
|
||||||
build-filter: './easytier-web/*'
|
|
||||||
|
|
||||||
- name: Install GUI dependencies (Used by clippy)
|
|
||||||
if: ${{ inputs.gui == 'true' }}
|
|
||||||
run: |
|
run: |
|
||||||
bash ./.github/workflows/install_gui_dep.sh
|
sudo apt-get update
|
||||||
|
sudo apt-get install -qqy build-essential mold musl-tools
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Setup Frontend Environment
|
||||||
|
if: ${{ inputs.pnpm == 'true' }}
|
||||||
|
uses: ./.github/actions/prepare-pnpm
|
||||||
|
with:
|
||||||
|
build-filter: ${{ inputs.pnpm-build-filter }}
|
||||||
|
|
||||||
|
- name: Install GUI dependencies (Linux)
|
||||||
|
if: ${{ inputs.gui == 'true' && runner.os == 'Linux' }}
|
||||||
run: |
|
run: |
|
||||||
bash ./.github/workflows/install_rust.sh
|
sudo apt-get install -qq xdg-utils \
|
||||||
|
libappindicator3-dev \
|
||||||
|
libgtk-3-dev \
|
||||||
|
librsvg2-dev \
|
||||||
|
libwebkit2gtk-4.1-dev \
|
||||||
|
libxdo-dev
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
target: ${{ !contains(inputs.target, 'mips') && inputs.target || '' }}
|
||||||
|
cache: false
|
||||||
|
rustflags: ''
|
||||||
|
|
||||||
|
- name: Install Rust (MIPS)
|
||||||
|
if: ${{ contains(inputs.target, 'mips') }}
|
||||||
|
run: |
|
||||||
|
rustup toolchain install nightly-2026-02-02-x86_64-unknown-linux-gnu
|
||||||
|
rustup component add rust-src --toolchain nightly-2026-02-02-x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
|
MUSL_TARGET=${{ inputs.target }}sf
|
||||||
|
mkdir -p ./musl_gcc
|
||||||
|
wget --inet4-only -c https://github.com/cross-tools/musl-cross/releases/download/20250520/${MUSL_TARGET}.tar.xz -P ./musl_gcc/
|
||||||
|
tar xf ./musl_gcc/${MUSL_TARGET}.tar.xz -C ./musl_gcc/
|
||||||
|
sudo ln -sf $(pwd)/musl_gcc/${MUSL_TARGET}/bin/*gcc /usr/bin/
|
||||||
|
sudo ln -sf $(pwd)/musl_gcc/${MUSL_TARGET}/include/ /usr/include/musl-cross
|
||||||
|
sudo ln -sf $(pwd)/musl_gcc/${MUSL_TARGET}/${MUSL_TARGET}/sysroot/ ./musl_gcc/sysroot
|
||||||
|
sudo chmod -R a+rwx ./musl_gcc
|
||||||
|
|
||||||
|
if [[ -d "./musl_gcc/sysroot" ]]; then
|
||||||
|
echo "BINDGEN_EXTRA_CLANG_ARGS=--sysroot=$(readlink -f ./musl_gcc/sysroot)" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$PWD/musl_gcc/${MUSL_TARGET}/lib/gcc/${MUSL_TARGET}/15.1.0" || exit 255
|
||||||
|
# for panic-abort
|
||||||
|
cp libgcc_eh.a libunwind.a
|
||||||
|
|
||||||
|
# for mimalloc
|
||||||
|
ar x libgcc.a _ctzsi2.o _clz.o _bswapsi2.o
|
||||||
|
ar rcs libctz.a _ctzsi2.o _clz.o _bswapsi2.o
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Setup protoc
|
- name: Setup protoc
|
||||||
|
|||||||
+109
-137
@@ -2,10 +2,10 @@ name: EasyTier Core
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["develop", "main", "releases/**"]
|
branches: [ "develop", "main", "releases/**" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ["develop", "main"]
|
branches: [ "develop", "main" ]
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [ opened, synchronize, reopened, ready_for_review ]
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
concurrent_skipping: 'same_content_newer'
|
concurrent_skipping: 'same_content_newer'
|
||||||
skip_after_successful_duplicate: 'true'
|
skip_after_successful_duplicate: 'true'
|
||||||
cancel_others: 'true'
|
cancel_others: 'true'
|
||||||
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", ".github/workflows/core.yml", ".github/workflows/install_rust.sh", "easytier-web/**"]'
|
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", ".github/workflows/core.yml", ".github/actions/**", "easytier-web/**"]'
|
||||||
build_web:
|
build_web:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: pre_job
|
needs: pre_job
|
||||||
@@ -60,38 +60,45 @@ jobs:
|
|||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- TARGET: aarch64-unknown-linux-musl
|
|
||||||
OS: ubuntu-22.04
|
|
||||||
ARTIFACT_NAME: linux-aarch64
|
|
||||||
- TARGET: x86_64-unknown-linux-musl
|
- TARGET: x86_64-unknown-linux-musl
|
||||||
OS: ubuntu-22.04
|
OS: ubuntu-24.04
|
||||||
ARTIFACT_NAME: linux-x86_64
|
ARTIFACT_NAME: linux-x86_64
|
||||||
- TARGET: riscv64gc-unknown-linux-musl
|
- TARGET: aarch64-unknown-linux-musl
|
||||||
OS: ubuntu-22.04
|
OS: ubuntu-24.04-arm
|
||||||
ARTIFACT_NAME: linux-riscv64
|
ARTIFACT_NAME: linux-aarch64
|
||||||
- TARGET: mips-unknown-linux-musl
|
|
||||||
OS: ubuntu-22.04
|
|
||||||
ARTIFACT_NAME: linux-mips
|
|
||||||
- TARGET: mipsel-unknown-linux-musl
|
|
||||||
OS: ubuntu-22.04
|
|
||||||
ARTIFACT_NAME: linux-mipsel
|
|
||||||
- TARGET: armv7-unknown-linux-musleabihf # raspberry pi 2-3-4, not tested
|
|
||||||
OS: ubuntu-22.04
|
|
||||||
ARTIFACT_NAME: linux-armv7hf
|
|
||||||
- TARGET: armv7-unknown-linux-musleabi # raspberry pi 2-3-4, not tested
|
|
||||||
OS: ubuntu-22.04
|
|
||||||
ARTIFACT_NAME: linux-armv7
|
|
||||||
- TARGET: arm-unknown-linux-musleabihf # raspberry pi 0-1, not tested
|
|
||||||
OS: ubuntu-22.04
|
|
||||||
ARTIFACT_NAME: linux-armhf
|
|
||||||
- TARGET: arm-unknown-linux-musleabi # raspberry pi 0-1, not tested
|
|
||||||
OS: ubuntu-22.04
|
|
||||||
ARTIFACT_NAME: linux-arm
|
|
||||||
|
|
||||||
|
- TARGET: riscv64gc-unknown-linux-musl
|
||||||
|
OS: ubuntu-24.04
|
||||||
|
ARTIFACT_NAME: linux-riscv64
|
||||||
- TARGET: loongarch64-unknown-linux-musl
|
- TARGET: loongarch64-unknown-linux-musl
|
||||||
OS: ubuntu-24.04
|
OS: ubuntu-24.04
|
||||||
ARTIFACT_NAME: linux-loongarch64
|
ARTIFACT_NAME: linux-loongarch64
|
||||||
|
|
||||||
|
- TARGET: armv7-unknown-linux-musleabihf # raspberry pi 2-3-4, not tested
|
||||||
|
OS: ubuntu-24.04
|
||||||
|
ARTIFACT_NAME: linux-armv7hf
|
||||||
|
- TARGET: armv7-unknown-linux-musleabi # raspberry pi 2-3-4, not tested
|
||||||
|
OS: ubuntu-24.04
|
||||||
|
ARTIFACT_NAME: linux-armv7
|
||||||
|
- TARGET: arm-unknown-linux-musleabihf # raspberry pi 0-1, not tested
|
||||||
|
OS: ubuntu-24.04
|
||||||
|
ARTIFACT_NAME: linux-armhf
|
||||||
|
- TARGET: arm-unknown-linux-musleabi # raspberry pi 0-1, not tested
|
||||||
|
OS: ubuntu-24.04
|
||||||
|
ARTIFACT_NAME: linux-arm
|
||||||
|
|
||||||
|
- TARGET: mips-unknown-linux-musl
|
||||||
|
OS: ubuntu-24.04
|
||||||
|
ARTIFACT_NAME: linux-mips
|
||||||
|
- TARGET: mipsel-unknown-linux-musl
|
||||||
|
OS: ubuntu-24.04
|
||||||
|
ARTIFACT_NAME: linux-mipsel
|
||||||
|
|
||||||
|
- TARGET: x86_64-unknown-freebsd
|
||||||
|
OS: ubuntu-24.04
|
||||||
|
ARTIFACT_NAME: freebsd-13.2-x86_64
|
||||||
|
BSD_VERSION: 13.2
|
||||||
|
|
||||||
- TARGET: x86_64-apple-darwin
|
- TARGET: x86_64-apple-darwin
|
||||||
OS: macos-latest
|
OS: macos-latest
|
||||||
ARTIFACT_NAME: macos-x86_64
|
ARTIFACT_NAME: macos-x86_64
|
||||||
@@ -102,17 +109,12 @@ jobs:
|
|||||||
- TARGET: x86_64-pc-windows-msvc
|
- TARGET: x86_64-pc-windows-msvc
|
||||||
OS: windows-latest
|
OS: windows-latest
|
||||||
ARTIFACT_NAME: windows-x86_64
|
ARTIFACT_NAME: windows-x86_64
|
||||||
- TARGET: aarch64-pc-windows-msvc
|
|
||||||
OS: windows-latest
|
|
||||||
ARTIFACT_NAME: windows-arm64
|
|
||||||
- TARGET: i686-pc-windows-msvc
|
- TARGET: i686-pc-windows-msvc
|
||||||
OS: windows-latest
|
OS: windows-latest
|
||||||
ARTIFACT_NAME: windows-i686
|
ARTIFACT_NAME: windows-i686
|
||||||
|
- TARGET: aarch64-pc-windows-msvc
|
||||||
- TARGET: x86_64-unknown-freebsd
|
OS: windows-11-arm
|
||||||
OS: ubuntu-22.04
|
ARTIFACT_NAME: windows-arm64
|
||||||
ARTIFACT_NAME: freebsd-13.2-x86_64
|
|
||||||
BSD_VERSION: 13.2
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.OS }}
|
runs-on: ${{ matrix.OS }}
|
||||||
env:
|
env:
|
||||||
@@ -137,8 +139,15 @@ jobs:
|
|||||||
name: easytier-web-dashboard
|
name: easytier-web-dashboard
|
||||||
path: easytier-web/frontend/dist/
|
path: easytier-web/frontend/dist/
|
||||||
|
|
||||||
|
- name: Prepare build environment
|
||||||
|
uses: ./.github/actions/prepare-build
|
||||||
|
with:
|
||||||
|
target: ${{ matrix.TARGET }}
|
||||||
|
gui: true
|
||||||
|
pnpm: true
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
if: ${{ ! endsWith(matrix.TARGET, 'freebsd') }}
|
|
||||||
with:
|
with:
|
||||||
# The prefix cache key, this can be changed to start a new cache manually.
|
# The prefix cache key, this can be changed to start a new cache manually.
|
||||||
# default: "v0-rust"
|
# default: "v0-rust"
|
||||||
@@ -146,96 +155,49 @@ jobs:
|
|||||||
shared-key: "core-registry"
|
shared-key: "core-registry"
|
||||||
cache-targets: "false"
|
cache-targets: "false"
|
||||||
|
|
||||||
- name: Setup protoc
|
- uses: mlugg/setup-zig@v2
|
||||||
uses: arduino/setup-protoc@v3
|
if: ${{ contains(matrix.OS, 'ubuntu') }}
|
||||||
|
|
||||||
|
- uses: taiki-e/install-action@v2
|
||||||
|
if: ${{ contains(matrix.OS, 'ubuntu') }}
|
||||||
with:
|
with:
|
||||||
# GitHub repo token to use to avoid rate limiter
|
tool: cargo-zigbuild
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build Core & Cli
|
- name: Build
|
||||||
if: ${{ ! endsWith(matrix.TARGET, 'freebsd') }}
|
if: ${{ !contains(matrix.TARGET, 'mips') }}
|
||||||
run: |
|
run: |
|
||||||
bash ./.github/workflows/install_rust.sh
|
if [[ "$TARGET" == *windows* ]]; then
|
||||||
|
|
||||||
# loongarch need llvm-18
|
|
||||||
if [[ $TARGET =~ ^loongarch.*$ ]]; then
|
|
||||||
sudo apt-get install -qq llvm-18 clang-18
|
|
||||||
export LLVM_CONFIG_PATH=/usr/lib/llvm-18/bin/llvm-config
|
|
||||||
fi
|
|
||||||
# we set the sysroot when sysroot is a dir
|
|
||||||
# this dir is a soft link generated by install_rust.sh
|
|
||||||
# kcp-sys need this to gen ffi bindings. without this clang may fail to find some libc headers such as bits/libc-header-start.h
|
|
||||||
if [[ -d "./musl_gcc/sysroot" ]]; then
|
|
||||||
export BINDGEN_EXTRA_CLANG_ARGS=--sysroot=$(readlink -f ./musl_gcc/sysroot)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $OS =~ ^ubuntu.*$ && $TARGET =~ ^mips.*$ ]]; then
|
|
||||||
cargo +nightly-2026-02-02 build -r --target $TARGET -Z build-std=std,panic_abort --package=easytier --features=jemalloc
|
|
||||||
else
|
|
||||||
if [[ $OS =~ ^windows.*$ ]]; then
|
|
||||||
SUFFIX=.exe
|
SUFFIX=.exe
|
||||||
CORE_FEATURES="--features=mimalloc"
|
|
||||||
elif [[ $TARGET =~ ^riscv64.*$ || $TARGET =~ ^loongarch64.*$ || $TARGET =~ ^aarch64.*$ ]]; then
|
|
||||||
CORE_FEATURES="--features=mimalloc"
|
|
||||||
else
|
else
|
||||||
CORE_FEATURES="--features=jemalloc"
|
SUFFIX=""
|
||||||
fi
|
fi
|
||||||
cargo build --release --target $TARGET --package=easytier-web --features=embed
|
|
||||||
|
if [[ "$TARGET" =~ (x86_64-unknown-linux-musl|aarch64-unknown-linux-musl|windows|darwin) ]]; then
|
||||||
|
BUILD=build
|
||||||
|
else
|
||||||
|
BUILD=zigbuild
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$TARGET" =~ ^(riscv64|loongarch64|aarch64).*$ || "$TARGET" =~ windows ]]; then
|
||||||
|
FEATURES="mimalloc"
|
||||||
|
else
|
||||||
|
FEATURES="jemalloc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cargo $BUILD --release --target $TARGET --package=easytier-web --features=embed
|
||||||
mv ./target/$TARGET/release/easytier-web"$SUFFIX" ./target/$TARGET/release/easytier-web-embed"$SUFFIX"
|
mv ./target/$TARGET/release/easytier-web"$SUFFIX" ./target/$TARGET/release/easytier-web-embed"$SUFFIX"
|
||||||
cargo build --release --target $TARGET $CORE_FEATURES
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Copied and slightly modified from @lmq8267 (https://github.com/lmq8267)
|
cargo $BUILD --release --target $TARGET --features=$FEATURES
|
||||||
- name: Build Core & Cli (X86_64 FreeBSD)
|
|
||||||
uses: vmactions/freebsd-vm@670398e4236735b8b65805c3da44b7a511fb8b27
|
- name: Build (MIPS)
|
||||||
if: ${{ endsWith(matrix.TARGET, 'freebsd') }}
|
if: ${{ contains(matrix.TARGET, 'mips') }}
|
||||||
env:
|
|
||||||
TARGET: ${{ matrix.TARGET }}
|
|
||||||
with:
|
|
||||||
envs: TARGET
|
|
||||||
release: ${{ matrix.BSD_VERSION }}
|
|
||||||
arch: x86_64
|
|
||||||
usesh: true
|
|
||||||
mem: 6144
|
|
||||||
cpu: 4
|
|
||||||
run: |
|
run: |
|
||||||
uname -a
|
cargo +nightly-2026-02-02 build -r --target $TARGET -Z build-std=std,panic_abort --package=easytier --features=jemalloc
|
||||||
echo $SHELL
|
|
||||||
pwd
|
|
||||||
ls -lah
|
|
||||||
whoami
|
|
||||||
env | sort
|
|
||||||
|
|
||||||
pkg install -y git protobuf llvm-devel sudo curl
|
|
||||||
curl --proto 'https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
||||||
. $HOME/.cargo/env
|
|
||||||
|
|
||||||
rustup set auto-self-update disable
|
|
||||||
|
|
||||||
rustup install 1.93
|
|
||||||
rustup default 1.93
|
|
||||||
|
|
||||||
export CC=clang
|
|
||||||
export CXX=clang++
|
|
||||||
export CARGO_TERM_COLOR=always
|
|
||||||
|
|
||||||
cargo build --release --verbose --target $TARGET --package=easytier-web --features=embed
|
|
||||||
mv ./target/$TARGET/release/easytier-web ./target/$TARGET/release/easytier-web-embed
|
|
||||||
cargo build --release --verbose --target $TARGET --features=mimalloc
|
|
||||||
|
|
||||||
mkdir -p built-bins/$TARGET/release/
|
|
||||||
mv ./target/$TARGET/release/easytier-web-embed ./built-bins/$TARGET/release/easytier-web-embed
|
|
||||||
mv ./target/$TARGET/release/easytier-web ./built-bins/$TARGET/release/easytier-web
|
|
||||||
mv ./target/$TARGET/release/easytier-core ./built-bins/$TARGET/release/easytier-core
|
|
||||||
mv ./target/$TARGET/release/easytier-cli ./built-bins/$TARGET/release/easytier-cli
|
|
||||||
|
|
||||||
# remove dirs to avoid copy many files back
|
|
||||||
rm -rf ./target ~/.cargo
|
|
||||||
mv ./built-bins ./target
|
|
||||||
|
|
||||||
- name: Compress
|
- name: Compress
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ./artifacts/objects/
|
mkdir -p ./artifacts/objects/
|
||||||
|
|
||||||
# windows is the only OS using a different convention for executable file name
|
# windows is the only OS using a different convention for executable file name
|
||||||
if [[ $OS =~ ^windows.*$ ]]; then
|
if [[ $OS =~ ^windows.*$ ]]; then
|
||||||
SUFFIX=.exe
|
SUFFIX=.exe
|
||||||
@@ -248,27 +210,38 @@ jobs:
|
|||||||
find "easytier/third_party/${ARCH_DIR}" -maxdepth 1 -type f \( -name "*.dll" -o -name "*.sys" \) -exec cp {} ./artifacts/objects/ \;
|
find "easytier/third_party/${ARCH_DIR}" -maxdepth 1 -type f \( -name "*.dll" -o -name "*.sys" \) -exec cp {} ./artifacts/objects/ \;
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $GITHUB_REF_TYPE =~ ^tag$ ]]; then
|
if [[ $GITHUB_REF_TYPE =~ ^tag$ ]]; then
|
||||||
TAG=$GITHUB_REF_NAME
|
TAG=$GITHUB_REF_NAME
|
||||||
else
|
else
|
||||||
TAG=$GITHUB_SHA
|
TAG=$GITHUB_SHA
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $OS =~ ^ubuntu.*$ && ! $TARGET =~ ^.*freebsd$ && ! $TARGET =~ ^loongarch.*$ && ! $TARGET =~ ^riscv64.*$ ]]; then
|
if [[ $OS =~ ^ubuntu.*$ && ! $TARGET =~ (loongarch|freebsd) ]]; then
|
||||||
UPX_VERSION=4.2.4
|
HOST_ARCH=$(uname -m)
|
||||||
curl -L https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-amd64_linux.tar.xz -s | tar xJvf -
|
case $HOST_ARCH in
|
||||||
cp upx-${UPX_VERSION}-amd64_linux/upx .
|
x86_64) UPX_ARCH="amd64" ;;
|
||||||
./upx --lzma --best ./target/$TARGET/release/easytier-core"$SUFFIX"
|
aarch64) UPX_ARCH="arm64" ;;
|
||||||
./upx --lzma --best ./target/$TARGET/release/easytier-cli"$SUFFIX"
|
*) UPX_ARCH="amd64" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
UPX_VERSION=5.1.1
|
||||||
|
UPX_PKG="upx-${UPX_VERSION}-${UPX_ARCH}_linux"
|
||||||
|
curl -L "https://github.com/upx/upx/releases/download/v${UPX_VERSION}/${UPX_PKG}.tar.xz" -s | tar xJvf -
|
||||||
|
cp "${UPX_PKG}/upx" .
|
||||||
|
UPX_BIN=./upx
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mv ./target/$TARGET/release/easytier-core"$SUFFIX" ./artifacts/objects/
|
for BIN in ./target/$TARGET/release/easytier-{core,cli,web,web-embed}"$SUFFIX"; do
|
||||||
mv ./target/$TARGET/release/easytier-cli"$SUFFIX" ./artifacts/objects/
|
if [[ -f "$BIN" ]]; then
|
||||||
if [[ ! $TARGET =~ ^mips.*$ ]]; then
|
if [[ -n "$UPX_BIN" ]]; then
|
||||||
mv ./target/$TARGET/release/easytier-web"$SUFFIX" ./artifacts/objects/
|
$UPX_BIN --lzma --best "$BIN" || true
|
||||||
mv ./target/$TARGET/release/easytier-web-embed"$SUFFIX" ./artifacts/objects/
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
mv "$BIN" ./artifacts/objects/
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
mv ./artifacts/objects/* ./artifacts/
|
mv ./artifacts/objects/* ./artifacts/
|
||||||
rm -rf ./artifacts/objects/
|
rm -rf ./artifacts/objects/
|
||||||
|
|
||||||
@@ -279,16 +252,7 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
./artifacts/*
|
./artifacts/*
|
||||||
|
|
||||||
core-result:
|
build_magisk:
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [ pre_job, build_web, build ]
|
|
||||||
if: needs.pre_job.result == 'success' && needs.pre_job.outputs.should_skip != 'true' && !cancelled()
|
|
||||||
steps:
|
|
||||||
- name: Mark result as failed
|
|
||||||
if: contains(needs.*.result, 'failure')
|
|
||||||
run: exit 1
|
|
||||||
|
|
||||||
magisk_build:
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ pre_job, build_web, build ]
|
needs: [ pre_job, build_web, build ]
|
||||||
if: needs.pre_job.result == 'success' && needs.pre_job.outputs.should_skip != 'true' && !cancelled()
|
if: needs.pre_job.result == 'success' && needs.pre_job.outputs.should_skip != 'true' && !cancelled()
|
||||||
@@ -311,7 +275,6 @@ jobs:
|
|||||||
cp ./downloaded-binaries/easytier-cli ./easytier-contrib/easytier-magisk/
|
cp ./downloaded-binaries/easytier-cli ./easytier-contrib/easytier-magisk/
|
||||||
cp ./downloaded-binaries/easytier-web ./easytier-contrib/easytier-magisk/
|
cp ./downloaded-binaries/easytier-web ./easytier-contrib/easytier-magisk/
|
||||||
|
|
||||||
|
|
||||||
# 上传生成的模块
|
# 上传生成的模块
|
||||||
- name: Upload Magisk Module
|
- name: Upload Magisk Module
|
||||||
uses: actions/upload-artifact@v5
|
uses: actions/upload-artifact@v5
|
||||||
@@ -322,3 +285,12 @@ jobs:
|
|||||||
!./easytier-contrib/easytier-magisk/build.sh
|
!./easytier-contrib/easytier-magisk/build.sh
|
||||||
!./easytier-contrib/easytier-magisk/magisk_update.json
|
!./easytier-contrib/easytier-magisk/magisk_update.json
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
core-result:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ pre_job, build_web, build, build_magisk ]
|
||||||
|
if: needs.pre_job.result == 'success' && needs.pre_job.outputs.should_skip != 'true' && !cancelled()
|
||||||
|
steps:
|
||||||
|
- name: Mark result as failed
|
||||||
|
if: contains(needs.*.result, 'failure')
|
||||||
|
run: exit 1
|
||||||
|
|||||||
+27
-78
@@ -35,20 +35,20 @@ jobs:
|
|||||||
concurrent_skipping: 'same_content_newer'
|
concurrent_skipping: 'same_content_newer'
|
||||||
skip_after_successful_duplicate: 'true'
|
skip_after_successful_duplicate: 'true'
|
||||||
cancel_others: 'true'
|
cancel_others: 'true'
|
||||||
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", "easytier-gui/**", ".github/workflows/gui.yml", ".github/workflows/install_rust.sh", ".github/workflows/install_gui_dep.sh", "easytier-web/frontend-lib/**"]'
|
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", "easytier-gui/**", ".github/workflows/gui.yml", ".github/actions/**", "easytier-web/frontend-lib/**"]'
|
||||||
build-gui:
|
build-gui:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- TARGET: aarch64-unknown-linux-musl
|
|
||||||
OS: ubuntu-22.04
|
|
||||||
GUI_TARGET: aarch64-unknown-linux-gnu
|
|
||||||
ARTIFACT_NAME: linux-aarch64
|
|
||||||
- TARGET: x86_64-unknown-linux-musl
|
- TARGET: x86_64-unknown-linux-musl
|
||||||
OS: ubuntu-22.04
|
OS: ubuntu-24.04
|
||||||
GUI_TARGET: x86_64-unknown-linux-gnu
|
GUI_TARGET: x86_64-unknown-linux-gnu
|
||||||
ARTIFACT_NAME: linux-x86_64
|
ARTIFACT_NAME: linux-x86_64
|
||||||
|
- TARGET: aarch64-unknown-linux-musl
|
||||||
|
OS: ubuntu-24.04-arm
|
||||||
|
GUI_TARGET: aarch64-unknown-linux-gnu
|
||||||
|
ARTIFACT_NAME: linux-aarch64
|
||||||
|
|
||||||
- TARGET: x86_64-apple-darwin
|
- TARGET: x86_64-apple-darwin
|
||||||
OS: macos-latest
|
OS: macos-latest
|
||||||
@@ -63,16 +63,14 @@ jobs:
|
|||||||
OS: windows-latest
|
OS: windows-latest
|
||||||
GUI_TARGET: x86_64-pc-windows-msvc
|
GUI_TARGET: x86_64-pc-windows-msvc
|
||||||
ARTIFACT_NAME: windows-x86_64
|
ARTIFACT_NAME: windows-x86_64
|
||||||
|
|
||||||
- TARGET: aarch64-pc-windows-msvc
|
|
||||||
OS: windows-latest
|
|
||||||
GUI_TARGET: aarch64-pc-windows-msvc
|
|
||||||
ARTIFACT_NAME: windows-arm64
|
|
||||||
|
|
||||||
- TARGET: i686-pc-windows-msvc
|
- TARGET: i686-pc-windows-msvc
|
||||||
OS: windows-latest
|
OS: windows-latest
|
||||||
GUI_TARGET: i686-pc-windows-msvc
|
GUI_TARGET: i686-pc-windows-msvc
|
||||||
ARTIFACT_NAME: windows-i686
|
ARTIFACT_NAME: windows-i686
|
||||||
|
- TARGET: aarch64-pc-windows-msvc
|
||||||
|
OS: windows-11-arm
|
||||||
|
GUI_TARGET: aarch64-pc-windows-msvc
|
||||||
|
ARTIFACT_NAME: windows-arm64
|
||||||
|
|
||||||
runs-on: ${{ matrix.OS }}
|
runs-on: ${{ matrix.OS }}
|
||||||
env:
|
env:
|
||||||
@@ -86,75 +84,29 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Install GUI dependencies (x86 only)
|
|
||||||
if: ${{ matrix.TARGET == 'x86_64-unknown-linux-musl' }}
|
|
||||||
run: bash ./.github/workflows/install_gui_dep.sh
|
|
||||||
|
|
||||||
- name: Install GUI cross compile (aarch64 only)
|
|
||||||
if: ${{ matrix.TARGET == 'aarch64-unknown-linux-musl' }}
|
|
||||||
run: |
|
|
||||||
# see https://tauri.app/v1/guides/building/linux/
|
|
||||||
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted" | sudo tee /etc/apt/sources.list
|
|
||||||
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy universe" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates universe" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy multiverse" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security main restricted" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security universe" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security multiverse" | sudo tee -a /etc/apt/sources.list
|
|
||||||
|
|
||||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy universe" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates universe" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy multiverse" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates multiverse" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security universe" | sudo tee -a /etc/apt/sources.list
|
|
||||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security multiverse" | sudo tee -a /etc/apt/sources.list
|
|
||||||
|
|
||||||
sudo dpkg --add-architecture arm64
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install aptitude
|
|
||||||
sudo aptitude install -y libgstreamer1.0-0:arm64 gstreamer1.0-plugins-base:arm64 gstreamer1.0-plugins-good:arm64 \
|
|
||||||
libgstreamer-gl1.0-0:arm64 libgstreamer-plugins-base1.0-0:arm64 libgstreamer-plugins-good1.0-0:arm64 libwebkit2gtk-4.1-0:arm64 \
|
|
||||||
libwebkit2gtk-4.1-dev:arm64 libssl-dev:arm64 gcc-aarch64-linux-gnu libsoup-3.0-dev:arm64 libjavascriptcoregtk-4.1-dev:arm64
|
|
||||||
echo "PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/" >> "$GITHUB_ENV"
|
|
||||||
echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig/" >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Install rpm package (Linux target only)
|
|
||||||
if: ${{ contains(matrix.TARGET, '-linux-') }}
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y rpm
|
|
||||||
|
|
||||||
- name: Set current ref as env variable
|
- name: Set current ref as env variable
|
||||||
run: |
|
run: |
|
||||||
echo "GIT_DESC=$(git log -1 --format=%cd.%h --date=format:%Y-%m-%d_%H:%M:%S)" >> $GITHUB_ENV
|
echo "GIT_DESC=$(git log -1 --format=%cd.%h --date=format:%Y-%m-%d_%H:%M:%S)" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Setup Frontend Environment
|
- name: Prepare build environment
|
||||||
uses: ./.github/actions/prepare-pnpm
|
uses: ./.github/actions/prepare-build
|
||||||
|
with:
|
||||||
|
target: ${{ matrix.TARGET }}
|
||||||
|
gui: true
|
||||||
|
pnpm: true
|
||||||
|
pnpm-build-filter: ''
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
# The prefix cache key, this can be changed to start a new cache manually.
|
# The prefix cache key, this can be changed to start a new cache manually.
|
||||||
# default: "v0-rust"
|
# default: "v0-rust"
|
||||||
prefix-key: ""
|
prefix-key: ""
|
||||||
|
shared-key: "gui-registry"
|
||||||
- name: Install rust target
|
cache-targets: "false"
|
||||||
run: bash ./.github/workflows/install_rust.sh
|
|
||||||
|
|
||||||
- name: Setup protoc
|
|
||||||
uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
# GitHub repo token to use to avoid rate limiter
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: copy correct DLLs
|
- name: copy correct DLLs
|
||||||
if: ${{ matrix.OS == 'windows-latest' }}
|
if: ${{ contains(matrix.GUI_TARGET, 'windows') }}
|
||||||
run: |
|
run: |
|
||||||
case $TARGET in
|
case $TARGET in
|
||||||
x86_64*) ARCH_DIR=x86_64 ;;
|
x86_64*) ARCH_DIR=x86_64 ;;
|
||||||
@@ -170,10 +122,9 @@ jobs:
|
|||||||
uses: tauri-apps/tauri-action@v0
|
uses: tauri-apps/tauri-action@v0
|
||||||
with:
|
with:
|
||||||
projectPath: ./easytier-gui
|
projectPath: ./easytier-gui
|
||||||
# https://tauri.app/v1/guides/building/linux/#cross-compiling-tauri-applications-for-arm-based-devices
|
args: --verbose --target ${{ matrix.GUI_TARGET }}
|
||||||
args: --verbose --target ${{ matrix.GUI_TARGET }} ${{ contains(matrix.TARGET, '-linux-') && contains(matrix.TARGET, 'aarch64') && '--bundles deb,rpm' || '' }}
|
|
||||||
|
|
||||||
- name: Compress
|
- name: Collect artifact
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ./artifacts/objects/
|
mkdir -p ./artifacts/objects/
|
||||||
|
|
||||||
@@ -182,19 +133,17 @@ jobs:
|
|||||||
else
|
else
|
||||||
TAG=$GITHUB_SHA
|
TAG=$GITHUB_SHA
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# copy gui bundle, gui is built without specific target
|
# copy gui bundle, gui is built without specific target
|
||||||
if [[ $OS =~ ^windows.*$ ]]; then
|
if [[ $GUI_TARGET =~ windows ]]; then
|
||||||
mv ./target/$GUI_TARGET/release/bundle/nsis/*.exe ./artifacts/objects/
|
mv ./target/$GUI_TARGET/release/bundle/nsis/*.exe ./artifacts/objects/
|
||||||
elif [[ $OS =~ ^macos.*$ ]]; then
|
elif [[ $GUI_TARGET =~ darwin ]]; then
|
||||||
mv ./target/$GUI_TARGET/release/bundle/dmg/*.dmg ./artifacts/objects/
|
mv ./target/$GUI_TARGET/release/bundle/dmg/*.dmg ./artifacts/objects/
|
||||||
elif [[ $OS =~ ^ubuntu.*$ && ! $TARGET =~ ^mips.*$ ]]; then
|
elif [[ $GUI_TARGET =~ linux ]]; then
|
||||||
mv ./target/$GUI_TARGET/release/bundle/deb/*.deb ./artifacts/objects/
|
mv ./target/$GUI_TARGET/release/bundle/deb/*.deb ./artifacts/objects/
|
||||||
mv ./target/$GUI_TARGET/release/bundle/rpm/*.rpm ./artifacts/objects/
|
mv ./target/$GUI_TARGET/release/bundle/rpm/*.rpm ./artifacts/objects/
|
||||||
if [[ $GUI_TARGET =~ ^x86_64.*$ ]]; then
|
|
||||||
# currently only x86 appimage is supported
|
|
||||||
mv ./target/$GUI_TARGET/release/bundle/appimage/*.AppImage ./artifacts/objects/
|
mv ./target/$GUI_TARGET/release/bundle/appimage/*.AppImage ./artifacts/objects/
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
mv ./artifacts/objects/* ./artifacts/
|
mv ./artifacts/objects/* ./artifacts/
|
||||||
rm -rf ./artifacts/objects/
|
rm -rf ./artifacts/objects/
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
sudo apt update
|
|
||||||
sudo apt install -qq libwebkit2gtk-4.1-dev \
|
|
||||||
build-essential \
|
|
||||||
curl \
|
|
||||||
wget \
|
|
||||||
file \
|
|
||||||
libgtk-3-dev \
|
|
||||||
librsvg2-dev \
|
|
||||||
libxdo-dev \
|
|
||||||
libssl-dev \
|
|
||||||
patchelf
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# env needed:
|
|
||||||
# - TARGET
|
|
||||||
# - GUI_TARGET
|
|
||||||
# - OS
|
|
||||||
|
|
||||||
# dependencies are only needed on ubuntu as that's the only place where
|
|
||||||
# we make cross-compilation
|
|
||||||
if [[ $OS =~ ^ubuntu.*$ ]]; then
|
|
||||||
sudo apt-get update && sudo apt-get install -qq musl-tools libappindicator3-dev llvm clang
|
|
||||||
# https://github.com/cross-tools/musl-cross/releases
|
|
||||||
# if "musl" is a substring of TARGET, we assume that we are using musl
|
|
||||||
MUSL_TARGET=$TARGET
|
|
||||||
# if target is mips or mipsel, we should use soft-float version of musl
|
|
||||||
if [[ $TARGET =~ ^mips.*$ || $TARGET =~ ^mipsel.*$ ]]; then
|
|
||||||
MUSL_TARGET=${TARGET}sf
|
|
||||||
elif [[ $TARGET =~ ^riscv64gc-.*$ ]]; then
|
|
||||||
MUSL_TARGET=${TARGET/#riscv64gc-/riscv64-}
|
|
||||||
fi
|
|
||||||
if [[ $MUSL_TARGET =~ musl ]]; then
|
|
||||||
mkdir -p ./musl_gcc
|
|
||||||
wget --inet4-only -c https://github.com/cross-tools/musl-cross/releases/download/20250520/${MUSL_TARGET}.tar.xz -P ./musl_gcc/
|
|
||||||
tar xf ./musl_gcc/${MUSL_TARGET}.tar.xz -C ./musl_gcc/
|
|
||||||
sudo ln -sf $(pwd)/musl_gcc/${MUSL_TARGET}/bin/*gcc /usr/bin/
|
|
||||||
sudo ln -sf $(pwd)/musl_gcc/${MUSL_TARGET}/include/ /usr/include/musl-cross
|
|
||||||
sudo ln -sf $(pwd)/musl_gcc/${MUSL_TARGET}/${MUSL_TARGET}/sysroot/ ./musl_gcc/sysroot
|
|
||||||
sudo chmod -R a+rwx ./musl_gcc
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# see https://github.com/rust-lang/rustup/issues/3709
|
|
||||||
rustup set auto-self-update disable
|
|
||||||
rustup install 1.93
|
|
||||||
rustup default 1.93
|
|
||||||
|
|
||||||
# mips/mipsel cannot add target from rustup, need compile by ourselves
|
|
||||||
if [[ $OS =~ ^ubuntu.*$ && $TARGET =~ ^mips.*$ ]]; then
|
|
||||||
cd "$PWD/musl_gcc/${MUSL_TARGET}/lib/gcc/${MUSL_TARGET}/15.1.0" || exit 255
|
|
||||||
# for panic-abort
|
|
||||||
cp libgcc_eh.a libunwind.a
|
|
||||||
|
|
||||||
# for mimalloc
|
|
||||||
ar x libgcc.a _ctzsi2.o _clz.o _bswapsi2.o
|
|
||||||
ar rcs libctz.a _ctzsi2.o _clz.o _bswapsi2.o
|
|
||||||
|
|
||||||
rustup toolchain install nightly-2026-02-02-x86_64-unknown-linux-gnu
|
|
||||||
rustup component add rust-src --toolchain nightly-2026-02-02-x86_64-unknown-linux-gnu
|
|
||||||
|
|
||||||
# https://github.com/rust-lang/rust/issues/128808
|
|
||||||
# remove it after Cargo or rustc fix this.
|
|
||||||
RUST_LIB_SRC=$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/
|
|
||||||
if [[ -f $RUST_LIB_SRC/library/Cargo.lock && ! -f $RUST_LIB_SRC/Cargo.lock ]]; then
|
|
||||||
cp -f $RUST_LIB_SRC/library/Cargo.lock $RUST_LIB_SRC/Cargo.lock
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
rustup target add $TARGET
|
|
||||||
if [[ $GUI_TARGET != '' ]]; then
|
|
||||||
rustup target add $GUI_TARGET
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
@@ -35,20 +35,25 @@ jobs:
|
|||||||
concurrent_skipping: 'same_content_newer'
|
concurrent_skipping: 'same_content_newer'
|
||||||
skip_after_successful_duplicate: 'true'
|
skip_after_successful_duplicate: 'true'
|
||||||
cancel_others: 'true'
|
cancel_others: 'true'
|
||||||
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", "easytier-gui/**", "tauri-plugin-vpnservice/**", ".github/workflows/mobile.yml", ".github/workflows/install_rust.sh"]'
|
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", "easytier-gui/**", "tauri-plugin-vpnservice/**", ".github/workflows/mobile.yml", ".github/actions/**"]'
|
||||||
build-mobile:
|
build-mobile:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- TARGET: android
|
- TARGET: aarch64-linux-android
|
||||||
OS: ubuntu-22.04
|
ARCH: aarch64
|
||||||
ARTIFACT_NAME: android
|
- TARGET: armv7-linux-androideabi
|
||||||
runs-on: ${{ matrix.OS }}
|
ARCH: armv7
|
||||||
|
- TARGET: i686-linux-android
|
||||||
|
ARCH: i686
|
||||||
|
- TARGET: x86_64-linux-android
|
||||||
|
ARCH: x86_64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
NAME: easytier
|
NAME: easytier
|
||||||
TARGET: ${{ matrix.TARGET }}
|
TARGET: ${{ matrix.TARGET }}
|
||||||
OS: ${{ matrix.OS }}
|
ARCH: ${{ matrix.ARCH }}
|
||||||
OSS_BUCKET: ${{ secrets.ALIYUN_OSS_BUCKET }}
|
OSS_BUCKET: ${{ secrets.ALIYUN_OSS_BUCKET }}
|
||||||
needs: pre_job
|
needs: pre_job
|
||||||
if: needs.pre_job.outputs.should_skip != 'true'
|
if: needs.pre_job.outputs.should_skip != 'true'
|
||||||
@@ -67,47 +72,41 @@ jobs:
|
|||||||
- name: Setup Android SDK
|
- name: Setup Android SDK
|
||||||
uses: android-actions/setup-android@v3
|
uses: android-actions/setup-android@v3
|
||||||
with:
|
with:
|
||||||
cmdline-tools-version: 11076708
|
cmdline-tools-version: 12.0
|
||||||
packages: 'build-tools;34.0.0 ndk;26.0.10792818 tools platform-tools platforms;android-34 '
|
packages: 'build-tools;34.0.0 ndk;26.0.10792818 platform-tools platforms;android-34 '
|
||||||
|
|
||||||
- name: Setup Android Environment
|
- name: Setup Android Environment
|
||||||
run: |
|
run: |
|
||||||
echo "$ANDROID_HOME/platform-tools" >> $GITHUB_PATH
|
echo "$ANDROID_HOME/platform-tools" >> $GITHUB_PATH
|
||||||
echo "$ANDROID_HOME/ndk/26.0.10792818/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
|
echo "$ANDROID_HOME/ndk/26.0.10792818/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
|
||||||
echo "NDK_HOME=$ANDROID_HOME/ndk/26.0.10792818/" > $GITHUB_ENV
|
echo "NDK_HOME=$ANDROID_HOME/ndk/26.0.10792818/" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Setup Frontend Environment
|
- name: Prepare build environment
|
||||||
uses: ./.github/actions/prepare-pnpm
|
uses: ./.github/actions/prepare-build
|
||||||
|
with:
|
||||||
|
target: ${{ matrix.TARGET }}
|
||||||
|
gui: false
|
||||||
|
pnpm: true
|
||||||
|
pnpm-build-filter: ''
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
# The prefix cache key, this can be changed to start a new cache manually.
|
# The prefix cache key, this can be changed to start a new cache manually.
|
||||||
# default: "v0-rust"
|
# default: "v0-rust"
|
||||||
prefix-key: ""
|
prefix-key: ""
|
||||||
|
shared-key: "gui-registry"
|
||||||
|
cache-targets: "false"
|
||||||
|
|
||||||
- name: Install rust target
|
- name: Build
|
||||||
run: |
|
|
||||||
bash ./.github/workflows/install_rust.sh
|
|
||||||
rustup target add aarch64-linux-android
|
|
||||||
rustup target add armv7-linux-androideabi
|
|
||||||
rustup target add i686-linux-android
|
|
||||||
rustup target add x86_64-linux-android
|
|
||||||
|
|
||||||
- name: Setup protoc
|
|
||||||
uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
# GitHub repo token to use to avoid rate limiter
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build Android
|
|
||||||
run: |
|
run: |
|
||||||
cd easytier-gui
|
cd easytier-gui
|
||||||
pnpm tauri android build
|
pnpm tauri android build --apk --target "$ARCH" --split-per-abi
|
||||||
|
|
||||||
- name: Compress
|
- name: Collect artifact
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ./artifacts/objects/
|
mkdir -p ./artifacts/objects/
|
||||||
mv easytier-gui/src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk ./artifacts/objects/
|
mv easytier-gui/src-tauri/gen/android/app/build/outputs/apk/*/release/*.apk ./artifacts/objects/
|
||||||
|
|
||||||
if [[ $GITHUB_REF_TYPE =~ ^tag$ ]]; then
|
if [[ $GITHUB_REF_TYPE =~ ^tag$ ]]; then
|
||||||
TAG=$GITHUB_REF_NAME
|
TAG=$GITHUB_REF_NAME
|
||||||
@@ -115,13 +114,13 @@ jobs:
|
|||||||
TAG=$GITHUB_SHA
|
TAG=$GITHUB_SHA
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mv ./artifacts/objects/* ./artifacts
|
mv ./artifacts/objects/* ./artifacts/
|
||||||
rm -rf ./artifacts/objects/
|
rm -rf ./artifacts/objects/
|
||||||
|
|
||||||
- name: Archive artifact
|
- name: Archive artifact
|
||||||
uses: actions/upload-artifact@v5
|
uses: actions/upload-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: easytier-gui-${{ matrix.ARTIFACT_NAME }}
|
name: easytier-mobile-android-${{ matrix.ARCH }}
|
||||||
path: |
|
path: |
|
||||||
./artifacts/*
|
./artifacts/*
|
||||||
|
|
||||||
|
|||||||
+26
-12
@@ -29,12 +29,21 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- name: fmt check
|
|
||||||
|
- name: Prepare build environment
|
||||||
|
uses: ./.github/actions/prepare-build
|
||||||
|
with:
|
||||||
|
gui: false
|
||||||
|
pnpm: false
|
||||||
|
|
||||||
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
components: rustfmt
|
||||||
|
|
||||||
|
- name: Check formatting
|
||||||
working-directory: ./easytier-contrib/easytier-ohrs
|
working-directory: ./easytier-contrib/easytier-ohrs
|
||||||
run: |
|
run: cargo fmt --all -- --check
|
||||||
bash ../../.github/workflows/install_rust.sh
|
|
||||||
rustup component add rustfmt
|
|
||||||
cargo fmt --all -- --check
|
|
||||||
pre_job:
|
pre_job:
|
||||||
# continue-on-error: true # Uncomment once integration is finished
|
# continue-on-error: true # Uncomment once integration is finished
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -51,7 +60,8 @@ jobs:
|
|||||||
concurrent_skipping: "same_content_newer"
|
concurrent_skipping: "same_content_newer"
|
||||||
skip_after_successful_duplicate: "true"
|
skip_after_successful_duplicate: "true"
|
||||||
cancel_others: "true"
|
cancel_others: "true"
|
||||||
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", "easytier-contrib/easytier-ohrs/**", ".github/workflows/ohos.yml", ".github/workflows/install_rust.sh"]'
|
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", "easytier-contrib/easytier-ohrs/**", ".github/workflows/ohos.yml", ".github/actions/**"]'
|
||||||
|
|
||||||
build-ohos:
|
build-ohos:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: pre_job
|
needs: pre_job
|
||||||
@@ -63,13 +73,12 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -qq \
|
||||||
build-essential \
|
build-essential \
|
||||||
wget \
|
wget \
|
||||||
unzip \
|
unzip \
|
||||||
git \
|
git \
|
||||||
pkg-config curl libgl1-mesa-dev expect
|
pkg-config curl libgl1-mesa-dev expect
|
||||||
sudo apt-get clean
|
|
||||||
|
|
||||||
- name: Resolve easytier version
|
- name: Resolve easytier version
|
||||||
run: |
|
run: |
|
||||||
@@ -141,6 +150,15 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "TARGET_ARCH=aarch64-linux-ohos" >> $GITHUB_ENV
|
echo "TARGET_ARCH=aarch64-linux-ohos" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
rustup install stable
|
||||||
|
rustup default stable
|
||||||
|
|
||||||
|
rustup target add aarch64-unknown-linux-ohos
|
||||||
|
|
||||||
|
- uses: taiki-e/install-action@v2
|
||||||
|
with:
|
||||||
|
tool: ohrs
|
||||||
|
|
||||||
- name: Create clang wrapper script
|
- name: Create clang wrapper script
|
||||||
run: |
|
run: |
|
||||||
sudo mkdir -p $OHOS_NDK_HOME/native/llvm
|
sudo mkdir -p $OHOS_NDK_HOME/native/llvm
|
||||||
@@ -159,11 +177,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y llvm clang lldb lld
|
sudo apt-get install -y llvm clang lldb lld
|
||||||
sudo apt-get install -y protobuf-compiler
|
sudo apt-get install -y protobuf-compiler
|
||||||
bash ../../.github/workflows/install_rust.sh
|
|
||||||
source env.sh
|
source env.sh
|
||||||
cargo install ohrs
|
|
||||||
rustup target add aarch64-unknown-linux-ohos
|
|
||||||
cargo update easytier
|
|
||||||
ohrs doctor
|
ohrs doctor
|
||||||
ohrs build --release --arch aarch
|
ohrs build --release --arch aarch
|
||||||
ohrs artifact
|
ohrs artifact
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ jobs:
|
|||||||
# All of these options are optional, so you can remove them if you are happy with the defaults
|
# All of these options are optional, so you can remove them if you are happy with the defaults
|
||||||
concurrent_skipping: 'never'
|
concurrent_skipping: 'never'
|
||||||
skip_after_successful_duplicate: 'true'
|
skip_after_successful_duplicate: 'true'
|
||||||
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", ".github/workflows/test.yml", ".github/workflows/install_gui_dep.sh", ".github/workflows/install_rust.sh"]'
|
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", ".github/workflows/test.yml", ".github/actions/**"]'
|
||||||
|
|
||||||
check:
|
check:
|
||||||
name: Run linters & check
|
name: Run linters & check
|
||||||
@@ -48,15 +48,12 @@ jobs:
|
|||||||
uses: ./.github/actions/prepare-build
|
uses: ./.github/actions/prepare-build
|
||||||
with:
|
with:
|
||||||
gui: true
|
gui: true
|
||||||
web: true
|
pnpm: true
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
- name: Install rustfmt and clippy
|
components: rustfmt,clippy
|
||||||
run: |
|
|
||||||
rustup component add rustfmt
|
|
||||||
rustup component add clippy
|
|
||||||
|
|
||||||
- uses: taiki-e/install-action@cargo-hack
|
- uses: taiki-e/install-action@cargo-hack
|
||||||
|
|
||||||
@@ -89,7 +86,7 @@ jobs:
|
|||||||
uses: ./.github/actions/prepare-build
|
uses: ./.github/actions/prepare-build
|
||||||
with:
|
with:
|
||||||
gui: true
|
gui: true
|
||||||
web: true
|
pnpm: true
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|||||||
Generated
+3
-3
@@ -5118,13 +5118,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "network-interface"
|
name = "network-interface"
|
||||||
version = "2.0.0"
|
version = "2.0.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "433419f898328beca4f2c6c73a1b52540658d92b0a99f0269330457e0fd998d5"
|
checksum = "4ddcb8865ad3d9950f22f42ffa0ef0aecbfbf191867b3122413602b0a360b2a6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"libc",
|
"libc",
|
||||||
"thiserror 1.0.63",
|
"thiserror 2.0.11",
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -11,15 +11,6 @@ edition.workspace = true
|
|||||||
name = "app_lib"
|
name = "app_lib"
|
||||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
tauri-build = { version = "2.0.0-rc", features = [] }
|
|
||||||
|
|
||||||
# enable thunk-rs when compiling for x86_64 or i686 windows
|
|
||||||
[target.x86_64-pc-windows-msvc.build-dependencies]
|
|
||||||
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = ["win7"] }
|
|
||||||
|
|
||||||
[target.i686-pc-windows-msvc.build-dependencies]
|
|
||||||
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = ["win7"] }
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# wry 0.47 may crash on android, see https://github.com/EasyTier/EasyTier/issues/527
|
# wry 0.47 may crash on android, see https://github.com/EasyTier/EasyTier/issues/527
|
||||||
@@ -66,6 +57,14 @@ libc = "0.2"
|
|||||||
[target.'cfg(target_os = "macos")'.dependencies]
|
[target.'cfg(target_os = "macos")'.dependencies]
|
||||||
security-framework-sys = "2.9.0"
|
security-framework-sys = "2.9.0"
|
||||||
|
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
tauri-build = { version = "2.0.0-rc", features = [] }
|
||||||
|
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = [
|
||||||
|
"win7",
|
||||||
|
] }
|
||||||
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!!
|
# This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!!
|
||||||
custom-protocol = ["tauri/custom-protocol"]
|
custom-protocol = ["tauri/custom-protocol"]
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
|
use std::env;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
|
||||||
|
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default();
|
||||||
// enable thunk-rs when target os is windows and arch is x86_64 or i686
|
// enable thunk-rs when target os is windows and arch is x86_64 or i686
|
||||||
#[cfg(target_os = "windows")]
|
if target_os == "windows" && (target_arch == "x86" || target_arch == "x86_64") {
|
||||||
if !std::env::var("TARGET")
|
|
||||||
.unwrap_or_default()
|
|
||||||
.contains("aarch64")
|
|
||||||
{
|
|
||||||
thunk::thunk();
|
thunk::thunk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,13 +69,11 @@ subtle = "2.6"
|
|||||||
|
|
||||||
mimalloc = { version = "*" }
|
mimalloc = { version = "*" }
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = [
|
||||||
|
"win7",
|
||||||
|
] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
embed = ["dep:axum-embed"]
|
embed = ["dep:axum-embed"]
|
||||||
|
|
||||||
# enable thunk-rs when compiling for x86_64 or i686 windows
|
|
||||||
[target.x86_64-pc-windows-msvc.build-dependencies]
|
|
||||||
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = ["win7"] }
|
|
||||||
|
|
||||||
[target.i686-pc-windows-msvc.build-dependencies]
|
|
||||||
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = ["win7"] }
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
|
use std::env;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
|
||||||
|
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default();
|
||||||
// enable thunk-rs when target os is windows and arch is x86_64 or i686
|
// enable thunk-rs when target os is windows and arch is x86_64 or i686
|
||||||
#[cfg(target_os = "windows")]
|
if target_os == "windows" && (target_arch == "x86" || target_arch == "x86_64") {
|
||||||
if !std::env::var("TARGET")
|
|
||||||
.unwrap_or_default()
|
|
||||||
.contains("aarch64")
|
|
||||||
{
|
|
||||||
thunk::thunk();
|
thunk::thunk();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-11
@@ -324,22 +324,14 @@ easytier-rpc-build = { path = "../easytier-rpc-build", features = [
|
|||||||
"internal-namespace",
|
"internal-namespace",
|
||||||
] }
|
] }
|
||||||
prost-reflect-build = { version = "0.14.0" }
|
prost-reflect-build = { version = "0.14.0" }
|
||||||
|
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = [
|
||||||
|
"win7",
|
||||||
|
] }
|
||||||
|
|
||||||
[target.'cfg(windows)'.build-dependencies]
|
[target.'cfg(windows)'.build-dependencies]
|
||||||
reqwest = { version = "0.12.12", features = ["blocking"] }
|
reqwest = { version = "0.12.12", features = ["blocking"] }
|
||||||
zip = "4.0.0"
|
zip = "4.0.0"
|
||||||
|
|
||||||
# enable thunk-rs when compiling for x86_64 or i686 windows
|
|
||||||
[target.x86_64-pc-windows-msvc.build-dependencies]
|
|
||||||
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = [
|
|
||||||
"win7",
|
|
||||||
] }
|
|
||||||
|
|
||||||
[target.i686-pc-windows-msvc.build-dependencies]
|
|
||||||
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = [
|
|
||||||
"win7",
|
|
||||||
] }
|
|
||||||
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serial_test = "3.0.0"
|
serial_test = "3.0.0"
|
||||||
|
|||||||
+3
-5
@@ -143,12 +143,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
|
||||||
|
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default();
|
||||||
// enable thunk-rs when target os is windows and arch is x86_64 or i686
|
// enable thunk-rs when target os is windows and arch is x86_64 or i686
|
||||||
#[cfg(target_os = "windows")]
|
if target_os == "windows" && (target_arch == "x86" || target_arch == "x86_64") {
|
||||||
if !std::env::var("TARGET")
|
|
||||||
.unwrap_or_default()
|
|
||||||
.contains("aarch64")
|
|
||||||
{
|
|
||||||
thunk::thunk();
|
thunk::thunk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user