Skip to content

Commit

Permalink
fix broken pie build with generating seperate files (#3281)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaokangwang authored Jan 14, 2025
1 parent 54fbeeb commit 4adda58
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
goos: dragonfly
- goarch: 386
goos: darwin
- goarch: amd64
goos: linux
include:
# BEGIN Linux ARM 5 6 7
- goos: linux
Expand Down Expand Up @@ -95,6 +97,15 @@ jobs:
goarch: mipsle
- goos: linux
goarch: mips
- goos: linux
goarch: arm64
pie: pie
- goos: linux
goarch: amd64
pie: pie
- goos: linux
goarch: amd64
pie:
# END MIPS
# END Other architectures
fail-fast: false
Expand All @@ -104,6 +115,7 @@ jobs:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
PIE_ENABLED: ${{ matrix.pie }}
CGO_ENABLED: 0

steps:
Expand Down Expand Up @@ -133,15 +145,16 @@ jobs:
mkdir -p build_assets
EXTRA_ARG=""
case "$GOOS-$GOARCH" in
"linux-386")
;&
"linux-amd64")
;&
"linux-arm64")
EXTRA_ARG=EXTRA_ARG+"-buildmode=pie"
if [ -z $PIE_ENABLED ]
then
EXTRA_ARG=$EXTRA_ARG" -buildmode=pie"
fi
;;
esac
go build -v -o build_assets/v2ray -trimpath -ldflags "-s -w -buildid=" ./main
go build $EXTRA_ARG -v -o build_assets/v2ray -trimpath -ldflags "-s -w -buildid=" ./main
- name: Rename Windows V2Ray
if: matrix.goos == 'windows'
Expand Down

0 comments on commit 4adda58

Please sign in to comment.