Skip to content

update

update #1471

Workflow file for this run

name: update
on:
schedule:
- cron: '30 11 * * *'
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.22.1'
- name: Update
run: |
git clone https://${GEOIP_TOKEN}@github.com/${GITHUB_REPOSITORY}
cd iploc
python3 update-db.py
go test -v
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if git commit -m "update db" -a; then
tag=$(date -u +v1.0.%Y%m%d)
sed -i -E "s#const Version = .+#const Version = \"$tag\"#g" iploc.go
git commit --amend -a --no-edit
git tag ${tag}
git push origin master
git push origin --tags
fi
true
env:
GEOIP_TOKEN: ${{ secrets.GEOIP_TOKEN }}