From d80854f8573dee9ddfcae711caad903f1267774f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 5 Jul 2022 09:12:35 +0800 Subject: [PATCH] Add debug workflow --- .github/workflows/build.yaml | 36 ++++++++++++++++++++++++++++++++++++ go.mod | 8 ++++---- go.sum | 8 ++++---- main.go | 2 +- 4 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..430a677 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,36 @@ +name: Build +on: + push: + branches: + - main +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Get latest go version + id: version + run: | + echo ::set-output name=go_version::$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: ${{ steps.version.outputs.go_version }} + - name: Build geosite + id: build + env: + GOPRIVATE: github.com/sagernet + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + NO_SKIP: true + run: | + git config --global url."https://${{ secrets.ACCESS_TOKEN }}@github.com".insteadOf "https://github.com" + go run -v . + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: geosite.db + path: geosite.db \ No newline at end of file diff --git a/go.mod b/go.mod index 3e3310f..6fc99ab 100644 --- a/go.mod +++ b/go.mod @@ -3,19 +3,19 @@ module sing-geosite go 1.18 require ( - github.com/golang/protobuf v1.5.2 github.com/google/go-github/v45 v45.2.0 - github.com/sagernet/sing v0.0.0-20220704113227-8b990551511a - github.com/sagernet/sing-box v0.0.0-20220704113958-f76102dab512 + github.com/sagernet/sing v0.0.0-20220705005401-57d12d875b7a + github.com/sagernet/sing-box v0.0.0-20220705010535-8392567962ac github.com/sirupsen/logrus v1.8.1 github.com/v2fly/v2ray-core/v5 v5.0.7 + google.golang.org/protobuf v1.28.0 ) require ( github.com/adrg/xdg v0.4.0 // indirect github.com/goccy/go-json v0.9.8 // indirect + github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-querystring v1.1.0 // indirect golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b // indirect - google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/go.sum b/go.sum index d1a2730..6937044 100644 --- a/go.sum +++ b/go.sum @@ -17,10 +17,10 @@ github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sagernet/sing v0.0.0-20220704113227-8b990551511a h1:IvYjuvuPNmZzQfBbCxE/uQqGkNWUa5/KrEMIecRMjZk= -github.com/sagernet/sing v0.0.0-20220704113227-8b990551511a/go.mod h1:3ZmoGNg/nNJTyHAZFNRSPaXpNIwpDvyIiAUd0KIWV5c= -github.com/sagernet/sing-box v0.0.0-20220704113958-f76102dab512 h1:hZ/oWGx6Ff1HMqhCqmahvaW4W3gb83/jBhmWu1Cuf8Y= -github.com/sagernet/sing-box v0.0.0-20220704113958-f76102dab512/go.mod h1:Yf1jgOxozYlIYCK2HFUzVf06U2wJP3RcTHl0XACFX/c= +github.com/sagernet/sing v0.0.0-20220705005401-57d12d875b7a h1:FhrHCkox9scuTzcT5DDh6flVLFuqU+QSk3VONd41I+o= +github.com/sagernet/sing v0.0.0-20220705005401-57d12d875b7a/go.mod h1:3ZmoGNg/nNJTyHAZFNRSPaXpNIwpDvyIiAUd0KIWV5c= +github.com/sagernet/sing-box v0.0.0-20220705010535-8392567962ac h1:oGv23zqrGbSENOPCnUlT6s1L0ZGnksAZz6mNgJb7WOc= +github.com/sagernet/sing-box v0.0.0-20220705010535-8392567962ac/go.mod h1:Y+TVnQmBOShqlXwZ5bQIByfV4CRERky24YWWy91XSe0= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/main.go b/main.go index bb1cc38..9bbaaac 100644 --- a/main.go +++ b/main.go @@ -154,7 +154,7 @@ func release(source string, destination string, output string) error { if err != nil { logrus.Warn("missing destination latest release") } else { - if strings.Contains(*destinationRelease.Name, *sourceRelease.Name) { + if os.Getenv("NO_SKIP") != "true" && strings.Contains(*destinationRelease.Name, *sourceRelease.Name) { logrus.Info("already latest") setActionOutput("skip", "true") return nil