J4 Get Core Source Language files #1272
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 V4 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: J4 Get Core Source Language files | |
on: | |
# Runs once a day at 6:12 | |
schedule: | |
- cron: '12 6 * * *' | |
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 j4 cms | |
run: | | |
cd .. | |
ls -l | |
wget -nv "https://github.com/joomla/joomla-cms/archive/refs/heads/4.4-dev.zip" -O joomla.zip | |
unzip joomla.zip | |
mv joomla-cms-*-dev joomla-cms | |
- name: Syncing j4 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="v4" | |
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 j4 to repo | |
run: | | |
git config user.name Translation Bot | |
git config user.email release+translation-bot@joomla.org | |
git status | |
git add . | |
git diff --quiet && git diff --staged --quiet || git commit -am "J4 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/github-action@v2.4.0 | |
with: | |
# Upload sources to Crowdin | |
upload_sources: true | |
# Option to specify a path to the configuration file, without / at the beginning | |
config: 'Configurations/Crowdin-J4-All.yml' | |
# Use true for dryrun to test the run without actually processing anything | |
dryrun_action: false | |
- name: crowdin action installer files | |
uses: crowdin/github-action@v2.4.0 | |
with: | |
# Upload sources to Crowdin | |
upload_sources: true | |
# Option to specify a path to the configuration file, without / at the beginning | |
config: 'Configurations/Crowdin-J4-Installer.yml' | |
# Use true for dryrun to test the run without actually processing anything | |
dryrun_action: false |