-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (64 loc) · 2.32 KB
/
PersianCorrection.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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 }}