Merge branch 'Loyalsoldier:master' into master #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build geoip files | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 4" | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- ".gitignore" | |
- "LICENSE*" | |
- "*.md" | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout codebase | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: ./go.mod | |
- name: Set variables | |
run: | | |
echo "TAG_NAME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV | |
echo "RELEASE_NAME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV | |
shell: bash | |
- name: Build geoip files | |
run: | | |
go build ./ | |
./geoip convert -c ./config.json | |
- name: Move files to publish directory | |
run: | | |
mkdir -p publish | |
cp -fpPR ./output/text ./publish | |
cp -fpPR ./output/srs ./publish | |
- name: Git push assets to "release" branch | |
run: | | |
cd output || exit 1 | |
git init | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git checkout -b release | |
git add -A | |
git commit -m "${{ env.RELEASE_NAME }}" | |
git remote add geoip "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" | |
git push -f -u geoip release |