Synchronization GEO Asset #81
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: Synchronization GEO Asset | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- "**/README.md" | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.19.5" | |
- name: Build geosite | |
id: build_site | |
run: | | |
cd sing-geosite | |
go run -v . | |
- name: Build geoip | |
id: build_ip | |
run: | | |
cd sing-geoip | |
go run -v . | |
- name: Set timezone to WIB Jakarta | |
uses: szenius/[email protected] | |
with: | |
timezoneLinux: "Asia/Jakarta" | |
timezoneMacos: "Asia/Jakarta" | |
timezoneWindows: "Indonesia Standard Time" | |
- name: Get current time | |
id: time | |
run: echo "::set-output name=time::$(date +'%Y%m%d%H%M%S')" | |
- name: Create a release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.time.outputs.time }} | |
release_name: ${{ steps.time.outputs.time }} | |
draft: false | |
prerelease: false | |
- name: Release geosite.db | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./sing-geosite/geosite.db | |
asset_name: geosite.db | |
asset_content_type: application/octet-stream | |
- name: Release geoip.db | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./sing-geoip/geoip.db | |
asset_name: geoip.db | |
asset_content_type: application/octet-stream | |
- name: Release geoip-cn.db | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./sing-geoip/geoip-cn.db | |
asset_name: geoip-cn.db | |
asset_content_type: application/octet-stream | |
- name: Delete Old Release | |
uses: dev-drprasad/[email protected] | |
with: | |
repo: malikshi/sing-box-geo | |
keep_latest: 1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |