Daily CI #318
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: Daily CI | |
on: | |
schedule: | |
- cron: '30 14 * * *' | |
jobs: | |
new-tag: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set tag | |
run: | | |
DAILY_TAG=$(date +'%Y-%m-%d') | |
echo "DAILY_TAG=$DAILY_TAG" >> $GITHUB_ENV | |
- name: Create Tag | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const {DAILY_TAG} = process.env | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: `refs/tags/${DAILY_TAG}`, | |
sha: context.sha | |
}) | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Build geoip.dat | |
run: | | |
go run ./ -c config-ir.json | |
- name: Move files to publish directory | |
run: | | |
mkdir publish | |
mv output/dat/*.dat publish | |
mv output/text/*.txt publish | |
- name: Publish release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.DAILY_TAG }} | |
name: ${{ env.DAILY_TAG }} | |
prerelease: false | |
draft: false | |
files: "publish/*" |