J5 Get Core Source Language files #524
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |