Process Audio Files #9
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 Audio Files | |
on: | |
workflow_dispatch: | |
inputs: | |
message: | |
description: 手动测试 | |
required: false | |
# workflow_run: | |
# workflows: ["Get Hash File"] | |
# types: | |
# - completed | |
env: | |
DOWNLOAD_DIR: ./download | |
LOG_DIR: ./logs | |
WORK_DIR: ./work | |
R_CONFIG: ${{ secrets.R_CONFIG }} | |
jobs: | |
process-data: | |
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 unzip -y 1>/dev/null | |
mkdir -p $DOWNLOAD_DIR | |
mkdir -p $LOG_DIR | |
mkdir -p $WORK_DIR | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Checkout REPO | |
uses: actions/checkout@v4 | |
with: | |
repository: Virace/lol_extract_voice | |
path: lol_extract_voice | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Download artifacts | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
workflow: hash.yml | |
name: hash | |
- name: Unzip Hash Table File | |
run: | | |
mkdir -p $DOWNLOAD_DIR | |
mkdir -p $LOG_DIR | |
mkdir -p $WORK_DIR | |
tar -zxf hash.tar.gz -C "$WORK_DIR" | |
ls -a "$WORK_DIR/hashes" | |
- name: Download Dependent Programs | |
run: | | |
wget https://github.com/Morilli/ManifestDownloader/releases/latest/download/ManifestDownloader | |
chmod +x ManifestDownloader | |
- name: Install rclone and test object storage connectivity | |
run: | | |
mkdir -p ~/.config/rclone | |
echo "$R_CONFIG" | base64 --decode > ~/.config/rclone/rclone.conf | |
curl https://rclone.org/install.sh | bash 1>/dev/null | |
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 1>/dev/null | |
rclone ls yandex:/lol-voice | |
- name: Download the required wad file | |
run: | | |
python3 -m venv .download_venv | |
. .download_venv/bin/activate | |
pip install -r requirements.lock 1>/dev/null | |
python download.py -g 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_EXCLUDE_TYPE='SFX,MUSIC'" >> .lol.env | |
echo "LOL_OUTPUT_PATH=$(realpath $WORK_DIR)" >> .lol.env | |
- name: Get Audio File | |
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 "import sys; from loguru import logger;from main import init, get_lcu_audio, get_game_audio, HASH_MANAGER; logger.configure(handlers=[dict(sink=sys.stdout, level='INFO')]);logger.enable('league_tools'); init(); HASH_MANAGER.game_data.update_data(); get_lcu_audio(); get_game_audio()" | |
working-directory: lol_extract_voice | |
- name: Synchronize files | |
run: | | |
ls -a $(realpath $WORK_DIR)/audios | |
rclone copy --transfers=100 "$(realpath $WORK_DIR)/audios" yandex:/lol-voice |