Fix: compatible with Go v1.16 (#422)

The flag `--insecure` in go get command has been deprecated in Go v1.16

Fixes #421
Fixes #420
This commit is contained in:
Loyalsoldier
2021-02-25 12:35:05 +08:00
committed by GitHub
parent 4449fcb890
commit 36f0a37aea
5 changed files with 71 additions and 140 deletions

View File

@ -14,24 +14,24 @@ jobs:
- name: Setup Go 1.x.y
uses: actions/setup-go@v2
with:
go-version: ^1.15
go-version: ^1.16
- name: Set $GOPATH and more variables
- name: Set variables
run: |
echo "RELEASE_NAME=$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
echo "TAG_NAME=$(date +%Y%m%d%H%M%S)" >> $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: Go get project code
run: |
go get -v -insecure $REPO_URL
- name: Checkout codebase
uses: actions/checkout@v2.3.4
with:
path: code
- name: Build dlc.dat file
run: |
domain-list-community --datapath=${{ env.GOPATH }}/src/${{ env.REPO_URL }}/data --exportlists=category-ads-all,tld-cn,cn,tld-\!cn,geolocation-\!cn,apple,icloud
cd code || exit 1
go run ./ --outputdir=../ --exportlists=category-ads-all,tld-cn,cn,tld-\!cn,geolocation-\!cn,apple,icloud
cd ../ && rm -rf code
- name: Generate dlc.dat sha256 hash
run: |
@ -53,7 +53,7 @@ jobs:
git config --local user.name "actions"
git config --local user.email "action@github.com"
git checkout -b release
git add *.txt dlc.dat dlc.dat.sha256sum dlc.dat.zip dlc.dat.zip.sha256sum dlc.dat.xz dlc.dat.xz.sha256sum
git add *.txt *.sha256sum dlc.dat dlc.dat.zip dlc.dat.xz
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