New translations subtitles.csv (Multilingual) #43
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: Update Translations and Create PAYDAY Mod Release | |
on: | |
push: | |
paths: | |
- 'Crowdin/translated/**' | |
- 'converter.py' | |
jobs: | |
update_translations: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pandas | |
- name: Run translation script | |
run: python converter.py | |
- name: Commit and push changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --local user.name "GitHub Actions" | |
git config --local user.email "actions@github.com" | |
git add . | |
git commit -m "Automated Lua file update" || echo "No changes to commit" | |
git push "https://${GITHUB_TOKEN}@github.com/Parapando/Payday-2-UA.git" HEAD:crowdin_sync | |
create_release: | |
runs-on: windows-latest | |
needs: update_translations | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: crowdin_sync | |
- name: Delete Existing Release | |
uses: ame-yu/action-delete-latest-release@v2 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Archive Mod | |
run: | | |
.\.github\7za.exe -tzip a ".\pd2_ualoc.zip" ".\Ukrainian Localization" | |
shell: powershell | |
- name: Create New Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: pd2_ualoc | |
release_name: Release pd2_ualoc | |
draft: false | |
prerelease: false | |
body: | | |
This release zip is automatically updated on every push. You can ignore the "x commits behind" message. | |
- name: Upload Mod Zip to Release | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./pd2_ualoc.zip | |
asset_name: pd2_ualoc.zip | |
asset_content_type: application/zip | |
- name: Hash mod and create mod meta file | |
id: create_meta_file | |
run: | | |
$(cat .\.github\meta.json).Replace("%HASH%", $(./.github/hash.exe "./Ukrainian Localization").Substring(17)) > ./meta.json | |
- name: Upload meta file to Release | |
id: upload-meta-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./meta.json | |
asset_name: meta.json | |
asset_content_type: application/json |