Skip to content

Commit

Permalink
pull_request.yml: fix build on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Markson Hon committed Nov 25, 2023
1 parent 009f9b7 commit 1ae2689
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,20 @@ jobs:
with:
go-version: ^1.21
- name: Build v2rayA
shell: pwsh
shell: bash
run: |
New-Item -Path ./v2raya_bin -ItemType Directory -Force
$CurrentDir = (Get-Location).Path
$dateLong = git log -1 --format="%cd" --date=short
$date = $DateLong -replace "-"; ""
$count = git rev-list --count HEAD
$commit = git rev-parse --short HEAD
$version = "unstable-$date.r$count.$commit"
$os = "windows"
${env:CGO_ENABLED} = "0"
Set-Location "$CurrentDir"/service
${env:GOARCH} = amd64; go build -tags "with_gvisor" -ldflags "-X github.com/v2rayA/v2rayA/conf.Version=$version -s -w" -o "$CurrentDir"/v2raya_bin/v2raya_pr_build_"$os"_amd64_"$version".exe
${env:GOARCH} = arm64; go build -tags "with_gvisor" -ldflags "-X github.com/v2rayA/v2rayA/conf.Version=$version -s -w" -o "$CurrentDir"/v2raya_bin/v2raya_pr_build_"$os"_arm64_"$version".exe
mkdir v2raya_bin
CurrentDir="$(pwd)"
date=$(git -C "$CurrentDir" log -1 --format="%cd" --date=short | sed s/-//g)
count=$(git -C "$CurrentDir" rev-list --count HEAD)
commit=$(git -C "$CurrentDir" rev-parse --short HEAD)
version="unstable-$date.r${count}.$commit"
os="darwin"
cd "$CurrentDir"/gui && yarn && OUTPUT_DIR="$CurrentDir"/service/server/router/web yarn build
cd "$CurrentDir"/service
for arch in amd64 arm64; do
GOARCH="$arch" CGO_ENABLED=0 go build -tags "with_gvisor" -ldflags "-X github.com/v2rayA/v2rayA/conf.Version=$version -s -w" -o "$CurrentDir"/v2raya_bin/v2raya_pr_build_"$os"_"$arch"_"$version"
done
- name: Upload Zip File to Artifacts
uses: nanoufo/[email protected]
with:
Expand Down

0 comments on commit 1ae2689

Please sign in to comment.