-
Notifications
You must be signed in to change notification settings - Fork 9
67 lines (64 loc) · 1.92 KB
/
update-output-files.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
name: 'Update output files'
on:
push:
branches: new-system
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
generate-po-artifacts:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Archive po files as artifacts
uses: actions/upload-artifact@v4
with:
name: translation-po
path: po
generate-output:
needs: generate-po-artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout RimTranslate
uses: actions/checkout@v4
with:
repository: 'mtimoustafa/RimTranslate'
- name: Download po files artifacts
uses: actions/download-artifact@v4
with:
name: translation-po
path: po
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12.3'
- name: Install packages
run: python -m pip install -r requirements.txt
- name: Generate output files
run: python RimTranslate.py -p "$(pwd)/po/" -o "$(pwd)/output/"
- name: Archive output files as artifacts
uses: actions/upload-artifact@v4
with:
name: translation-output
path: output
push-output:
needs: generate-output
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download output files artifacts
uses: actions/download-artifact@v4
with:
name: translation-output
path: output
- name: Setup Git
uses: actions4git/setup-git@v1
- name: Git add output files
run: git add output/
- name: Git commit output files
run: if [ -n "$(git diff --cached --exit-code)" ]; then git commit -m "Generate output file for changes"; fi
- name: Git push output files
run: git push