Get Hash File #10
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: Get Hash File | |
on: | |
workflow_dispatch: | |
inputs: | |
message: | |
description: 手动测试 | |
required: false | |
env: | |
DOWNLOAD_DIR: ./download | |
LOG_DIR: ./logs | |
WORK_DIR: ./work | |
jobs: | |
get-list: | |
runs-on: ubuntu-latest | |
container: | |
image: debian:unstable-slim | |
steps: | |
- name: Install dependencies | |
run: | | |
apt-get update | |
apt-get install nodejs python3 python3-pip python3-venv git wget curl -y 1>/dev/null | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Checkout REPO | |
uses: actions/checkout@v4 | |
with: | |
repository: Virace/lol_extract_voice | |
path: lol_extract_voice | |
ref: v3-test | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.12" | |
- name: Download Dependent Programs | |
run: | | |
wget https://github.com/Morilli/ManifestDownloader/releases/latest/download/ManifestDownloader | |
chmod +x ManifestDownloader | |
- name: Download the required wad file | |
run: | | |
mkdir -p $DOWNLOAD_DIR | |
mkdir -p $LOG_DIR | |
mkdir -p $WORK_DIR | |
python3 -m venv .download_venv | |
. .download_venv/bin/activate | |
pip install -r requirements.lock 1>/dev/null | |
python download.py -g c cz -l l lz -o $DOWNLOAD_DIR -d $LOG_DIR -r 5 -m "ManifestDownloader" | |
echo "LOL_GAME_PATH=$(realpath $DOWNLOAD_DIR)" >> .lol.env | |
echo "LOL_GAME_REGION=zh_CN" >> .lol.env | |
echo "LOL_OUTPUT_PATH=$(realpath $WORK_DIR)" >> .lol.env | |
- name: Get File Hash Table | |
run: | | |
python3 -m venv .h.venv | |
. .h.venv/bin/activate | |
pip install -r requirements.lock 1>/dev/null | |
rm .lol.env && mv ../.lol.env .lol.env | |
python -c "from main import init, get_event_audio_hash_table, HASH_MANAGER; init(); HASH_MANAGER.game_data.update_data(); HASH_MANAGER.game_data_default.update_data(); get_event_audio_hash_table(True)" | |
working-directory: lol_extract_voice | |
- name: Compress the hash table file | |
run: | | |
tar -zcf hash.tar.gz "$(realpath $WORK_DIR)/hashes" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: hash | |
path: | | |
hash.tar.gz |