-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (66 loc) · 2.19 KB
/
PersianCorrectionPython.yml
File metadata and controls
75 lines (66 loc) · 2.19 KB
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
75
name: Translation Workflow
on:
push:
branches:
- main
workflow_dispatch:
inputs:
release_version:
description: 'Release version (e.g. v0.3.2)'
required: true
default: 'v0.3.1'
release_type:
description: 'Type of release to create'
required: true
default: 'stable'
type: choice
options:
- none
- stable
- prerelease
env:
ACTIONS_RUNNER_DEBUG: true
jobs:
translation_job:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Python dependencies
run: pip install lxml
- name: Run translation script (Python)
run: |
cd ${{ github.workspace }}
echo "Listing files:"
ls
trans_dir="${{ github.workspace }}/Persian/"
dest_dir="${{ github.workspace }}/Persian/"
cd RTL-Tools-Python
python3 reverse_rtl_text.py "$dest_dir" || { echo "reverse_rtl_text.py failed"; exit 1; }
echo "reverse_rtl_text.py done!"
python3 contextualize_Persian_letters.py "$dest_dir" || { echo "contextualize_Persian_letters.py failed"; exit 1; }
echo "contextualize_Persian_letters.py done!"
echo "Correction complete."
- name: Create ZIP archive
run: |
cd ${{ github.workspace }}
zip -r persian.language.zip ./Persian
- name: Upload ZIP as workflow artifact
uses: actions/upload-artifact@v4
with:
name: persian.language.zip
path: ./persian.language.zip
- name: Create and Upload Release
if: ${{ github.event.inputs.release_type != 'none' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.event.inputs.release_version }} \
--title "Version ${{ github.event.inputs.release_version }}" \
--generate-notes \
${{ github.event.inputs.release_type == 'prerelease' && '--prerelease' || '' }} \
./persian.language.zip