Translation Workflow #47
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: Translation Workflow | |
on: | |
push: | |
branches: | |
- main # Replace with the branch name you want to trigger the workflow on | |
workflow_dispatch: # Add manual trigger event | |
env: | |
ACTIONS_RUNNER_DEBUG: true | |
jobs: | |
translation_job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1 # Replace with the version of Ruby you need | |
- name: Install dependencies | |
run: gem install nokogiri # Add installation of 'nokogiri' gem | |
working-directory: ${{ github.workspace }} | |
- name: Run translation script | |
run: | | |
if [ "${{ github.actor }}" = "DanialPahlavan" ]; then | |
cd ${{ github.workspace }} | |
echo list files : | |
ls | |
trans_dir=${{ github.workspace }}/Persian/ | |
dest_dir=${{ github.workspace }}/Persian/ | |
#cp -r ./Persian ./PersianConverted | |
cd rimworld-rtl-translation-tools-PersianModded | |
ruby -r nokogiri ./reverse_rtl_text.rb "$dest_dir" || { echo ""; exit $ERRCODE; } | |
echo "done!" | |
echo "Running contextualize_Persian_letters.rb..." | |
ruby -r nokogiri ./contextualize_Persian_letters.rb "$dest_dir" || { echo ""; exit $ERRCODE; } | |
echo "done!" | |
echo "Correction complete." | |
fi | |
env: | |
ERRCODE: 1 | |
working-directory: ${{ github.workspace }} | |
- name: Create ZIP archive | |
run: | | |
cd ${{ github.workspace }} | |
zip -r persian.language.zip ./Persian | |
working-directory: ${{ github.workspace }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
with: | |
tag_name: v0.2.0 | |
release_name: Version v0.2.0 | |
body: Release v0.2.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload ZIP archive to Release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./persian.language.zip | |
asset_name: persian.language.zip | |
asset_content_type: application/zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |