forked from v2rayA/v2rayA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Markson Hon
committed
Feb 22, 2024
1 parent
5c2f80d
commit 42f766e
Showing
1 changed file
with
15 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,78 +35,11 @@ jobs: | |
path: web/* | ||
name: web | ||
|
||
Build_on_Linux: | ||
runs-on: ubuntu-22.04 | ||
needs: Build_v2rayA_Web | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Download Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: web | ||
path: service/server/router/web | ||
- name: Set up Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: ^1.21 | ||
- name: Build v2rayA | ||
shell: bash | ||
run: | | ||
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="linux" | ||
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/action-upload-artifacts-and-release-assets@v2 | ||
with: | ||
path: v2raya_bin/* | ||
|
||
Build_on_Windows: | ||
runs-on: windows-latest | ||
needs: Build_v2rayA_Web | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Download Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: web | ||
path: service/server/router/web | ||
- name: Set up Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: ^1.21 | ||
- name: Build v2rayA | ||
shell: bash | ||
run: | | ||
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="windows" | ||
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".exe | ||
done | ||
- name: Upload Zip File to Artifacts | ||
uses: nanoufo/action-upload-artifacts-and-release-assets@v2 | ||
with: | ||
path: v2raya_bin/* | ||
|
||
Build_on_macOS: | ||
runs-on: macos-latest | ||
Build_v2rayA: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
needs: Build_v2rayA_Web | ||
steps: | ||
- uses: actions/[email protected] | ||
|
@@ -130,12 +63,19 @@ jobs: | |
count=$(git -C "$CurrentDir" rev-list --count HEAD) | ||
commit=$(git -C "$CurrentDir" rev-parse --short HEAD) | ||
version="unstable-$date.r${count}.$commit" | ||
os="darwin" | ||
if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
win_ex_name=".exe" | ||
os="windows" | ||
elif [ "${{ matrix.os }}" = "macos-latest" ]; then | ||
os="darwin" | ||
elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then | ||
os="linux" | ||
fi | ||
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" | ||
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""$win_ex_name" | ||
done | ||
- name: Upload Zip File to Artifacts | ||
uses: nanoufo/action-upload-artifacts-and-release-assets@v2 | ||
with: | ||
path: v2raya_bin/* | ||
path: v2raya_bin/* |