generate addons.json #898
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: generate addons.json | |
concurrency: | |
group: "main" | |
cancel-in-progress: false | |
on: | |
push: | |
paths: | |
- 'addons.py' | |
- 'verified.json' | |
- 'inject.json' | |
- '.github/workflows/addons.yml' | |
schedule: | |
- cron: "0 5 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
architecture: 'x64' | |
# Cache dependencies. From: | |
# https://github.com/actions/cache/blob/master/examples.md#python---pip | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
# Install dependencies with `pip` | |
- name: Install requirements | |
run: | | |
python3 -m pip install --upgrade pip setuptools wheel | |
python3 -m pip install -r requirements.txt | |
- name: Generate JSON files | |
run: | | |
python3 --version | |
python3 addons.py | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
# Commits all changed files to the repository | |
- name: Commit to the repo | |
run: | | |
git config user.name "AntiCope" | |
git config user.email "null" | |
git add . | |
# "echo" returns true so the build succeeds, even if no changed files | |
git commit --amend -m 'Update JSON files' || echo | |
git push --force |