From 51bf6ae83034ec227c075fec282cde4412a082fe Mon Sep 17 00:00:00 2001 From: cdle Date: Fri, 2 Jun 2023 13:20:16 +0800 Subject: [PATCH] x --- core/init.go | 2 +- go.mod | 2 +- node | 0 workflow.yaml | 27 +++++++++++++-------------- 4 files changed, 15 insertions(+), 16 deletions(-) delete mode 100644 node diff --git a/core/init.go b/core/init.go index 9ffb219..b54d671 100644 --- a/core/init.go +++ b/core/init.go @@ -16,7 +16,7 @@ func Init() { if err != nil { os.MkdirAll(DataHome, os.ModePerm) } - utils.ReadYaml(utils.ExecPath+"/conf/", &Config, "https://raw.githubusercontent.com/cdle/sillyplus/main/conf/demo_config.yaml") + // utils.ReadYaml(utils.ExecPath+"/conf/", &Config, "https://raw.githubusercontent.com/cdle/sillyplus/main/conf/demo_config.yaml") initToHandleMessage() sillyGirl.Set("started_at", time.Now().Format("2006-01-02 15:04:05")) diff --git a/go.mod b/go.mod index 182ca53..ff50ecd 100644 --- a/go.mod +++ b/go.mod @@ -22,6 +22,7 @@ require ( github.com/gorilla/websocket v1.5.0 github.com/robfig/cron/v3 v3.0.1 github.com/stretchr/testify v1.8.0 + golang.org/x/net v0.4.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -30,7 +31,6 @@ require ( github.com/google/pprof v0.0.0-20230510103437-eeec1cb781c3 // indirect github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/net v0.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/node b/node deleted file mode 100644 index e69de29..0000000 diff --git a/workflow.yaml b/workflow.yaml index e98bb0b..add3acf 100644 --- a/workflow.yaml +++ b/workflow.yaml @@ -16,36 +16,35 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: Git clone sillyplus - run: - cd develop && git clone https://${{ secrets.CABLE_TOKEN }}@github.com/cdle/sillyplus.git - - - name: Push to binary run: | rm -rf * - cp sillyplus/* ./ + git clone https://${{ secrets.CABLE_TOKEN }}@github.com/cdle/sillyplus.git + cp -r sillyplus/* ./ + - name: Push to binary + run: | n=$(date +%s%3N) - echo "package core" > sillyplus/core/compile_time.go - echo "var compiled_at = \"$n\"" >> develop/core/compile_time.go - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o sillyGirl_windows_amd64 + echo "package core" > core/compile_time.go + echo "var compiled_at = \"$n\"" >> core/compile_time.go + CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o sillyGirl_windows_amd64.exe CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -o sillyGirl_linux_arm64 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o sillyGirl_linux_amd64 sudo apt-get install upx-ucl upx sillyGirl_linux_arm64 upx sillyGirl_linux_amd64 - upx sillyGirl_windows_amd64 + upx sillyGirl_windows_amd64.exe git clone https://${{ secrets.CABLE_TOKEN }}@github.com/cdle/binary.git git config --global user.email "you@example.com" git config --global user.name "Your Name" cd binary git checkout --orphan latest_branch rm -rf * - cp ../sillyGirl_windows_amd64 sillyGirl_windows_amd64_$n + cp ../sillyGirl_windows_amd64.exe sillyGirl_windows_amd64_$n.exe cp ../sillyGirl_linux_amd64 sillyGirl_linux_amd64_$n cp ../sillyGirl_linux_arm64 sillyGirl_linux_arm64_$n - cp ../develop/core/compile_time.go compile_time.go + cp ../core/compile_time.go compile_time.go git add -A git commit -am "commit message" git branch -D main @@ -66,8 +65,8 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: sillyGirl_windows_amd64 - asset_name: sillyGirl_windows_amd64 + file: sillyGirl_windows_amd64.exe + asset_name: sillyGirl_windows_amd64.exe tag: ${{ github.ref }} overwrite: true