-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63a151a
commit 7d51b7f
Showing
9 changed files
with
138 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e -o pipefail | ||
|
||
cd rule-set | ||
git init | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git remote add origin https://github-action:$GITHUB_TOKEN@github.com/SagerNet/sing-geosite.git | ||
git branch -M rule-set | ||
git add . | ||
git commit -m "Update rule-set" | ||
git push -f origin rule-set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,43 +24,26 @@ jobs: | |
id: build | ||
run: | | ||
go run -v . | ||
- name: Release rule sets | ||
if: steps.build.outputs.skip != 'true' | ||
run: .github/release-rule-set.sh | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Generate sha256 hash | ||
if: steps.build.outputs.skip != 'true' | ||
run: | | ||
sha256sum geosite.db > geosite.db.sha256sum | ||
- uses: dev-drprasad/[email protected] | ||
with: | ||
keep_latest: 3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create a release | ||
if: steps.build.outputs.skip != 'true' | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.build.outputs.tag }} | ||
release_name: ${{ steps.build.outputs.tag }} | ||
draft: false | ||
prerelease: false | ||
- name: Release geosite.db | ||
if: steps.build.outputs.skip != 'true' | ||
uses: actions/upload-release-asset@v1 | ||
keep_latest: 10 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./geosite.db | ||
asset_name: geosite.db | ||
asset_content_type: application/octet-stream | ||
- name: Release geosite.db sha256sum | ||
- name: Release geosite | ||
if: steps.build.outputs.skip != 'true' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./geosite.db.sha256sum | ||
asset_name: geosite.db.sha256sum | ||
asset_content_type: text/plain | ||
tag_name: ${{ steps.build.outputs.tag }} | ||
files: | | ||
geosite.db | ||
sha256sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.idea/ | ||
/vendor/ | ||
/geosite.db | ||
/geosite.db | ||
/rule-set/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,17 @@ | ||
run: | ||
timeout: 5m | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
- errcheck | ||
- wrapcheck | ||
- varnamelen | ||
- stylecheck | ||
- nonamedreturns | ||
- nlreturn | ||
- ireturn | ||
- gomnd | ||
- exhaustivestruct | ||
- ifshort | ||
- goerr113 | ||
- gochecknoglobals | ||
- forcetypeassert | ||
- exhaustruct | ||
- exhaustive | ||
- cyclop | ||
- containedctx | ||
- wsl | ||
- nestif | ||
- lll | ||
- funlen | ||
- goconst | ||
- godot | ||
- gocognit | ||
- golint | ||
- goimports | ||
- gochecknoinits | ||
- maligned | ||
- tagliatelle | ||
- gocyclo | ||
- maintidx | ||
- gocritic | ||
- nakedret | ||
disable-all: true | ||
enable: | ||
- gofumpt | ||
- govet | ||
- gci | ||
- staticcheck | ||
|
||
linters-settings: | ||
revive: | ||
rules: | ||
- name: var-naming | ||
disabled: true | ||
govet: | ||
enable-all: true | ||
disable: | ||
- composites | ||
- fieldalignment | ||
- shadow | ||
gosec: | ||
excludes: | ||
- G404 | ||
gci: | ||
custom-order: true | ||
sections: | ||
- standard | ||
- prefix(github.com/sagernet/) | ||
- default | ||
staticcheck: | ||
go: '1.20' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
fmt: | ||
@gofumpt -l -w . | ||
@gofmt -s -w . | ||
@gci write --custom-order -s standard -s "prefix(github.com/sagernet/)" -s "default" . | ||
|
||
fmt_install: | ||
go install -v mvdan.cc/gofumpt@latest | ||
go install -v github.com/daixiang0/gci@latest | ||
|
||
lint: | ||
golangci-lint run ./... | ||
|
||
lint_install: | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | ||
|
||
test: | ||
go test -v ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
module sing-geosite | ||
module github.com/sagernet/sing-geosite | ||
|
||
go 1.18 | ||
|
||
require ( | ||
github.com/google/go-github/v45 v45.2.0 | ||
github.com/sagernet/sing v0.2.17 | ||
github.com/sagernet/sing-box v1.6.4 | ||
github.com/sirupsen/logrus v1.9.3 | ||
github.com/v2fly/v2ray-core/v5 v5.11.0 | ||
github.com/sagernet/sing v0.2.18-0.20231129075305-eb56a60214be | ||
github.com/sagernet/sing-box v1.6.8-0.20231129123339-5a56487cf544 | ||
github.com/v2fly/v2ray-core/v5 v5.12.1 | ||
google.golang.org/protobuf v1.31.0 | ||
) | ||
|
||
require ( | ||
github.com/adrg/xdg v0.4.0 // indirect | ||
github.com/golang/protobuf v1.5.3 // indirect | ||
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/logrusorgru/aurora v2.0.3+incompatible // indirect | ||
github.com/miekg/dns v1.1.57 // indirect | ||
github.com/sagernet/sing-dns v0.1.11 // indirect | ||
go4.org/netipx v0.0.0-20230824141953-6213f710f925 // indirect | ||
golang.org/x/crypto v0.15.0 // indirect | ||
golang.org/x/mod v0.13.0 // indirect | ||
golang.org/x/mod v0.14.0 // indirect | ||
golang.org/x/net v0.18.0 // indirect | ||
golang.org/x/sys v0.14.0 // indirect | ||
golang.org/x/tools v0.14.0 // indirect | ||
golang.org/x/tools v0.15.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters