Build #22572
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: Build | |
on: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- 'master' | |
schedule: | |
- cron: '21 * * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Update list | |
run: | | |
python main.py | |
- name: Check if vup.json updated | |
id: git | |
run: | | |
echo "$(git --no-pager diff --name-only | grep -E '^(dist/vup.json)')" | |
echo "file_changes=$(git --no-pager diff --name-only | grep -E '^(dist/vup.json)')" >> $GITHUB_OUTPUT | |
- name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v6 | |
if: github.event_name != 'pull_request' | |
with: | |
gpg_private_key: ${{ secrets.GPG_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
git_tag_gpgsign: true | |
- uses: signcl/git-auto-commit-action@master | |
if: github.event_name != 'pull_request' | |
with: | |
commit_message: "chore: update list" | |
commit_options: "-S" | |
commit_user_name: Sparanoid Bot | |
commit_user_email: bot@sparanoid.com | |
commit_author: Sparanoid Bot <bot@sparanoid.com> | |
branch: master | |
- name: Notify bilibili-space | |
if: ${{ github.event_name != 'pull_request' && steps.git.outputs.file_changes }} | |
run: | | |
curl -X POST -H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: Bearer ${{ secrets.PAT_SPARANOID }}" \ | |
https://api.github.com/repos/sparanoid/bilibili-space/dispatches \ | |
-d '{"event_type":"webhook"}' |