mirror of
https://github.com/oneclickvirt/ecs.git
synced 2025-09-28 04:02:12 +08:00
Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
63658bb2dc | ||
![]() |
b1a8368af3 | ||
![]() |
df6d1236cc | ||
![]() |
7c64102581 | ||
![]() |
58cb4f3831 | ||
![]() |
20bddae048 | ||
![]() |
3c0590ca8d | ||
![]() |
a752eeeeb0 | ||
![]() |
630a28f2f2 | ||
![]() |
cfd70e100b | ||
![]() |
9114f5b97a | ||
![]() |
8c0fc16384 | ||
![]() |
2ded570639 | ||
![]() |
42f0cb3399 | ||
![]() |
14adbddeb9 | ||
![]() |
27fd06b007 | ||
![]() |
88db8df827 | ||
![]() |
ec728796f4 | ||
![]() |
147e8c1113 | ||
![]() |
b9b1d5ca76 | ||
![]() |
1500c8342e | ||
![]() |
e523ca3c84 | ||
![]() |
42943370bb | ||
![]() |
7339f0336c | ||
![]() |
54bbe16563 |
132
.github/workflows/build.yaml
vendored
Normal file
132
.github/workflows/build.yaml
vendored
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
name: Goreleaser
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
tags:
|
||||||
|
- "v*.*.*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
goreleaser:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
# 1.20 是 Windows 7/8 Server 2008/2012 最后一个支持版本
|
||||||
|
image: goreleaser/goreleaser-cross:v1.20
|
||||||
|
steps:
|
||||||
|
- name: Configure git safe directory
|
||||||
|
run: |
|
||||||
|
git config --global --add safe.directory /__w/ecs/ecs
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: 1.23.4
|
||||||
|
|
||||||
|
- name: Configure Git for Private Modules
|
||||||
|
run: |
|
||||||
|
git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
|
||||||
|
git config --global url."git@github.com:".insteadOf "https://github.com/"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GHT }}
|
||||||
|
|
||||||
|
- name: Install missing cross-compilation tools
|
||||||
|
run: |
|
||||||
|
echo "Installing missing cross-compilation tools..."
|
||||||
|
apt-get update
|
||||||
|
PACKAGES=(
|
||||||
|
gcc-multilib
|
||||||
|
g++-multilib
|
||||||
|
linux-libc-dev
|
||||||
|
linux-libc-dev:i386
|
||||||
|
libc6-dev-i386
|
||||||
|
libc6-dev-i386-cross
|
||||||
|
gcc-aarch64-linux-gnu
|
||||||
|
gcc-riscv64-linux-gnu
|
||||||
|
gcc-mips64-linux-gnuabi64
|
||||||
|
gcc-mips64el-linux-gnuabi64
|
||||||
|
gcc-powerpc64le-linux-gnu
|
||||||
|
gcc-mingw-w64-x86-64
|
||||||
|
gcc-mingw-w64-i686
|
||||||
|
libc6-dev-amd64-cross
|
||||||
|
libc6-dev-arm64-cross
|
||||||
|
libc6-dev-riscv64-cross
|
||||||
|
libc6-dev-mips64-cross
|
||||||
|
libc6-dev-mips64el-cross
|
||||||
|
libc6-dev-ppc64el-cross
|
||||||
|
)
|
||||||
|
for pkg in "${PACKAGES[@]}"; do
|
||||||
|
echo "Installing $pkg..."
|
||||||
|
apt-get install -y "$pkg" || echo "Failed to install $pkg, continuing..."
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Verify cross-compilation tools
|
||||||
|
run: |
|
||||||
|
echo "Checking available cross-compilation tools..."
|
||||||
|
echo "=== GCC compilers ==="
|
||||||
|
which gcc || echo "gcc not found"
|
||||||
|
which x86_64-linux-gnu-gcc || echo "x86_64-linux-gnu-gcc not found"
|
||||||
|
which aarch64-linux-gnu-gcc || echo "aarch64-linux-gnu-gcc not found"
|
||||||
|
which riscv64-linux-gnu-gcc || echo "riscv64-linux-gnu-gcc not found"
|
||||||
|
which mips64-linux-gnuabi64-gcc || echo "mips64-linux-gnuabi64-gcc not found"
|
||||||
|
which mips64el-linux-gnuabi64-gcc || echo "mips64el-linux-gnuabi64-gcc not found"
|
||||||
|
which powerpc64le-linux-gnu-gcc || echo "powerpc64le-linux-gnu-gcc not found"
|
||||||
|
echo "=== MinGW compilers ==="
|
||||||
|
which x86_64-w64-mingw32-gcc || echo "x86_64-w64-mingw32-gcc not found"
|
||||||
|
which i686-w64-mingw32-gcc || echo "i686-w64-mingw32-gcc not found"
|
||||||
|
echo "=== OSXCross compilers ==="
|
||||||
|
which o64-clang || echo "o64-clang not found"
|
||||||
|
which oa64-clang || echo "oa64-clang not found"
|
||||||
|
which o64-clang++ || echo "o64-clang++ not found"
|
||||||
|
which oa64-clang++ || echo "oa64-clang++ not found"
|
||||||
|
echo "=== Clang compilers ==="
|
||||||
|
which clang || echo "clang not found"
|
||||||
|
echo "=== Available gcc binaries ==="
|
||||||
|
ls -la /usr/bin/*gcc* | head -20
|
||||||
|
echo "=== Available clang binaries ==="
|
||||||
|
ls -la /usr/bin/*clang* | head -10
|
||||||
|
echo "=== OSXCross directory ==="
|
||||||
|
ls -la /usr/osxcross/bin/ 2>/dev/null || echo "OSXCross not found in /usr/osxcross/bin/"
|
||||||
|
|
||||||
|
- name: Run GoReleaser
|
||||||
|
uses: goreleaser/goreleaser-action@v6
|
||||||
|
with:
|
||||||
|
distribution: goreleaser
|
||||||
|
version: latest
|
||||||
|
args: release --parallelism 1 --verbose
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GHT }}
|
||||||
|
GOPRIVATE: github.com/oneclickvirt/security
|
||||||
|
|
||||||
|
- name: Update goecs.sh with new version
|
||||||
|
run: |
|
||||||
|
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
|
||||||
|
VERSION="${GITHUB_REF#refs/tags/v}"
|
||||||
|
else
|
||||||
|
VERSION=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.1.37")
|
||||||
|
fi
|
||||||
|
echo "Using version: $VERSION"
|
||||||
|
FILE="goecs.sh"
|
||||||
|
BRANCH="master"
|
||||||
|
git config --global user.name "github-actions[bot]"
|
||||||
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --global --unset url."git@github.com:".insteadOf || true
|
||||||
|
git fetch origin $BRANCH
|
||||||
|
git checkout $BRANCH
|
||||||
|
if [ ! -f "$FILE" ]; then
|
||||||
|
echo "Error: $FILE not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sed -i "s/\(_yellow \"Unable to get version info, using default version \).*\(\".*\)/\1$VERSION\2/" "$FILE"
|
||||||
|
sed -i "s/\(ECS_VERSION=\"\).*\(\"\)/\1$VERSION\2/" "$FILE"
|
||||||
|
if git diff --quiet "$FILE"; then
|
||||||
|
echo "No changes detected in $FILE"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
git add "$FILE"
|
||||||
|
git commit -m "chore: update ECS_VERSION to $VERSION in goecs.sh"
|
||||||
|
git push origin $BRANCH
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GHT }}
|
73
.github/workflows/main.yaml
vendored
73
.github/workflows/main.yaml
vendored
@@ -1,73 +0,0 @@
|
|||||||
name: goreleaser
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
tags:
|
|
||||||
- "v*.*.*"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
goreleaser:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
# 1.20 是 Windows 7/8 Server 2008/2012 最后一个支持版本
|
|
||||||
image: goreleaser/goreleaser-cross:v1.20
|
|
||||||
steps:
|
|
||||||
- run: |
|
|
||||||
git config --global --add safe.directory /__w/ecs/ecs
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v4
|
|
||||||
with:
|
|
||||||
go-version: 1.23.4
|
|
||||||
|
|
||||||
- name: Configure Git for Private Modules
|
|
||||||
run: |
|
|
||||||
git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
|
|
||||||
git config --global url."git@github.com:".insteadOf "https://github.com/"
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GHT }}
|
|
||||||
|
|
||||||
- name: Run GoReleaser
|
|
||||||
uses: goreleaser/goreleaser-action@v2
|
|
||||||
with:
|
|
||||||
distribution: goreleaser
|
|
||||||
version: latest
|
|
||||||
args: release
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GHT }}
|
|
||||||
GOPRIVATE: github.com/oneclickvirt/security
|
|
||||||
|
|
||||||
- name: Update goecs.sh with new version
|
|
||||||
run: |
|
|
||||||
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
|
|
||||||
VERSION="${GITHUB_REF#refs/tags/v}"
|
|
||||||
else
|
|
||||||
VERSION=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.1.37")
|
|
||||||
fi
|
|
||||||
echo "Using version: $VERSION"
|
|
||||||
FILE="goecs.sh"
|
|
||||||
BRANCH="master"
|
|
||||||
git config --global user.name "github-actions[bot]"
|
|
||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config --global --unset url."git@github.com:".insteadOf || true
|
|
||||||
git fetch origin $BRANCH
|
|
||||||
git checkout $BRANCH
|
|
||||||
if [ ! -f "$FILE" ]; then
|
|
||||||
echo "Error: $FILE not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
sed -i "s/\(_yellow \"Unable to get version info, using default version \).*\(\".*\)/\1$VERSION\2/" "$FILE"
|
|
||||||
sed -i "s/\(ECS_VERSION=\"\).*\(\"\)/\1$VERSION\2/" "$FILE"
|
|
||||||
if git diff --quiet "$FILE"; then
|
|
||||||
echo "No changes detected in $FILE"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
git add "$FILE"
|
|
||||||
git commit -m "chore: update ECS_VERSION to $VERSION in goecs.sh"
|
|
||||||
git push origin $BRANCH
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GHT }}
|
|
482
.goreleaser.yaml
482
.goreleaser.yaml
@@ -1,39 +1,144 @@
|
|||||||
|
version: 2
|
||||||
|
project_name: goecs
|
||||||
|
|
||||||
|
env:
|
||||||
|
- GO111MODULE=on
|
||||||
|
|
||||||
before:
|
before:
|
||||||
hooks:
|
hooks:
|
||||||
- go mod tidy -v
|
- go mod tidy -v
|
||||||
|
|
||||||
builds:
|
builds:
|
||||||
- id: universal
|
# Linux AMD64 with CGO
|
||||||
|
- id: linux-amd64-cgo
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=1
|
||||||
|
- CC=x86_64-linux-gnu-gcc
|
||||||
|
- CGO_CFLAGS=-O2 -static -fno-stack-protector
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
|
||||||
flags:
|
flags:
|
||||||
- -trimpath
|
- -trimpath
|
||||||
goos:
|
goos:
|
||||||
- linux
|
- linux
|
||||||
- windows
|
|
||||||
- freebsd
|
|
||||||
goarch:
|
goarch:
|
||||||
- arm
|
|
||||||
- arm64
|
|
||||||
- 386
|
|
||||||
- amd64
|
- amd64
|
||||||
- mips
|
|
||||||
- mipsle
|
|
||||||
- s390x
|
|
||||||
- riscv64
|
|
||||||
gomips:
|
|
||||||
- softfloat
|
|
||||||
ignore:
|
|
||||||
- goos: windows
|
|
||||||
goarch: arm
|
|
||||||
main: ./
|
main: ./
|
||||||
binary: goecs
|
binary: goecs
|
||||||
- id: darwin-amd64
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for linux/amd64 (CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built linux/amd64 (CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Linux 386 with CGO - 修复了编译器和标志
|
||||||
|
- id: linux-386-cgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=1
|
||||||
|
- CC=gcc
|
||||||
|
- CGO_CFLAGS=-m32 -O1 -march=i686 -mtune=generic -fno-stack-protector
|
||||||
|
- CGO_LDFLAGS=-m32
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags="-m32 -static"
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- 386
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for linux/386 (CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built linux/386 (CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Linux ARM64 with CGO
|
||||||
|
- id: linux-arm64-cgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=1
|
||||||
|
- CC=aarch64-linux-gnu-gcc
|
||||||
|
- CGO_CFLAGS=-O1 -fno-stack-protector
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- arm64
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for linux/arm64 (CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built linux/arm64 (CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Windows AMD64 with CGO
|
||||||
|
- id: windows-amd64-cgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=1
|
||||||
|
- CC=x86_64-w64-mingw32-gcc
|
||||||
|
- CGO_CFLAGS=-O2 -static-libgcc -static-libstdc++
|
||||||
|
- CGO_LDFLAGS=-static-libgcc -static-libstdc++
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- windows
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for windows/amd64 (CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built windows/amd64 (CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Windows 386 with CGO - 修复了编译器名称
|
||||||
|
- id: windows-386-cgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=1
|
||||||
|
- CC=i686-w64-mingw32-gcc
|
||||||
|
- CGO_CFLAGS=-O2 -static-libgcc -static-libstdc++
|
||||||
|
- CGO_LDFLAGS=-static-libgcc -static-libstdc++
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- windows
|
||||||
|
goarch:
|
||||||
|
- 386
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for windows/386 (CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built windows/386 (CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Darwin AMD64 with CGO
|
||||||
|
- id: darwin-amd64-cgo
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=1
|
- CGO_ENABLED=1
|
||||||
- CC=o64-clang
|
- CC=o64-clang
|
||||||
- CXX=o64-clang++
|
- CGO_CFLAGS=-O2 -arch x86_64 -mmacosx-version-min=10.12
|
||||||
|
- CGO_LDFLAGS=-arch x86_64 -mmacosx-version-min=10.12
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
flags:
|
flags:
|
||||||
@@ -44,11 +149,24 @@ builds:
|
|||||||
- amd64
|
- amd64
|
||||||
main: ./
|
main: ./
|
||||||
binary: goecs
|
binary: goecs
|
||||||
- id: darwin-arm64
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for darwin/amd64 (CGO)"
|
||||||
|
- echo "Checking osxcross tools..."
|
||||||
|
- which o64-clang || echo "o64-clang not found"
|
||||||
|
- which o64-clang++ || echo "o64-clang++ not found"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built darwin/amd64 (CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Darwin ARM64 with CGO
|
||||||
|
- id: darwin-arm64-cgo
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=1
|
- CGO_ENABLED=1
|
||||||
- CC=oa64-clang
|
- CC=oa64-clang
|
||||||
- CXX=oa64-clang++
|
- CGO_CFLAGS=-O2 -arch arm64 -mmacosx-version-min=11.0
|
||||||
|
- CGO_LDFLAGS=-arch arm64 -mmacosx-version-min=11.0
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
flags:
|
flags:
|
||||||
@@ -59,18 +177,338 @@ builds:
|
|||||||
- arm64
|
- arm64
|
||||||
main: ./
|
main: ./
|
||||||
binary: goecs
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for darwin/arm64 (CGO)"
|
||||||
|
- echo "Checking osxcross tools..."
|
||||||
|
- which oa64-clang || echo "oa64-clang not found"
|
||||||
|
- which oa64-clang++ || echo "oa64-clang++ not found"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built darwin/arm64 (CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Linux RISC-V 64 with CGO
|
||||||
|
- id: linux-riscv64-cgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=1
|
||||||
|
- CC=riscv64-linux-gnu-gcc
|
||||||
|
- CGO_CFLAGS=-O1 -fno-stack-protector
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- riscv64
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for linux/riscv64 (CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built linux/riscv64 (CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Linux MIPS64 with CGO
|
||||||
|
- id: linux-mips64-cgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=1
|
||||||
|
- CC=mips64-linux-gnuabi64-gcc
|
||||||
|
- CGO_CFLAGS=-O1 -fno-stack-protector
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- mips64
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for linux/mips64 (CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built linux/mips64 (CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Linux MIPS64LE with CGO
|
||||||
|
- id: linux-mips64le-cgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=1
|
||||||
|
- CC=mips64el-linux-gnuabi64-gcc
|
||||||
|
- CGO_CFLAGS=-O1 -fno-stack-protector
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- mips64le
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for linux/mips64le (CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built linux/mips64le (CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Linux PPC64LE with CGO
|
||||||
|
- id: linux-ppc64le-cgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=1
|
||||||
|
- CC=powerpc64le-linux-gnu-gcc
|
||||||
|
- CGO_CFLAGS=-O1 -fno-stack-protector
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- ppc64le
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for linux/ppc64le (CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built linux/ppc64le (CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Linux ARM (no CGO)
|
||||||
|
- id: linux-arm-nocgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- arm
|
||||||
|
goarm:
|
||||||
|
- "5"
|
||||||
|
- "6"
|
||||||
|
- "7"
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for linux/arm (no CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built linux/arm (no CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Linux S390X (no CGO)
|
||||||
|
- id: linux-s390x-nocgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- s390x
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for linux/s390x (no CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built linux/s390x (no CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Linux MIPS (no CGO)
|
||||||
|
- id: linux-mips-nocgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- mips
|
||||||
|
gomips:
|
||||||
|
- softfloat
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for linux/mips (no CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built linux/mips (no CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Linux MIPSLE (no CGO)
|
||||||
|
- id: linux-mipsle-nocgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- mipsle
|
||||||
|
gomips:
|
||||||
|
- softfloat
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for linux/mipsle (no CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built linux/mipsle (no CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# Linux PPC64 (no CGO)
|
||||||
|
- id: linux-ppc64-nocgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- ppc64
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for linux/ppc64 (no CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built linux/ppc64 (no CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# FreeBSD AMD64 (no CGO)
|
||||||
|
- id: freebsd-amd64-nocgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- freebsd
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for freebsd/amd64 (no CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built freebsd/amd64 (no CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
|
# FreeBSD ARM64 (no CGO)
|
||||||
|
- id: freebsd-arm64-nocgo
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- freebsd
|
||||||
|
goarch:
|
||||||
|
- arm64
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
pre:
|
||||||
|
- echo "Starting build for freebsd/arm64 (no CGO)"
|
||||||
|
post:
|
||||||
|
- echo "Successfully built freebsd/arm64 (no CGO)"
|
||||||
|
- echo "---"
|
||||||
|
|
||||||
universal_binaries:
|
universal_binaries:
|
||||||
- name_template: "goecs"
|
- name_template: "goecs"
|
||||||
replace: false
|
replace: false
|
||||||
|
ids:
|
||||||
|
- darwin-amd64-cgo
|
||||||
|
- darwin-arm64-cgo
|
||||||
|
|
||||||
checksum:
|
checksum:
|
||||||
name_template: "checksums.txt"
|
name_template: "checksums.txt"
|
||||||
|
algorithm: sha256
|
||||||
|
disable: false
|
||||||
|
ids:
|
||||||
|
- linux-amd64-cgo
|
||||||
|
- linux-386-cgo
|
||||||
|
- linux-arm64-cgo
|
||||||
|
- linux-riscv64-cgo
|
||||||
|
- linux-mips64-cgo
|
||||||
|
- linux-mips64le-cgo
|
||||||
|
- linux-ppc64le-cgo
|
||||||
|
- windows-amd64-cgo
|
||||||
|
- windows-386-cgo
|
||||||
|
- darwin-amd64-cgo
|
||||||
|
- darwin-arm64-cgo
|
||||||
|
- linux-arm-nocgo
|
||||||
|
- linux-s390x-nocgo
|
||||||
|
- linux-mips-nocgo
|
||||||
|
- linux-mipsle-nocgo
|
||||||
|
- linux-ppc64-nocgo
|
||||||
|
- freebsd-amd64-nocgo
|
||||||
|
- freebsd-arm64-nocgo
|
||||||
|
extra_files:
|
||||||
|
- glob: "./goecs.sh"
|
||||||
|
|
||||||
snapshot:
|
snapshot:
|
||||||
name_template: "goecs"
|
name_template: "goecs"
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
- name_template: "goecs_{{ .Os }}_{{ .Arch }}"
|
- id: default
|
||||||
|
name_template: "goecs_{{ .Os }}_{{ .Arch }}"
|
||||||
format: zip
|
format: zip
|
||||||
files:
|
files:
|
||||||
- none*
|
- none*
|
||||||
|
allow_different_binary_count: true
|
||||||
|
builds:
|
||||||
|
- linux-amd64-cgo
|
||||||
|
- linux-386-cgo
|
||||||
|
- linux-arm64-cgo
|
||||||
|
- linux-riscv64-cgo
|
||||||
|
- linux-mips64-cgo
|
||||||
|
- linux-mips64le-cgo
|
||||||
|
- linux-ppc64le-cgo
|
||||||
|
- windows-amd64-cgo
|
||||||
|
- windows-386-cgo
|
||||||
|
- darwin-amd64-cgo
|
||||||
|
- darwin-arm64-cgo
|
||||||
|
- linux-arm-nocgo
|
||||||
|
- linux-s390x-nocgo
|
||||||
|
- linux-mips-nocgo
|
||||||
|
- linux-mipsle-nocgo
|
||||||
|
- linux-ppc64-nocgo
|
||||||
|
- freebsd-amd64-nocgo
|
||||||
|
- freebsd-arm64-nocgo
|
||||||
|
|
||||||
changelog:
|
changelog:
|
||||||
sort: asc
|
sort: asc
|
||||||
filters:
|
filters:
|
||||||
@@ -81,4 +519,4 @@ changelog:
|
|||||||
- Merge pull request
|
- Merge pull request
|
||||||
- Merge branch
|
- Merge branch
|
||||||
- go mod tidy
|
- go mod tidy
|
||||||
- New translations
|
- New translations
|
@@ -30,9 +30,9 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS
|
|||||||
| 编译支持的架构 | 测试支持的架构 | 编译支持的系统 | 测试支持的系统 |
|
| 编译支持的架构 | 测试支持的架构 | 编译支持的系统 | 测试支持的系统 |
|
||||||
|---------------------------|-----------|---------|-----------|
|
|---------------------------|-----------|---------|-----------|
|
||||||
| amd64 | amd64 | Linux | Linux |
|
| amd64 | amd64 | Linux | Linux |
|
||||||
| arm | arm | Windows | Windows |
|
| arm | | Windows | Windows |
|
||||||
| arm64 | arm64 | FreeBSD | FreeBSD |
|
| arm64 | arm64 | FreeBSD | |
|
||||||
| 386 | 386 | OpenBSD | |
|
| 386 | | OpenBSD | |
|
||||||
| mips | | MacOS | MacOS |
|
| mips | | MacOS | MacOS |
|
||||||
| mipsle | | | |
|
| mipsle | | | |
|
||||||
| s390x | s390x | | |
|
| s390x | s390x | | |
|
||||||
|
@@ -28,10 +28,10 @@ Shell version: [https://github.com/spiritLHLS/ecs/blob/main/README_EN.md](https:
|
|||||||
| Supported for Compilation | Tested on | Supported OS for Compilation | Tested OS |
|
| Supported for Compilation | Tested on | Supported OS for Compilation | Tested OS |
|
||||||
|---------------------------|-----------|------------------------------|-----------|
|
|---------------------------|-----------|------------------------------|-----------|
|
||||||
| amd64 | amd64 | Linux | Linux |
|
| amd64 | amd64 | Linux | Linux |
|
||||||
| arm | arm | Windows | Windows |
|
| arm | | Windows | Windows |
|
||||||
| arm64 | arm64 | FreeBSD | FreeBSD |
|
| arm64 | arm64 | FreeBSD | |
|
||||||
| 386 | 386 | OpenBSD | |
|
| 386 | | OpenBSD | |
|
||||||
| mips | | MacOS | MacOS |
|
| mips | | MacOS(darwin) | MacOS |
|
||||||
| mipsle | | | |
|
| mipsle | | | |
|
||||||
| s390x | s390x | | |
|
| s390x | s390x | | |
|
||||||
| riscv64 | | | |
|
| riscv64 | | | |
|
||||||
|
84
back/.goreleaser.old
Normal file
84
back/.goreleaser.old
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- go mod tidy -v
|
||||||
|
builds:
|
||||||
|
- id: universal
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
- windows
|
||||||
|
- freebsd
|
||||||
|
goarch:
|
||||||
|
- arm
|
||||||
|
- arm64
|
||||||
|
- 386
|
||||||
|
- amd64
|
||||||
|
- mips
|
||||||
|
- mipsle
|
||||||
|
- s390x
|
||||||
|
- riscv64
|
||||||
|
gomips:
|
||||||
|
- softfloat
|
||||||
|
ignore:
|
||||||
|
- goos: windows
|
||||||
|
goarch: arm
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
- id: darwin-amd64
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=1
|
||||||
|
- CC=o64-clang
|
||||||
|
- CXX=o64-clang++
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- darwin
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
- id: darwin-arm64
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=1
|
||||||
|
- CC=oa64-clang
|
||||||
|
- CXX=oa64-clang++
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
goos:
|
||||||
|
- darwin
|
||||||
|
goarch:
|
||||||
|
- arm64
|
||||||
|
main: ./
|
||||||
|
binary: goecs
|
||||||
|
universal_binaries:
|
||||||
|
- name_template: "goecs"
|
||||||
|
replace: false
|
||||||
|
checksum:
|
||||||
|
name_template: "checksums.txt"
|
||||||
|
snapshot:
|
||||||
|
name_template: "goecs"
|
||||||
|
archives:
|
||||||
|
- name_template: "goecs_{{ .Os }}_{{ .Arch }}"
|
||||||
|
format: zip
|
||||||
|
files:
|
||||||
|
- none*
|
||||||
|
changelog:
|
||||||
|
sort: asc
|
||||||
|
filters:
|
||||||
|
exclude:
|
||||||
|
- "^docs:"
|
||||||
|
- "^test:"
|
||||||
|
- "^chore"
|
||||||
|
- Merge pull request
|
||||||
|
- Merge branch
|
||||||
|
- go mod tidy
|
||||||
|
- New translations
|
8
go.mod
8
go.mod
@@ -1,8 +1,6 @@
|
|||||||
module github.com/oneclickvirt/ecs
|
module github.com/oneclickvirt/ecs
|
||||||
|
|
||||||
go 1.24.1
|
go 1.24.5
|
||||||
|
|
||||||
toolchain go1.24.2
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/imroc/req/v3 v3.50.0
|
github.com/imroc/req/v3 v3.50.0
|
||||||
@@ -10,11 +8,11 @@ require (
|
|||||||
github.com/oneclickvirt/UnlockTests v0.0.27-20250628125053
|
github.com/oneclickvirt/UnlockTests v0.0.27-20250628125053
|
||||||
github.com/oneclickvirt/backtrace v0.0.5-20250629024536
|
github.com/oneclickvirt/backtrace v0.0.5-20250629024536
|
||||||
github.com/oneclickvirt/basics v0.0.15-20250714163009
|
github.com/oneclickvirt/basics v0.0.15-20250714163009
|
||||||
github.com/oneclickvirt/cputest v0.0.10-20250404151448
|
github.com/oneclickvirt/cputest v0.0.11-20250716031513
|
||||||
github.com/oneclickvirt/defaultset v0.0.2-20240624082446
|
github.com/oneclickvirt/defaultset v0.0.2-20240624082446
|
||||||
github.com/oneclickvirt/disktest v0.0.8-20250701092629
|
github.com/oneclickvirt/disktest v0.0.8-20250701092629
|
||||||
github.com/oneclickvirt/gostun v0.0.3-20250329105202
|
github.com/oneclickvirt/gostun v0.0.3-20250329105202
|
||||||
github.com/oneclickvirt/memorytest v0.0.6-20250630141424.0.20250701113027-9edfc91f68e6
|
github.com/oneclickvirt/memorytest v0.0.8-20250716133749
|
||||||
github.com/oneclickvirt/nt3 v0.0.5-20250416131047
|
github.com/oneclickvirt/nt3 v0.0.5-20250416131047
|
||||||
github.com/oneclickvirt/pingtest v0.0.8-20250701125637
|
github.com/oneclickvirt/pingtest v0.0.8-20250701125637
|
||||||
github.com/oneclickvirt/portchecker v0.0.3-20250329125750
|
github.com/oneclickvirt/portchecker v0.0.3-20250329125750
|
||||||
|
8
go.sum
8
go.sum
@@ -105,8 +105,8 @@ github.com/oneclickvirt/backtrace v0.0.5-20250629024536 h1:caHCa0DHmbYWBFN1bqKxp
|
|||||||
github.com/oneclickvirt/backtrace v0.0.5-20250629024536/go.mod h1:5AH00bo41hH3d2/JVuCTlBkZUs3AXX4nlKVXb6piZcI=
|
github.com/oneclickvirt/backtrace v0.0.5-20250629024536/go.mod h1:5AH00bo41hH3d2/JVuCTlBkZUs3AXX4nlKVXb6piZcI=
|
||||||
github.com/oneclickvirt/basics v0.0.15-20250714163009 h1:7I1lU7N91kClw6Cb6o+vGfScc/HngrjhsaaW10AbBFs=
|
github.com/oneclickvirt/basics v0.0.15-20250714163009 h1:7I1lU7N91kClw6Cb6o+vGfScc/HngrjhsaaW10AbBFs=
|
||||||
github.com/oneclickvirt/basics v0.0.15-20250714163009/go.mod h1:yN1IEOXN6v/GJqJSA70Pooo6nXBI/6rq72vTY72wJMQ=
|
github.com/oneclickvirt/basics v0.0.15-20250714163009/go.mod h1:yN1IEOXN6v/GJqJSA70Pooo6nXBI/6rq72vTY72wJMQ=
|
||||||
github.com/oneclickvirt/cputest v0.0.10-20250404151448 h1:ovGtCwFXG0qmpyNDRqcNDIiAmhrtemCjIUXTJ1fPH0o=
|
github.com/oneclickvirt/cputest v0.0.11-20250716031513 h1:6xP/QCxwI6jTLmarIY3UIgaeOL2u94hzjVyG4yNa4WM=
|
||||||
github.com/oneclickvirt/cputest v0.0.10-20250404151448/go.mod h1:MmaHN9+XMntI3rLycwj8Ne31fG18IfNoa8N2utDK1CY=
|
github.com/oneclickvirt/cputest v0.0.11-20250716031513/go.mod h1:vjlH8tkPFft1tlLOpeNskXVvurxkHaJ3+dgFxQGLXY4=
|
||||||
github.com/oneclickvirt/dd v0.0.2-20250701085922 h1:WiWZwcnCPhRc8hLZdvkjD2kOEpnqn1S31z1j0x3V4l0=
|
github.com/oneclickvirt/dd v0.0.2-20250701085922 h1:WiWZwcnCPhRc8hLZdvkjD2kOEpnqn1S31z1j0x3V4l0=
|
||||||
github.com/oneclickvirt/dd v0.0.2-20250701085922/go.mod h1:tImu9sPTkLWo2tf1dEN1xQzrylWKauj9hbU8PHfyAeU=
|
github.com/oneclickvirt/dd v0.0.2-20250701085922/go.mod h1:tImu9sPTkLWo2tf1dEN1xQzrylWKauj9hbU8PHfyAeU=
|
||||||
github.com/oneclickvirt/defaultset v0.0.2-20240624082446 h1:5Pg3mK/u/vQvSz7anu0nxzrNdELi/AcDAU1mMsmPzyc=
|
github.com/oneclickvirt/defaultset v0.0.2-20240624082446 h1:5Pg3mK/u/vQvSz7anu0nxzrNdELi/AcDAU1mMsmPzyc=
|
||||||
@@ -119,8 +119,8 @@ github.com/oneclickvirt/gostun v0.0.3-20250329105202 h1:aJ6E91Lp94lq8iWRcCaxpXTj
|
|||||||
github.com/oneclickvirt/gostun v0.0.3-20250329105202/go.mod h1:f7DPEXAxbmwXSW33dbxtb0/KzqvOBWhTs2Or5xBerQA=
|
github.com/oneclickvirt/gostun v0.0.3-20250329105202/go.mod h1:f7DPEXAxbmwXSW33dbxtb0/KzqvOBWhTs2Or5xBerQA=
|
||||||
github.com/oneclickvirt/mbw v0.0.1-20250630140849 h1:p6RMhOPBnQKAm9+VEQ2axAFsidrdSdrhXMyheIyv2a8=
|
github.com/oneclickvirt/mbw v0.0.1-20250630140849 h1:p6RMhOPBnQKAm9+VEQ2axAFsidrdSdrhXMyheIyv2a8=
|
||||||
github.com/oneclickvirt/mbw v0.0.1-20250630140849/go.mod h1:0Vq6NRpyLmGUdfHfL3uDcFsuZhi7KlG+OCs5ky2757Y=
|
github.com/oneclickvirt/mbw v0.0.1-20250630140849/go.mod h1:0Vq6NRpyLmGUdfHfL3uDcFsuZhi7KlG+OCs5ky2757Y=
|
||||||
github.com/oneclickvirt/memorytest v0.0.6-20250630141424.0.20250701113027-9edfc91f68e6 h1:78/eMk+FGeDxxpKgkTb4GF5KJe76y8UW7Htcwm2hF9I=
|
github.com/oneclickvirt/memorytest v0.0.8-20250716133749 h1:/z5lfsxRo5MHPfTAAKLk9vD0sQ4JDw5aEe21u6rQdfw=
|
||||||
github.com/oneclickvirt/memorytest v0.0.6-20250630141424.0.20250701113027-9edfc91f68e6/go.mod h1:7xMacjQobvFAtODht2hxTsB9hM2IFS7vZk3gxx+bsjo=
|
github.com/oneclickvirt/memorytest v0.0.8-20250716133749/go.mod h1:7xMacjQobvFAtODht2hxTsB9hM2IFS7vZk3gxx+bsjo=
|
||||||
github.com/oneclickvirt/nt3 v0.0.5-20250416131047 h1:KL0xowq19cW+FMBGMJxdqpRNoeyR+eEmb+jYSubmlTk=
|
github.com/oneclickvirt/nt3 v0.0.5-20250416131047 h1:KL0xowq19cW+FMBGMJxdqpRNoeyR+eEmb+jYSubmlTk=
|
||||||
github.com/oneclickvirt/nt3 v0.0.5-20250416131047/go.mod h1:CVsDJEaIdyyZHn3WKbhU8Wn6GOfmBNvJlC/dDLRqcSQ=
|
github.com/oneclickvirt/nt3 v0.0.5-20250416131047/go.mod h1:CVsDJEaIdyyZHn3WKbhU8Wn6GOfmBNvJlC/dDLRqcSQ=
|
||||||
github.com/oneclickvirt/pingtest v0.0.8-20250701125637 h1:J28Ai5miTq1J0I4gdT8rewJSd3LwzD90L/bNiiaKfHM=
|
github.com/oneclickvirt/pingtest v0.0.8-20250701125637 h1:J28Ai5miTq1J0I4gdT8rewJSd3LwzD90L/bNiiaKfHM=
|
||||||
|
48
goecs.go
48
goecs.go
@@ -39,7 +39,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ecsVersion = "v0.1.54"
|
ecsVersion = "v0.1.58"
|
||||||
menuMode bool
|
menuMode bool
|
||||||
onlyChinaTest bool
|
onlyChinaTest bool
|
||||||
input, choice string
|
input, choice string
|
||||||
@@ -462,11 +462,11 @@ func handleSignalInterrupt(sig chan os.Signal, startTime *time.Time, output *str
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3 *sync.WaitGroup, basicInfo, securityInfo, emailInfo, mediaInfo, ptInfo *string, output, tempOutput string, startTime time.Time, outputMutex *sync.Mutex) string {
|
func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3 *sync.WaitGroup, basicInfo, securityInfo, emailInfo, mediaInfo, ptInfo *string, output *string, tempOutput string, startTime time.Time, outputMutex *sync.Mutex) {
|
||||||
output = runBasicTests(preCheck, basicInfo, securityInfo, output, tempOutput, outputMutex)
|
*output = runBasicTests(preCheck, basicInfo, securityInfo, *output, tempOutput, outputMutex)
|
||||||
output = runCPUTest(output, tempOutput, outputMutex)
|
*output = runCPUTest(*output, tempOutput, outputMutex)
|
||||||
output = runMemoryTest(output, tempOutput, outputMutex)
|
*output = runMemoryTest(*output, tempOutput, outputMutex)
|
||||||
output = runDiskTest(output, tempOutput, outputMutex)
|
*output = runDiskTest(*output, tempOutput, outputMutex)
|
||||||
if (onlyChinaTest || pingTestStatus) && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
|
if (onlyChinaTest || pingTestStatus) && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
|
||||||
wg3.Add(1)
|
wg3.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
@@ -489,24 +489,24 @@ func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3 *sync.WaitGrou
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
|
if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
|
||||||
output = runStreamingTests(wg1, mediaInfo, output, tempOutput, outputMutex)
|
*output = runStreamingTests(wg1, mediaInfo, *output, tempOutput, outputMutex)
|
||||||
output = runSecurityTests(*securityInfo, output, tempOutput, outputMutex)
|
*output = runSecurityTests(*securityInfo, *output, tempOutput, outputMutex)
|
||||||
output = runEmailTests(wg2, emailInfo, output, tempOutput, outputMutex)
|
*output = runEmailTests(wg2, emailInfo, *output, tempOutput, outputMutex)
|
||||||
}
|
}
|
||||||
if runtime.GOOS != "windows" && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
|
if runtime.GOOS != "windows" && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
|
||||||
output = runNetworkTests(wg3, ptInfo, output, tempOutput, outputMutex)
|
*output = runNetworkTests(wg3, ptInfo, *output, tempOutput, outputMutex)
|
||||||
}
|
}
|
||||||
if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
|
if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
|
||||||
output = runSpeedTests(output, tempOutput, outputMutex)
|
*output = runSpeedTests(*output, tempOutput, outputMutex)
|
||||||
}
|
}
|
||||||
return appendTimeInfo(output, tempOutput, startTime, outputMutex)
|
*output = appendTimeInfo(*output, tempOutput, startTime, outputMutex)
|
||||||
}
|
}
|
||||||
|
|
||||||
func runEnglishTests(preCheck utils.NetCheckResult, wg1, wg2 *sync.WaitGroup, basicInfo, securityInfo, emailInfo, mediaInfo *string, output, tempOutput string, startTime time.Time, outputMutex *sync.Mutex) string {
|
func runEnglishTests(preCheck utils.NetCheckResult, wg1, wg2 *sync.WaitGroup, basicInfo, securityInfo, emailInfo, mediaInfo *string, output *string, tempOutput string, startTime time.Time, outputMutex *sync.Mutex) {
|
||||||
output = runBasicTests(preCheck, basicInfo, securityInfo, output, tempOutput, outputMutex)
|
*output = runBasicTests(preCheck, basicInfo, securityInfo, *output, tempOutput, outputMutex)
|
||||||
output = runCPUTest(output, tempOutput, outputMutex)
|
*output = runCPUTest(*output, tempOutput, outputMutex)
|
||||||
output = runMemoryTest(output, tempOutput, outputMutex)
|
*output = runMemoryTest(*output, tempOutput, outputMutex)
|
||||||
output = runDiskTest(output, tempOutput, outputMutex)
|
*output = runDiskTest(*output, tempOutput, outputMutex)
|
||||||
if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
|
if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
|
||||||
if utTestStatus {
|
if utTestStatus {
|
||||||
wg1.Add(1)
|
wg1.Add(1)
|
||||||
@@ -522,12 +522,12 @@ func runEnglishTests(preCheck utils.NetCheckResult, wg1, wg2 *sync.WaitGroup, ba
|
|||||||
*emailInfo = email.EmailCheck()
|
*emailInfo = email.EmailCheck()
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
output = runStreamingTests(wg1, mediaInfo, output, tempOutput, outputMutex) // 传递指针
|
*output = runStreamingTests(wg1, mediaInfo, *output, tempOutput, outputMutex)
|
||||||
output = runSecurityTests(*securityInfo, output, tempOutput, outputMutex)
|
*output = runSecurityTests(*securityInfo, *output, tempOutput, outputMutex)
|
||||||
output = runEmailTests(wg2, emailInfo, output, tempOutput, outputMutex)
|
*output = runEmailTests(wg2, emailInfo, *output, tempOutput, outputMutex)
|
||||||
output = runEnglishSpeedTests(output, tempOutput, outputMutex)
|
*output = runEnglishSpeedTests(*output, tempOutput, outputMutex)
|
||||||
}
|
}
|
||||||
return appendTimeInfo(output, tempOutput, startTime, outputMutex)
|
*output = appendTimeInfo(*output, tempOutput, startTime, outputMutex)
|
||||||
}
|
}
|
||||||
|
|
||||||
func runBasicTests(preCheck utils.NetCheckResult, basicInfo, securityInfo *string, output, tempOutput string, outputMutex *sync.Mutex) string {
|
func runBasicTests(preCheck utils.NetCheckResult, basicInfo, securityInfo *string, output, tempOutput string, outputMutex *sync.Mutex) string {
|
||||||
@@ -810,9 +810,9 @@ func main() {
|
|||||||
go handleSignalInterrupt(sig, &startTime, &output, tempOutput, uploadDone, &outputMutex)
|
go handleSignalInterrupt(sig, &startTime, &output, tempOutput, uploadDone, &outputMutex)
|
||||||
switch language {
|
switch language {
|
||||||
case "zh":
|
case "zh":
|
||||||
output = runChineseTests(preCheck, &wg1, &wg2, &wg3, &basicInfo, &securityInfo, &emailInfo, &mediaInfo, &ptInfo, output, tempOutput, startTime, &outputMutex)
|
runChineseTests(preCheck, &wg1, &wg2, &wg3, &basicInfo, &securityInfo, &emailInfo, &mediaInfo, &ptInfo, &output, tempOutput, startTime, &outputMutex)
|
||||||
case "en":
|
case "en":
|
||||||
output = runEnglishTests(preCheck, &wg1, &wg2, &basicInfo, &securityInfo, &emailInfo, &mediaInfo, output, tempOutput, startTime, &outputMutex)
|
runEnglishTests(preCheck, &wg1, &wg2, &basicInfo, &securityInfo, &emailInfo, &mediaInfo, &output, tempOutput, startTime, &outputMutex)
|
||||||
default:
|
default:
|
||||||
fmt.Println("Unsupported language")
|
fmt.Println("Unsupported language")
|
||||||
}
|
}
|
||||||
|
6
goecs.sh
6
goecs.sh
@@ -143,7 +143,7 @@ goecs_check() {
|
|||||||
os=$(uname -s 2>/dev/null || echo "Unknown")
|
os=$(uname -s 2>/dev/null || echo "Unknown")
|
||||||
arch=$(uname -m 2>/dev/null || echo "Unknown")
|
arch=$(uname -m 2>/dev/null || echo "Unknown")
|
||||||
check_china
|
check_china
|
||||||
ECS_VERSION="0.1.53"
|
ECS_VERSION="0.1.55"
|
||||||
for api in \
|
for api in \
|
||||||
"https://api.github.com/repos/oneclickvirt/ecs/releases/latest" \
|
"https://api.github.com/repos/oneclickvirt/ecs/releases/latest" \
|
||||||
"https://githubapi.spiritlhl.workers.dev/repos/oneclickvirt/ecs/releases/latest" \
|
"https://githubapi.spiritlhl.workers.dev/repos/oneclickvirt/ecs/releases/latest" \
|
||||||
@@ -155,8 +155,8 @@ goecs_check() {
|
|||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
if [ -z "$ECS_VERSION" ]; then
|
if [ -z "$ECS_VERSION" ]; then
|
||||||
_yellow "Unable to get version info, using default version 0.1.53"
|
_yellow "Unable to get version info, using default version 0.1.55"
|
||||||
ECS_VERSION="0.1.53"
|
ECS_VERSION="0.1.55"
|
||||||
fi
|
fi
|
||||||
version_output=""
|
version_output=""
|
||||||
for cmd_path in "goecs" "./goecs" "/usr/bin/goecs" "/usr/local/bin/goecs"; do
|
for cmd_path in "goecs" "./goecs" "/usr/bin/goecs" "/usr/local/bin/goecs"; do
|
||||||
|
Reference in New Issue
Block a user