diff options
| author | Kslr <[email protected]> | 2019-12-29 10:45:39 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-12-29 10:45:39 +0800 |
| commit | abf285db8c7fac4e0169e342799ddc9029bb98e2 (patch) | |
| tree | 5e1ed71c69c7ff06181da3b6d1e9645baa1531c5 | |
| parent | b0f012b21a958c71aeedc09e3d62bcc074bccbf5 (diff) | |
| parent | 5d7f9beef1e46afcc4d2d55fe47489441483c83c (diff) | |
Merge pull request #9 from Loyalsoldier/master
Fix bugs and refine
| -rw-r--r-- | .github/workflows/go.yml | 74 |
1 files changed, 38 insertions, 36 deletions
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 24c9058f..86e915e3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,45 +1,47 @@ -name: Go +name: Build geoip.dat + on: schedule: - - cron: 0 0 * * 3 -jobs: + - cron: "0 0 * * 3" + push: + branches: + - master +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: Set up Go 1.13 + uses: actions/setup-go@v1 + with: + go-version: 1.13 + id: go - - 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 -v -insecure 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: Set GOPATH and release variables + run: | + echo "::set-env name=TAG_NAME::$(date +%Y%m%d%H%M)" + echo "::set-env name=NAME::$(date +%Y%m%d%H%M)" + echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)" + echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin" + shell: bash - - name: Release - uses: Ricky-Hao/action-release@master - env: - GITHUB_TOKEN: ${{ secrets.TOKEN }} - ASSET_PATH: publish + - name: Get GeoLite2 + run: | + curl -L -O https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip + unzip GeoLite2-Country-CSV.zip + rm -f GeoLite2-Country-CSV.zip + mv GeoLite2* geoip + + - name: Build + run: | + go get -u -v -insecure github.com/v2ray/geoip + geoip --country=./geoip/GeoLite2-Country-Locations-en.csv --ipv4=./geoip/GeoLite2-Country-Blocks-IPv4.csv --ipv6=./geoip/GeoLite2-Country-Blocks-IPv6.csv + mkdir ./publish + mv ./geoip.dat ./publish/ + + - name: Release + uses: Ricky-Hao/action-release@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ASSET_PATH: publish |
