Release #337
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: Release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 23 * * *" | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Get latest go version | |
id: version | |
run: | | |
echo ::set-output name=go_version::$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') | |
- name: Setup Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ steps.version.outputs.go_version }} | |
- name: Build geoip | |
id: build | |
run: go run -v . | |
- name: Release rule sets | |
if: steps.build.outputs.skip != 'true' | |
run: .github/release-rule-set.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate sha256 hash | |
if: steps.build.outputs.skip != 'true' | |
run: | | |
sha256sum geoip.db > geoip.db.sha256sum | |
sha256sum geoip-cn.db > geoip-cn.db.sha256sum | |
- name: Release release branch | |
if: steps.build.outputs.skip != 'true' | |
run: .github/release-branch.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: dev-drprasad/[email protected] | |
with: | |
keep_latest: 3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release geoip | |
if: steps.build.outputs.skip != 'true' | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.build.outputs.tag }} | |
files: | | |
geoip.db | |
geoip.db.sha256sum | |
geoip-cn.db | |
geoip-cn.db.sha256sum |