From a7b3fbced2a23f8c5291e6ea247dea2b28037e96 Mon Sep 17 00:00:00 2001 From: Hao Date: Mon, 30 Sep 2019 00:01:48 +0800 Subject: Update go.yml Update go.yml --- .github/workflows/go.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/go.yml (limited to '.github/workflows') 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 + -- cgit v1.3.1