mirror of
https://github.com/e1732a364fed/v2ray_simple.git
synced 2025-12-24 13:27:56 +08:00
添加vsc编译的workflow;修订Makefile
This commit is contained in:
36
.github/workflows/build_release_extra.yml
vendored
36
.github/workflows/build_release_extra.yml
vendored
@@ -8,6 +8,42 @@ on:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
xgo:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Build vsc(verysimple client)
|
||||
uses: crazy-max/ghaction-xgo@v2
|
||||
with:
|
||||
xgo_version: latest
|
||||
go_version: 1.19
|
||||
dest: build
|
||||
prefix: vsc
|
||||
targets: windows/amd64,windows/arm64,linux/amd64,linux/arm64,darwin/amd64,darwin/arm64
|
||||
v: true
|
||||
x: false
|
||||
race: false
|
||||
ldflags: -s -w -ldflags "-X 'main.Version=${{ github.event.inputs.tagName }}' -buildid="
|
||||
buildmode: default
|
||||
trimpath: true
|
||||
working_dir: cmd/verysimple
|
||||
tags: "vcs"
|
||||
|
||||
- name: create xz archive
|
||||
shell: bash
|
||||
run: |
|
||||
cd cmd/verysimple/ && for i in vsc*; do tar -cJf $i.tar.xz $i -C ../../ examples/; done && touch -mt $(date +%Y01010000) *.tar.xz
|
||||
|
||||
- name: Upload binaries to release
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: cmd/verysimple/vsc*.tar.xz
|
||||
tag: ${{ github.event.inputs.tagName }}
|
||||
file_glob: true
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# 本文件的一些解释请参考 Makefile_release.
|
||||
# 本文件用于编译客户端版本的verysimple。vsc = verysimple client
|
||||
# 该版本使用cgo。
|
||||
# vsc因为开启了cgo,是较难交叉编译的,建议在目标平台上编译。
|
||||
# vsc因为开启了cgo,是较难交叉编译的,建议在目标平台上编译。或者搜索一下 "xgo"
|
||||
|
||||
prefix :=vsc
|
||||
|
||||
@@ -26,7 +26,7 @@ else
|
||||
ifeq ($(detected_OS),Windows)
|
||||
|
||||
define compile
|
||||
set CGO_ENABLED=1&& set GOOS=$(2)&& set GOARCH=$(3)&& $(cmd) $(1)$(4)
|
||||
set CGO_ENABLED=1&& set GOOS=$(2)&& set GOARCH=$(3)&& $(cmd) ${prefix}_$(1)$(4)
|
||||
endef
|
||||
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user