-
Notifications
You must be signed in to change notification settings - Fork 33
106 lines (92 loc) · 4.46 KB
/
core-get-language-source-v5.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# This workflow fetches the V5 Version of the Joomla CMS and syncs the needed source language files
# into the core-translations repository. After this it creates a new commit
name: J5 Get Core Source Language files
on:
# Runs once a day at 7:12
schedule:
- cron: '12 7 * * *'
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
jobs:
build:
if: (github.event_name == 'schedule' && github.repository == 'joomla/core-translations') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fetch and extract core j5 cms
run: |
cd ..
ls -l
wget -nv "https://github.com/joomla/joomla-cms/archive/refs/heads/5.2-dev.zip" -O joomla.zip
unzip joomla.zip
mv joomla-cms-*-dev joomla-cms
- name: Syncing j5 directories
# We use a simple copy paste syntax here if needed customization for different directories
run: |
cd ..
REPO_NAME=${{ github.event.repository.name }}
SYNC_VERION="v5"
SYNC_PATH="administrator/language/en-GB/"
echo /${SYNC_PATH}
mkdir -p ${REPO_NAME}/joomla_${SYNC_VERION}/source/${SYNC_PATH}
rsync -i -rptgo --checksum --ignore-times --delete joomla-cms/${SYNC_PATH} ${REPO_NAME}/joomla_${SYNC_VERION}/source/${SYNC_PATH}
SYNC_PATH="administrator/manifests/packages/"
SYNC_FILE="administrator/manifests/packages/pkg_en-GB.xml"
echo /${SYNC_FILE}
mkdir -p ${REPO_NAME}/joomla_${SYNC_VERION}/source/${SYNC_PATH}
rsync -i -rptgo --checksum --ignore-times --delete joomla-cms/${SYNC_FILE} ${REPO_NAME}/joomla_${SYNC_VERION}/source/${SYNC_FILE}
SYNC_PATH="api/language/en-GB/"
echo /${SYNC_PATH}
mkdir -p ${REPO_NAME}/joomla_${SYNC_VERION}/source/${SYNC_PATH}
rsync -i -rptgo --checksum --ignore-times --delete joomla-cms/${SYNC_PATH} ${REPO_NAME}/joomla_${SYNC_VERION}/source/${SYNC_PATH}
SYNC_PATH="installation/language/en-GB/"
echo /${SYNC_PATH}
mkdir -p ${REPO_NAME}/joomla_${SYNC_VERION}/source/${SYNC_PATH}
rsync -i -rptgo --checksum --ignore-times --delete joomla-cms/${SYNC_PATH} ${REPO_NAME}/joomla_${SYNC_VERION}/source/${SYNC_PATH}
SYNC_PATH="language/en-GB/"
echo /${SYNC_PATH}
mkdir -p ${REPO_NAME}/joomla_${SYNC_VERION}/source/${SYNC_PATH}
rsync -i -rptgo --checksum --ignore-times --delete joomla-cms/${SYNC_PATH} ${REPO_NAME}/joomla_${SYNC_VERION}/source/${SYNC_PATH}
- name: Push j5 to repo
run: |
git config user.name Translation Bot
git config user.email [email protected]
git status
git add .
git diff --quiet && git diff --staged --quiet || git commit -am "J5 Source Language update on `date +'%Y-%m-%d'`"
git push
synchronize-with-crowdin:
needs: build
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v4
# Runs the Crowdin action command - https://github.com/crowdin/github-action
- name: crowdin action package files
uses: crowdin/[email protected]
with:
# Upload sources to Crowdin
upload_sources: true
# Option to specify a path to the configuration file, without / at the beginning
config: 'Configurations/Crowdin-J5-All.yml'
# Upload sources to Crowdin branch
crowdin_branch_name: JoomlaV5
# Use true for dryrun to test the run without actually processing anything
dryrun_action: false
- name: crowdin action installer files
uses: crowdin/[email protected]
with:
# Upload sources to Crowdin
upload_sources: true
# Option to specify a path to the configuration file, without / at the beginning
config: 'Configurations/Crowdin-J5-Installer.yml'
# Upload sources to Crowdin branch
crowdin_branch_name: JoomlaV5
# Use true for dryrun to test the run without actually processing anything
dryrun_action: false