From defea1502faf81bc9bc15ef40e72247b80035c5d Mon Sep 17 00:00:00 2001 From: immll <150401258+immll@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:55:28 +0800 Subject: [PATCH] Update ... --- .github/dependabot.yml | 10 ++++++++++ .github/workflows/build.yaml | 12 ++++-------- .github/workflows/release.yaml | 12 ++++-------- main.go | 6 +++--- 4 files changed, 21 insertions(+), 19 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c507d44 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 46a1ef3..f7bf21c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,17 +9,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 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 + uses: actions/setup-go@v4 with: - go-version: ${{ steps.version.outputs.go_version }} + go-version: '1.18' - name: Build geosite id: build env: @@ -30,4 +26,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: geosite.db - path: geosite.db \ No newline at end of file + path: geosite.db diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 43e061c..144eccf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,17 +9,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 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 + uses: actions/setup-go@v4 with: - go-version: ${{ steps.version.outputs.go_version }} + go-version: '1.18' - name: Build geosite id: build run: | @@ -58,4 +54,4 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./geosite.db.sha256sum asset_name: geosite.db.sha256sum - asset_content_type: text/plain \ No newline at end of file + asset_content_type: text/plain diff --git a/main.go b/main.go index fc97ade..f7a4fea 100644 --- a/main.go +++ b/main.go @@ -54,10 +54,10 @@ func get(downloadURL *string) ([]byte, error) { func download(release *github.RepositoryRelease) ([]byte, error) { geositeAsset := common.Find(release.Assets, func(it *github.ReleaseAsset) bool { - return *it.Name == "dlc.dat" + return *it.Name == "geosite.dat" }) geositeChecksumAsset := common.Find(release.Assets, func(it *github.ReleaseAsset) bool { - return *it.Name == "dlc.dat.sha256sum" + return *it.Name == "geosite.dat.sha256sum" }) if geositeAsset == nil { return nil, E.New("geosite asset not found in upstream release ", release.Name) @@ -212,7 +212,7 @@ func release(source string, destination string, output string) error { } func main() { - err := release("v2fly/domain-list-community", "sagernet/sing-geosite", "geosite.db") + err := release("Loyalsoldier/v2ray-rules-dat", "immll/sing-geosite", "geosite.db") if err != nil { logrus.Fatal(err) }