forked from ansible/galaxy_ng
-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (70 loc) · 2.22 KB
/
i18n.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
75
76
77
78
79
80
81
82
83
84
85
---
name: "[i18n] Update translations"
on:
# allow running manually
workflow_dispatch:
# run weekly
schedule:
- cron: '30 5 1 * *'
jobs:
i18n:
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- 'master'
- 'stable-4.6'
- 'stable-4.7'
- 'stable-4.8'
- 'stable-4.9'
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Set up Python
uses: actions/setup-python@v4
- name: Update apt
run: sudo apt -y update
- name: Install LDAP requirements
run: sudo apt-get install -y libsasl2-dev libldap2-dev libssl-dev build-essential gettext python-setuptools
- name: Upgrade pip
run: pip install pip --upgrade
- name: Install galaxy_ng editable
run: pip install -e .
- name: Extract strings
run: |
cd galaxy_ng
django-admin makemessages --all
- name: Check if files were updated
run: |
filesChanged=$(git diff --ignore-matching-lines=POT-Creation-Date)
if [ -z "$filesChanged" ]
then
echo "openPR=false" >> $GITHUB_ENV
else
echo "openPR=true" >> $GITHUB_ENV
fi
shell: bash
- name: Clear fuzzy entries
run: bash .github/workflows/scripts/clear_fuzzy_entries.sh
- name: Compile strings
run: |
cd galaxy_ng
django-admin compilemessages
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Create a Pull Request (only if files were updated)
if: env.openPR == 'true'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
committer: ansible <[email protected]>
author: ansible <[email protected]>
commit-message: |
Automated updated of i18n strings on ${{ env.NOW }}
No-Issue
body: |
No-Issue
title: "[i18n] Update translations ${{ env.NOW }}"
branch: i18n/${{ matrix.branch }}/update-translations-${{ env.NOW }}
base: ${{ matrix.branch }}