mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-06 17:59:11 +00:00
+62
-30
@@ -32,12 +32,14 @@ jobs:
|
|||||||
- TARGET: mipsel-unknown-linux-musl
|
- TARGET: mipsel-unknown-linux-musl
|
||||||
OS: ubuntu-latest
|
OS: ubuntu-latest
|
||||||
GUI_TARGET:
|
GUI_TARGET:
|
||||||
|
|
||||||
- TARGET: x86_64-apple-darwin
|
- TARGET: x86_64-apple-darwin
|
||||||
OS: macos-latest
|
OS: macos-latest
|
||||||
GUI_TARGET: x86_64-apple-darwin
|
GUI_TARGET: x86_64-apple-darwin
|
||||||
- TARGET: aarch64-apple-darwin
|
- TARGET: aarch64-apple-darwin
|
||||||
OS: macos-latest
|
OS: macos-latest
|
||||||
GUI_TARGET: aarch64-apple-darwin
|
GUI_TARGET: aarch64-apple-darwin
|
||||||
|
|
||||||
- TARGET: x86_64-pc-windows-msvc
|
- TARGET: x86_64-pc-windows-msvc
|
||||||
OS: windows-latest
|
OS: windows-latest
|
||||||
GUI_TARGET: x86_64-pc-windows-msvc
|
GUI_TARGET: x86_64-pc-windows-msvc
|
||||||
@@ -50,25 +52,43 @@ jobs:
|
|||||||
OSS_BUCKET: ${{ secrets.ALIYUN_OSS_BUCKET }}
|
OSS_BUCKET: ${{ secrets.ALIYUN_OSS_BUCKET }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Setup protoc
|
|
||||||
uses: arduino/setup-protoc@v2
|
|
||||||
with:
|
|
||||||
# GitHub repo token to use to avoid rate limiter
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 21
|
node-version: 21
|
||||||
cache: 'yarn'
|
|
||||||
cache-dependency-path: easytier-gui/yarn.lock
|
- name: Install pnpm
|
||||||
- name: Install Yarn
|
uses: pnpm/action-setup@v3
|
||||||
run: npm install -g yarn
|
with:
|
||||||
|
version: 9
|
||||||
|
run_install: false
|
||||||
|
|
||||||
|
- name: Get pnpm store directory
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Setup pnpm cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.STORE_PATH }}
|
||||||
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pnpm-store-
|
||||||
|
|
||||||
|
- name: Install frontend dependencies
|
||||||
|
run: |
|
||||||
|
cd easytier-gui
|
||||||
|
pnpm install
|
||||||
|
|
||||||
- name: Cargo cache
|
- name: Cargo cache
|
||||||
uses: actions/cache@v4.0.0
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo
|
~/.cargo
|
||||||
./target
|
./target
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Install rust target
|
- name: Install rust target
|
||||||
run: |
|
run: |
|
||||||
# dependencies are only needed on ubuntu as that's the only place where
|
# dependencies are only needed on ubuntu as that's the only place where
|
||||||
@@ -76,6 +96,7 @@ jobs:
|
|||||||
if [[ $OS =~ ^ubuntu.*$ ]]; then
|
if [[ $OS =~ ^ubuntu.*$ ]]; then
|
||||||
sudo apt-get update && sudo apt-get install -qq crossbuild-essential-arm64 crossbuild-essential-armhf musl-tools
|
sudo apt-get update && sudo apt-get install -qq crossbuild-essential-arm64 crossbuild-essential-armhf musl-tools
|
||||||
# for easytier-gui
|
# for easytier-gui
|
||||||
|
if [[ $GUI_TARGET != '' ]]; then
|
||||||
sudo apt install libwebkit2gtk-4.0-dev \
|
sudo apt install libwebkit2gtk-4.0-dev \
|
||||||
build-essential \
|
build-essential \
|
||||||
curl \
|
curl \
|
||||||
@@ -84,7 +105,9 @@ jobs:
|
|||||||
libssl-dev \
|
libssl-dev \
|
||||||
libgtk-3-dev \
|
libgtk-3-dev \
|
||||||
libayatana-appindicator3-dev \
|
libayatana-appindicator3-dev \
|
||||||
librsvg2-dev
|
librsvg2-dev \
|
||||||
|
patchelf
|
||||||
|
fi
|
||||||
# curl -s musl.cc | grep mipsel
|
# curl -s musl.cc | grep mipsel
|
||||||
case $TARGET in
|
case $TARGET in
|
||||||
mipsel-unknown-linux-musl)
|
mipsel-unknown-linux-musl)
|
||||||
@@ -134,18 +157,25 @@ jobs:
|
|||||||
rustup target add $TARGET
|
rustup target add $TARGET
|
||||||
rustup target add $GUI_TARGET
|
rustup target add $GUI_TARGET
|
||||||
fi
|
fi
|
||||||
- name: Run build
|
|
||||||
|
- name: Setup protoc
|
||||||
|
uses: arduino/setup-protoc@v2
|
||||||
|
with:
|
||||||
|
# GitHub repo token to use to avoid rate limiter
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build Core & Cli
|
||||||
run: |
|
run: |
|
||||||
if [[ $OS =~ ^ubuntu.*$ && $TARGET =~ ^mips.*$ ]]; then
|
if [[ $OS =~ ^ubuntu.*$ && $TARGET =~ ^mips.*$ ]]; then
|
||||||
cargo +nightly build -r --verbose --target $TARGET -Z build-std --no-default-features --features mips
|
cargo +nightly build -r --verbose --target $TARGET -Z build-std --no-default-features --features mips
|
||||||
else
|
else
|
||||||
cargo build --release --verbose --target $TARGET
|
cargo build --release --verbose --target $TARGET
|
||||||
fi
|
fi
|
||||||
- name: Install for aarch64 gui cross compile
|
|
||||||
|
- name: Install GUI cross compile (aarch64 only)
|
||||||
|
if: ${{ matrix.TARGET == 'aarch64-unknown-linux-musl' }}
|
||||||
run: |
|
run: |
|
||||||
# see https://tauri.app/v1/guides/building/linux/
|
# see https://tauri.app/v1/guides/building/linux/
|
||||||
if [[ $TARGET == "aarch64-unknown-linux-musl" ]]; then
|
|
||||||
|
|
||||||
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 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-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 universe" | sudo tee -a /etc/apt/sources.list
|
||||||
@@ -173,20 +203,15 @@ jobs:
|
|||||||
sudo apt install libwebkit2gtk-4.0-dev:arm64
|
sudo apt install libwebkit2gtk-4.0-dev:arm64
|
||||||
sudo apt install libssl-dev:arm64
|
sudo apt install libssl-dev:arm64
|
||||||
echo "PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/" >> "$GITHUB_ENV"
|
echo "PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/" >> "$GITHUB_ENV"
|
||||||
fi
|
|
||||||
- name: Run build GUI
|
- name: Build GUI
|
||||||
run: |
|
if: ${{ matrix.GUI_TARGET != '' }}
|
||||||
if [ ! -n "$GUI_TARGET" ]; then
|
uses: tauri-apps/tauri-action@v0
|
||||||
exit 0
|
with:
|
||||||
fi
|
projectPath: ./easytier-gui
|
||||||
cd easytier-gui
|
# https://tauri.app/v1/guides/building/linux/#cross-compiling-tauri-applications-for-arm-based-devices
|
||||||
yarn install
|
args: --verbose --target ${{ matrix.GUI_TARGET }} ${{ matrix.OS == 'ubuntu-latest' && contains(matrix.TARGET, 'aarch64') && '--bundles deb' || '' }}
|
||||||
if [[ $OS =~ ^ubuntu.*$ && ! $GUI_TARGET =~ ^x86_64.*$ ]]; then
|
|
||||||
# only build deb for non-x86_64 linux
|
|
||||||
yarn tauri build -- --target $GUI_TARGET --verbose --bundles deb
|
|
||||||
else
|
|
||||||
yarn tauri build -- --target $GUI_TARGET --verbose
|
|
||||||
fi
|
|
||||||
- name: Compress
|
- name: Compress
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ./artifacts/objects/
|
mkdir -p ./artifacts/objects/
|
||||||
@@ -219,12 +244,14 @@ jobs:
|
|||||||
|
|
||||||
tar -cvf ./artifacts/$NAME-$TARGET-$TAG.tar -C ./artifacts/objects/ .
|
tar -cvf ./artifacts/$NAME-$TARGET-$TAG.tar -C ./artifacts/objects/ .
|
||||||
rm -rf ./artifacts/objects/
|
rm -rf ./artifacts/objects/
|
||||||
|
|
||||||
- name: Archive artifact
|
- name: Archive artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: easytier-${{ matrix.OS }}-${{ matrix.TARGET }}
|
name: easytier-${{ matrix.OS }}-${{ matrix.TARGET }}
|
||||||
path: |
|
path: |
|
||||||
./artifacts/*
|
./artifacts/*
|
||||||
|
|
||||||
- name: Upload OSS
|
- name: Upload OSS
|
||||||
if: ${{ env.OSS_BUCKET != '' }}
|
if: ${{ env.OSS_BUCKET != '' }}
|
||||||
uses: Menci/upload-to-oss@main
|
uses: Menci/upload-to-oss@main
|
||||||
@@ -241,26 +268,31 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup protoc
|
- name: Setup protoc
|
||||||
uses: arduino/setup-protoc@v2
|
uses: arduino/setup-protoc@v2
|
||||||
with:
|
with:
|
||||||
# GitHub repo token to use to avoid rate limiter
|
# GitHub repo token to use to avoid rate limiter
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Setup tools for test
|
- name: Setup tools for test
|
||||||
run: sudo apt install bridge-utils
|
run: sudo apt install bridge-utils
|
||||||
|
|
||||||
- name: Setup system for test
|
- name: Setup system for test
|
||||||
run: |
|
run: |
|
||||||
sudo sysctl net.bridge.bridge-nf-call-iptables=0
|
sudo sysctl net.bridge.bridge-nf-call-iptables=0
|
||||||
sudo sysctl net.bridge.bridge-nf-call-ip6tables=0
|
sudo sysctl net.bridge.bridge-nf-call-ip6tables=0
|
||||||
sudo sysctl net.ipv6.conf.lo.disable_ipv6=0
|
sudo sysctl net.ipv6.conf.lo.disable_ipv6=0
|
||||||
sudo ip addr add 2001:db8::2/64 dev lo
|
sudo ip addr add 2001:db8::2/64 dev lo
|
||||||
|
|
||||||
- name: Cargo cache
|
- name: Cargo cache
|
||||||
uses: actions/cache@v4.0.0
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo
|
~/.cargo
|
||||||
./target
|
./target
|
||||||
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
sudo -E env "PATH=$PATH" cargo test --verbose
|
sudo -E env "PATH=$PATH" cargo test --verbose
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
shamefully-hoist=true
|
||||||
|
strict-peer-dependencies=false
|
||||||
Generated
+2004
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "yarn dev",
|
"beforeDevCommand": "pnpm dev",
|
||||||
"beforeBuildCommand": "yarn build",
|
"beforeBuildCommand": "pnpm build",
|
||||||
"devPath": "http://localhost:1420",
|
"devPath": "http://localhost:1420",
|
||||||
"distDir": "../dist"
|
"distDir": "../dist"
|
||||||
},
|
},
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user