fix: 添加错误追踪

This commit is contained in:
spiritlhl
2025-07-16 16:19:21 +00:00
parent 27fd06b007
commit 14adbddeb9
2 changed files with 26 additions and 32 deletions

View File

@@ -54,12 +54,6 @@ jobs:
gcc-mingw-w64-x86-64 \
gcc-mingw-w64-i686 \
libc6-dev-i386 \
linux-libc-dev-i386-cross \
linux-libc-dev-arm64-cross \
linux-libc-dev-riscv64-cross \
linux-libc-dev-mips64-cross \
linux-libc-dev-mips64el-cross \
linux-libc-dev-ppc64el-cross \
|| echo "Some packages may already be installed"
- name: Set up cross-compilation environment
run: |
@@ -75,7 +69,7 @@ jobs:
echo "CC_windows_386=i686-w64-mingw32-gcc" >> $GITHUB_ENV
echo "CC_darwin_amd64=o64-clang" >> $GITHUB_ENV
echo "CC_darwin_arm64=oa64-clang" >> $GITHUB_ENV
# 设置CGO_CFLAGS
echo "CGO_CFLAGS_linux_amd64=-O2 -static -fno-stack-protector -Wl,--gc-sections" >> $GITHUB_ENV
echo "CGO_CFLAGS_linux_386=-m32 -static -O1 -march=i686 -mtune=generic -fno-stack-protector" >> $GITHUB_ENV
@@ -88,7 +82,7 @@ jobs:
echo "CGO_CFLAGS_windows_386=-O2 -static -static-libgcc -static-libstdc++" >> $GITHUB_ENV
echo "CGO_CFLAGS_darwin_amd64=-O2 -arch x86_64 -mmacosx-version-min=10.12" >> $GITHUB_ENV
echo "CGO_CFLAGS_darwin_arm64=-O2 -arch arm64 -mmacosx-version-min=11.0" >> $GITHUB_ENV
# 设置CGO_LDFLAGS
echo "CGO_LDFLAGS_windows_amd64=-static -static-libgcc -static-libstdc++" >> $GITHUB_ENV
echo "CGO_LDFLAGS_windows_386=-static -static-libgcc -static-libstdc++" >> $GITHUB_ENV
@@ -97,7 +91,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --partial
args: release
env:
GITHUB_TOKEN: ${{ secrets.GHT }}
GOPRIVATE: github.com/oneclickvirt/security
@@ -130,4 +124,4 @@ jobs:
git commit -m "chore: update ECS_VERSION to $VERSION in goecs.sh"
git push origin $BRANCH
env:
GITHUB_TOKEN: ${{ secrets.GHT }}
GITHUB_TOKEN: ${{ secrets.GHT }}

View File

@@ -25,10 +25,10 @@ builds:
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting build for {{.Os}}/{{.Arch}} (linux-cgo)"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "Binary size:" && du -h "{{ .Path }}"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Successfully built {{.Os}}/{{.Arch}} (linux-cgo)"
- echo "---"
- id: linux-cgo-risc
env:
- CGO_ENABLED=1
@@ -45,10 +45,10 @@ builds:
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting build for {{.Os}}/{{.Arch}} (linux-cgo-risc)"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "Binary size:" && du -h "{{ .Path }}"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Successfully built {{.Os}}/{{.Arch}} (linux-cgo-risc)"
- echo "---"
- id: linux-cgo-mips
env:
- CGO_ENABLED=1
@@ -66,10 +66,10 @@ builds:
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting build for {{.Os}}/{{.Arch}} (linux-cgo-mips)"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "Binary size:" && du -h "{{ .Path }}"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Successfully built {{.Os}}/{{.Arch}} (linux-cgo-mips)"
- echo "---"
- id: linux-cgo-ppc
env:
- CGO_ENABLED=1
@@ -86,10 +86,10 @@ builds:
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting build for {{.Os}}/{{.Arch}} (linux-cgo-ppc)"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "Binary size:" && du -h "{{ .Path }}"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Successfully built {{.Os}}/{{.Arch}} (linux-cgo-ppc)"
- echo "---"
- id: windows-cgo
env:
- CGO_ENABLED=1
@@ -107,10 +107,10 @@ builds:
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting build for {{.Os}}/{{.Arch}} (windows-cgo)"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "Binary size:" && du -h "{{ .Path }}"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Successfully built {{.Os}}/{{.Arch}} (windows-cgo)"
- echo "---"
- id: darwin-cgo
env:
- CGO_ENABLED=1
@@ -128,10 +128,10 @@ builds:
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting build for {{.Os}}/{{.Arch}} (darwin-cgo)"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "Binary size:" && du -h "{{ .Path }}"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Successfully built {{.Os}}/{{.Arch}} (darwin-cgo)"
- echo "---"
- id: universal
env:
- CGO_ENABLED=0
@@ -200,17 +200,17 @@ builds:
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting build for {{.Os}}/{{.Arch}} (universal)"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Successfully built {{.Os}}/{{.Arch}} (universal)"
- echo "Binary size:" && du -h "{{ .Path }}"
- echo "---"
universal_binaries:
- name_template: "goecs"
replace: false
ids:
- darwin-cgo
partial:
by: target
checksum:
name_template: "checksums.txt"
algorithm: sha256