mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 02:00:41 +00:00
Read Crowdin API key from GitHub Secrets
This commit is contained in:
parent
6a3273d306
commit
5ac64932d0
5
.github/workflows/crowdin.yml
vendored
5
.github/workflows/crowdin.yml
vendored
@ -23,6 +23,9 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Crowdin Sync
|
||||
shell: bash
|
||||
env:
|
||||
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
|
||||
run: |
|
||||
cd intl
|
||||
python3 crowdin_sync.py
|
||||
python3 crowdin_sync.py "$CROWDIN_API_KEY"
|
||||
|
@ -1,5 +1,5 @@
|
||||
"project_identifier": "retroarch"
|
||||
"api_key": "07c53d49b32e30803060b1acec1623ab"
|
||||
"api_key": "_secret_"
|
||||
"preserve_hierarchy": true
|
||||
|
||||
"files":
|
||||
|
@ -3,10 +3,28 @@
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import urllib.request
|
||||
import zipfile
|
||||
|
||||
# Check Crowdin API Key
|
||||
if len(sys.argv) < 1:
|
||||
print('Please Provides Crowdin API Key!')
|
||||
exit()
|
||||
|
||||
api_key = sys.argv[1]
|
||||
|
||||
# Apply Crowdin API Key
|
||||
crowdin_config_file = open('crowdin.yaml', 'r')
|
||||
crowdin_config = crowdin_config_file.read()
|
||||
crowdin_config_file.close()
|
||||
crowdin_config = crowdin_config.replace('_secret_', api_key)
|
||||
crowdin_config_file = open('crowdin.yaml', 'w')
|
||||
crowdin_config_file.write(crowdin_config)
|
||||
crowdin_config_file.close()
|
||||
|
||||
# Download Crowdin CLI
|
||||
dir_path = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
jar_name = 'crowdin-cli.jar'
|
||||
@ -48,3 +66,12 @@ for file in os.listdir(dir_path):
|
||||
|
||||
print('fetch translation progress')
|
||||
subprocess.run(['python3', 'fetch_progress.py'])
|
||||
|
||||
# Reset Crowdin API Key
|
||||
crowdin_config_file = open('crowdin.yaml', 'r')
|
||||
crowdin_config = crowdin_config_file.read()
|
||||
crowdin_config_file.close()
|
||||
crowdin_config = crowdin_config.replace(api_key, '_secret_')
|
||||
crowdin_config_file = open('crowdin.yaml', 'w')
|
||||
crowdin_config_file.write(crowdin_config)
|
||||
crowdin_config_file.close()
|
||||
|
Loading…
Reference in New Issue
Block a user