diff options
| author | Kslr <[email protected]> | 2019-12-12 16:22:03 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-12-12 16:22:03 +0800 |
| commit | 9819982b342e434bb04df10db9eeed5c5064cfed (patch) | |
| tree | e1eb7d87f048fdee67b50572e1b181826e348d4e | |
| parent | 726da4135fc679118c4007e1d792e6d743341a3d (diff) | |
| parent | a7b3fbced2a23f8c5291e6ea247dea2b28037e96 (diff) | |
Merge pull request #6 from Ricky-Hao/master
Add Git Action script
| -rw-r--r-- | .github/workflows/go.yml | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 00000000..15c21068 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,46 @@ +name: Go +on: + schedule: + - cron: 0 0 * * 3 +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.12 + uses: actions/setup-go@v1 + with: + go-version: 1.12 + id: go + + - name: Set GOPATH + run: | + echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)" + echo "##[set-env name=TAG_NAME;]$(date +%Y%m%d)" + echo "##[set-env name=NAME;]$(date +%Y%m%d)" + echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin" + shell: bash + + - name: Get GeoLite2 + run: | + curl -L -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip + unzip GeoLite2-Country-CSV.zip + rm GeoLite2-Country-CSV.zip + mv GeoLite2* geoip + + - name: Build + run: | + go get -u github.com/v2ray/geoip + $GOPATH/bin/geoip --country=./geoip/GeoLite2-Country-Locations-en.csv --ipv4=./geoip/GeoLite2-Country-Blocks-IPv4.csv --ipv6=./geoip/GeoLite2-Country-Blocks-IPv6.csv + export NAME=`date +%Y%m%d` + mkdir ./publish + mv ./geoip.dat ./publish/ + + - name: Release + uses: Ricky-Hao/action-release@master + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} + ASSET_PATH: publish + |
