Skip to content

Commit

Permalink
Support Go module
Browse files Browse the repository at this point in the history
  • Loading branch information
Loyalsoldier committed Oct 19, 2020
1 parent baf0173 commit 31a2f2a
Show file tree
Hide file tree
Showing 4 changed files with 343 additions and 9 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ jobs:
with:
go-version: "^1.14.4"

- name: Set $GOPATH and release variables
- name: Set variables
run: |
echo "TAG_NAME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
echo "RELEASE_NAME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
echo "REPO_URL=github.com/${{ github.repository }}" >> $GITHUB_ENV
echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV
echo "$(dirname $GITHUB_WORKSPACE)/bin" >> $GITHUB_PATH
shell: bash

- name: Checkout codebase
uses: actions/checkout@v2.3.3

- name: Get GeoLite2
env:
LICENSE_KEY: ${{ secrets.MAXMIND_GEOLITE2_LICENSE }}
Expand All @@ -38,8 +38,8 @@ jobs:
- name: Build geoip.dat file
run: |
go get -u -v -insecure $REPO_URL
geoip --country=./geoip/GeoLite2-Country-Locations-en.csv --ipv4=./geoip/GeoLite2-Country-Blocks-IPv4.csv --ipv6=./geoip/GeoLite2-Country-Blocks-IPv6.csv --ipv4CN=https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt
go mod download
go run ./ --country=./geoip/GeoLite2-Country-Locations-en.csv --ipv4=./geoip/GeoLite2-Country-Blocks-IPv4.csv --ipv6=./geoip/GeoLite2-Country-Blocks-IPv6.csv --ipv4CN=https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt
- name: Generate geoip.dat sha256 hash
run: |
Expand All @@ -53,8 +53,8 @@ jobs:
git checkout -b release
git add geoip.dat geoip.dat.sha256sum
git commit -m "${{ env.RELEASE_NAME }}"
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git push -f -u origin release
git remote add geoip "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git push -f -u geoip release
- name: Create a release
id: create_release
Expand Down
10 changes: 10 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module github.com/Loyalsoldier/geoip

go 1.15

require (
google.golang.org/protobuf v1.25.0
v2ray.com/core v4.19.1+incompatible
)

replace v2ray.com/core => github.com/v2fly/v2ray-core v0.0.0-20201018063859-834c80836e5c
Loading

0 comments on commit 31a2f2a

Please sign in to comment.