From: qydysky Date: Sat, 8 Apr 2023 17:11:23 +0000 (+0800) Subject: Fix 默认不编译gtk界面 X-Git-Tag: v0.8.0~6^2~1 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=7de5460544eb21148992327f2b07faf5e3d1a9d0;p=bili_danmu%2F.git Fix 默认不编译gtk界面 --- diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index eb1d108..1da45b2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -59,8 +59,9 @@ jobs: - name: Build run: | cd demo + set CGO_ENABLED=0 go get . - CGO_ENABLED=0 go build -v -buildmode=exe -o demo.exe main.go + go build -v -buildmode=exe -o demo.exe main.go - name: zip run: .\7za.exe a -r .\windows_go${{ matrix.go }}.zip ./ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4142eb8..d2f2b64 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,7 +56,8 @@ jobs: run: | cd demo go get . - CGO_ENABLED=0 go build -v -buildmode=exe -o demo.exe main.go + set CGO_ENABLED=0 + go build -v -buildmode=exe -o demo.exe main.go - name: zip run: .\7za.exe a -r .\windows_go${{ matrix.go }}.zip ./ diff --git a/README.md b/README.md index abaaba7..81e8675 100644 --- a/README.md +++ b/README.md @@ -453,7 +453,8 @@ go build -v -tags `gtk` -o demo.exe -i main.go clone/下载本项目。进入`demo`目录(文件夹),运行: ``` -CGO_ENABLED=0 go build [-tags "gtk"] . +linux: CGO_ENABLED=0 go build [-tags "gtk"] . +windows: set CGO_ENABLED=0;go build [-tags "gtk"] . ``` 再运行生成的`demo.exe`或`demo` @@ -463,7 +464,8 @@ CGO_ENABLED=0 go build [-tags "gtk"] . clone/下载本项目。进入`demo`目录(文件夹),运行: ``` -CGO_ENABLED=0 go run [-tags "gtk"] . [-r 房间ID] [-ckv 自定义config_K_v.json] +linux: CGO_ENABLED=0 go run [-tags "gtk"] . [-r 房间ID] [-ckv 自定义config_K_v.json] +windows: set CGO_ENABLED=0;go run [-tags "gtk"] . [-r 房间ID] [-ckv 自定义config_K_v.json] ``` 3. docker部署 @@ -480,7 +482,8 @@ apt-get update && apt-get install -y ca-certificates openssl clone/下载本项目。进入`demo`目录(文件夹),运行: ``` set GOOS=linux -CGO_ENABLED=0 go build . +set CGO_ENABLED=0 +go build . ``` 注意实际使用时,在`config_K_v.json`关闭`tts`等需要关闭界面及音频的功能,配置好录播存放位置,做好直播流服务的端口映射