触发第二次,Test 流程 #4
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: Process VNDB Data | |
on: | |
push: | |
branches: | |
- main # 每main提交时更新 | |
permissions: | |
contents: write | |
actions: write | |
jobs: | |
vndb-process: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install zstandard requests | |
- name: Download and extract VNDB dump | |
run: | | |
python script/dlvndb.py | |
- name: Process JSON data | |
run: | | |
python script/vn_data_json.py | |
- name: Upload to GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
# Define variables | |
RELEASE_TAG="v1.0.0" | |
FILE_PATH="vn_data.json" | |
FILE_NAME="vndb-data-Latest.json" | |
# Upload the file to the existing release | |
RESPONSE=$(curl -s -X POST \ | |
-H "Authorization: token $GITHUB_TOKEN" \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Content-Type: application/zip" \ | |
--data-binary @"$FILE_PATH" \ | |
"https://uploads.github.com/repos/youyou-sudo/vndb-search-datas/releases/173481051/assets?name=$FILE_NAME") | |
echo "Response: $RESPONSE" |