diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 418d269..20264d2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,7 +15,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: '1.18' + go-version: '1.20' - name: Build geosite id: build env: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1d4228e..5dceab4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,7 +15,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: '1.18' + go-version: '1.20' - name: Build geosite id: build run: | diff --git a/go.mod b/go.mod index 4d3514f..c58c10d 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,12 @@ module sing-geosite -go 1.18 +go 1.20 require ( github.com/google/go-github/v45 v45.2.0 github.com/sagernet/sing v0.2.17 github.com/sagernet/sing-box v1.6.2 + github.com/sethvargo/go-githubactions v1.1.0 github.com/sirupsen/logrus v1.9.3 github.com/v2fly/v2ray-core/v5 v5.11.0 google.golang.org/protobuf v1.31.0 @@ -17,6 +18,7 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/miekg/dns v1.1.56 // indirect github.com/sagernet/sing-dns v0.1.10 // indirect + github.com/sethvargo/go-envconfig v0.8.0 // indirect golang.org/x/crypto v0.14.0 // indirect golang.org/x/mod v0.13.0 // indirect golang.org/x/net v0.17.0 // indirect diff --git a/go.sum b/go.sum index 92763ce..fd54d9a 100644 --- a/go.sum +++ b/go.sum @@ -23,6 +23,10 @@ github.com/sagernet/sing-box v1.6.2 h1:jctKwzwzJzWm0p7S3MUMmk74hDifrWt3nUxEiUJve github.com/sagernet/sing-box v1.6.2/go.mod h1:BBtCyMz5MzRSB954AUvtPN5Wfajf1B4zMWofkNxNNRo= github.com/sagernet/sing-dns v0.1.10 h1:iIU7nRBlUYj+fF2TaktGIvRiTFFrHwSMedLQsvlTZCI= github.com/sagernet/sing-dns v0.1.10/go.mod h1:vtUimtf7Nq9EdvD5WTpfCr69KL1M7bcgOVKiYBiAY/c= +github.com/sethvargo/go-envconfig v0.8.0 h1:AcmdAewSFAc7pQ1Ghz+vhZkilUtxX559QlDuLLiSkdI= +github.com/sethvargo/go-envconfig v0.8.0/go.mod h1:Iz1Gy1Sf3T64TQlJSvee81qDhf7YIlt8GMUX6yyNFs0= +github.com/sethvargo/go-githubactions v1.1.0 h1:mg03w+b+/s5SMS298/2G6tHv8P0w0VhUFaqL1THIqzY= +github.com/sethvargo/go-githubactions v1.1.0/go.mod h1:qIboSF7yq2Qnaw2WXDsqCReM0Lo1gU4QXUWmhBC3pxE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/main.go b/main.go index 1b988d1..f90059e 100644 --- a/main.go +++ b/main.go @@ -14,6 +14,7 @@ import ( "github.com/sagernet/sing-box/common/geosite" "github.com/sagernet/sing/common" E "github.com/sagernet/sing/common/exceptions" + "github.com/sethvargo/go-githubactions" "github.com/sirupsen/logrus" "github.com/v2fly/v2ray-core/v5/app/router/routercommon" "google.golang.org/protobuf/proto" @@ -185,7 +186,7 @@ func generate(release *github.RepositoryRelease, output string) error { } func setActionOutput(name string, content string) { - os.Stdout.WriteString("::set-output name=" + name + "::" + content + "\n") + githubactions.SetOutput(name, content) } func release(source string, destination string, output string) error {