-
Notifications
You must be signed in to change notification settings - Fork 137
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
b1dc5b3
commit 6a73749
Showing
10 changed files
with
131 additions
and
129 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-geoip.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
PROJECTS=$(dirname "$0")/../.. | ||
|
||
go get -x github.com/sagernet/sing-box@$(git -C $PROJECTS/sing-box rev-parse HEAD) | ||
go mod tidy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,64 +23,25 @@ jobs: | |
- name: Build geoip | ||
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 geoip.db > geoip.db.sha256sum | ||
sha256sum geoip-cn.db > geoip-cn.db.sha256sum | ||
- uses: dev-drprasad/[email protected] | ||
with: | ||
keep_latest: 3 | ||
keep_latest: 10 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create a release | ||
- name: Release geoip | ||
if: steps.build.outputs.skip != 'true' | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ steps.build.outputs.tag }} | ||
release_name: ${{ steps.build.outputs.tag }} | ||
draft: false | ||
prerelease: false | ||
- name: Release geoip.db | ||
if: steps.build.outputs.skip != 'true' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./geoip.db | ||
asset_name: geoip.db | ||
asset_content_type: application/octet-stream | ||
- name: Release geoip.db sha256sum | ||
if: steps.build.outputs.skip != 'true' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./geoip.db.sha256sum | ||
asset_name: geoip.db.sha256sum | ||
asset_content_type: text/plain | ||
- name: Release geoip-cn.db | ||
if: steps.build.outputs.skip != 'true' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./geoip-cn.db | ||
asset_name: geoip-cn.db | ||
asset_content_type: application/octet-stream | ||
- name: Release geoip.db sha256sum | ||
if: steps.build.outputs.skip != 'true' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./geoip-cn.db.sha256sum | ||
asset_name: geoip-cn.db.sha256sum | ||
asset_content_type: text/plain | ||
files: | | ||
geoip.db | ||
geoip.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,4 +1,5 @@ | ||
/.idea/ | ||
/vendor/ | ||
/*.db | ||
*.mmdb | ||
*.mmdb | ||
/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
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