-
Notifications
You must be signed in to change notification settings - Fork 70
81 lines (69 loc) · 2.57 KB
/
Copy pathupdate_mo_files.yml
File metadata and controls
81 lines (69 loc) · 2.57 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
76
77
78
79
80
81
name: Compile .mo files
on:
workflow_dispatch:
push:
paths:
- ardupilot_methodic_configurator/locale/**/ardupilot_methodic_configurator.po
# prevent race conditions
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
compile-mo-files:
permissions:
contents: write # for creating branches and commits
pull-requests: write # for creating PRs
runs-on: ubuntu-latest
env:
MO_FILES_CHANGED: false
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
with:
egress-policy: audit
- name: Checkout MethodicConfigurator
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.x'
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: Cache apt packages
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
/var/cache/apt/archives/*.deb
/var/lib/apt/lists/*
key: ${{ runner.os }}-apt-gettext-ubuntu2204
restore-keys: |
${{ runner.os }}-apt-gettext-
${{ runner.os }}-apt-
- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y gettext=0.21-14ubuntu2
- name: Compile translation .mo files from the .po files
run: python create_mo_files.py
- name: Stage changes
run: |
git add ardupilot_methodic_configurator/locale/**/ardupilot_methodic_configurator.mo
if [ -n "$(git status --porcelain)" ]; then
echo "MO_FILES_CHANGED=true" >> $GITHUB_ENV
else
echo "No changes to commit"
fi
- name: Create Pull Request
if: env.MO_FILES_CHANGED == 'true'
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
labels: i18n, automated-pr
token: ${{ secrets.GITHUB_TOKEN }}
branch: compile-mo-translation-files
title: "Compile .mo translation files"
commit-message: "chore(translations): Compile translation .mo files from the .po files"
body: |
This PR Compiles .mo files based on the latest changes to .po translation files.
delete-branch: true