mirror of
https://github.com/P3TERX/GeoLite.mmdb.git
synced 2026-09-05 23:05:48 +08:00
GitHub Actions: Upload to Releases
This commit is contained in:
parent
849a5100ff
commit
886436aac1
46
.github/workflows/GeoLite.yml
vendored
46
.github/workflows/GeoLite.yml
vendored
@ -1,18 +1,20 @@
|
|||||||
#=================================================
|
#
|
||||||
|
# Copyright (c) 2020-2021 P3TERX <https://p3terx.com>
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the MIT License.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
# https://github.com/P3TERX/GeoLite.mmdb
|
# https://github.com/P3TERX/GeoLite.mmdb
|
||||||
# Description: Publish GeoLite.mmdb
|
# Description: Publish GeoLite.mmdb
|
||||||
# Lisence: MIT
|
#
|
||||||
# Author: P3TERX
|
|
||||||
# Blog: https://p3terx.com
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
name: Publish GeoLite.mmdb
|
name: Publish GeoLite.mmdb
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
repository_dispatch:
|
||||||
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0 22 */3 * *
|
- cron: 0 1 */3 * *
|
||||||
# watch:
|
|
||||||
# types: started
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
@ -22,13 +24,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Download GeoLite.mmdb
|
- name: Download GeoLite.mmdb
|
||||||
run: |
|
run: |
|
||||||
wget -nv -O- "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&license_key=${LICENSE_KEY}&suffix=tar.gz" | tar zxvC .
|
wget -nv -O- "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&license_key=${{ secrets.LICENSE_KEY }}&suffix=tar.gz" | tar zxv
|
||||||
wget -nv -O- "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${LICENSE_KEY}&suffix=tar.gz" | tar zxvC .
|
wget -nv -O- "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${{ secrets.LICENSE_KEY }}&suffix=tar.gz" | tar zxv
|
||||||
wget -nv -O- "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=${LICENSE_KEY}&suffix=tar.gz" | tar zxvC .
|
wget -nv -O- "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=${{ secrets.LICENSE_KEY }}&suffix=tar.gz" | tar zxv
|
||||||
mkdir -p upload
|
mkdir -p upload
|
||||||
cp -v GeoLite*/*.mmdb upload
|
cp -v GeoLite*/*.mmdb upload
|
||||||
env:
|
echo "TAG_NAME=$(date +"%Y.%m.%d")" >> $GITHUB_ENV
|
||||||
LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
|
|
||||||
|
|
||||||
- name: Push to "download" branch
|
- name: Push to "download" branch
|
||||||
run: |
|
run: |
|
||||||
@ -38,6 +39,23 @@ jobs:
|
|||||||
git config user.email "${{ github.actor }}@users.noreply.github.com"
|
git config user.email "${{ github.actor }}@users.noreply.github.com"
|
||||||
git checkout -b download
|
git checkout -b download
|
||||||
git add .
|
git add .
|
||||||
git commit -m "$(date +"%Y.%m.%d")"
|
git commit -m "${{ env.TAG_NAME }}"
|
||||||
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
|
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
|
||||||
git push -f origin download
|
git push -f origin download
|
||||||
|
|
||||||
|
- name: Upload to Releases
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ env.TAG_NAME }}
|
||||||
|
body: ${{ env.TAG_NAME }}
|
||||||
|
files: upload/*.mmdb
|
||||||
|
|
||||||
|
- name: Remove old Releases
|
||||||
|
uses: dev-drprasad/delete-older-releases@v0.2.0
|
||||||
|
with:
|
||||||
|
keep_latest: 2
|
||||||
|
delete_tags: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
2
.github/workflows/LICENSE
vendored
2
.github/workflows/LICENSE
vendored
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020 P3TERX
|
Copyright (c) 2020-2021 P3TERX
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user