Download & Release GeoLite Country and ASN Databases #151
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: Download & Release GeoLite Country and ASN Databases | |
on: | |
workflow_dispatch: # enable manual run | |
inputs: | |
git-ref: | |
description: Git Ref (Optional) | |
required: false | |
schedule: | |
- cron: '18 10 * * 5' # At 10:18 on Friday. | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Download files | |
env: | |
MAXMIND_LICENSE_KEY: ${{ secrets.MAXMIND_LICENSE_KEY }} | |
run : | | |
python main.py | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | |
- name: Empty commit push | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "robotcuk" | |
git commit --allow-empty -m "MaxMind Files Updated: ${{ steps.date.outputs.date }}" | |
git tag -a ${{ steps.date.outputs.date }} -m "Database Update: ${{ steps.date.outputs.date }}" | |
git push origin ${{ steps.date.outputs.date }} | |
git push origin -f master | |
env: | |
GITHUB_TOKEN: ${{ secrets.ROBOTCUK }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.date.outputs.date }} | |
release_name: MaxMind Databases Weekly Update - Date ${{ steps.date.outputs.date }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Assets | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./data/*.tar.gz | |