Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK-69003: Apply crowdin workflow to maintenance eXo versions (#1513) #1515

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 94 additions & 28 deletions .github/workflows/download-crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,31 +195,97 @@ jobs:
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
# crowdin-merge-translation-develop-meed:
# needs: [crowdin-download-develop-meed]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# ref: develop-meed
# token: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
# - name: Import GPG key
# uses: crazy-max/ghaction-import-gpg@v5
# with:
# gpg_private_key: ${{ secrets.SWF_GPG_PRIVATE_KEY }}
# passphrase: ${{ secrets.SWF_GPG_PASSPHRASE }}
# git_user_signingkey: true
# git_commit_gpgsign: true
# - name: Merge translation to develop-meed
# run: |
# git fetch origin integration/6.5.x-meed-translation
# git config --global user.email "exo-swf@exoplatform.com"
# git config --global user.name "eXo Software Factory"
# changes_to_apply=$(git merge --squash origin/integration/6.5.x-meed-translation 2>&1)
# if [[ "$changes_to_apply" == *"up to date"* ]]; then
# echo "Nothing to commit"
# else
# git commit -m "Merge Translations"
# git push origin
# fi
crowdin-merge-translation-develop-meed:
needs: [crowdin-download-develop-meed]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: develop-meed
token: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.SWF_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.SWF_GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Merge translation to develop-meed
run: |
git fetch origin integration/${{vars.CROWDIN_DEVELOP_VERSION}}-meed-translation
git config --global user.email "exo-swf@exoplatform.com"
git config --global user.name "eXo Software Factory"
changes_to_apply=$(git merge --squash origin/integration/${{vars.CROWDIN_DEVELOP_VERSION}}-meed-translation 2>&1)
if [[ "$changes_to_apply" == *"up to date"* ]]; then
echo "Nothing to commit"
else
git commit -m "Merge Translations"
git push origin
fi
# stable/x.x.x-exo
reset-branch-integration-stable-exo:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: stable/${{vars.CROWDIN_MAINTENANCE_EXO_VERSION}}
token: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
- name: reset translation branch to stable's
run: |
git push origin origin/develop-meed:refs/heads/integration/${{vars.CROWDIN_MAINTENANCE_EXO_VERSION}}-translation -f
crowdin-download-stable-exo:
needs: [reset-branch-integration-stable-exo]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
ref: integration/${{vars.CROWDIN_MAINTENANCE_EXO_VERSION}}-translation
- name: Crowdin push
uses: crowdin/github-action@v1
with:
upload_sources: false
upload_translations: false
download_translations: true
crowdin_branch_name: ${{vars.CROWDIN_MAINTENANCE_EXO_VERSION}}
localization_branch_name: integration/${{vars.CROWDIN_MAINTENANCE_EXO_VERSION}}-translation
create_pull_request: false
skip_ref_checkout: true
download_translations_args: '-l ar -l aro -l az -l ca -l ceb -l co -l cs -l de -l el -l en -l es-ES -l eu -l fa -l fi
-l fil -l fr -l hi -l hu -l id -l it -l ja -l ko -l lt -l ms -l nl -l no -l pcm -l pl -l pt-BR -l pt-PT -l ro -l ru
-l sk -l sl -l sv-SE -l th -l tl -l tr -l uk -l ur-IN -l vi -l zh-CN -l zh-TW'
env:
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
crowdin-merge-translation-stable-exo:
needs: [crowdin-download-stable-exo]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: stable/${{vars.CROWDIN_MAINTENANCE_EXO_VERSION}}
token: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.SWF_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.SWF_GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Merge translation to stable exo
run: |
git fetch origin integration/${{vars.CROWDIN_MAINTENANCE_EXO_VERSION}}-translation
git config --global user.email "exo-swf@exoplatform.com"
git config --global user.name "eXo Software Factory"
changes_to_apply=$(git merge --squash origin/integration/${{vars.CROWDIN_MAINTENANCE_EXO_VERSION}}-translation 2>&1)
if [[ "$changes_to_apply" == *"up to date"* ]]; then
echo "Nothing to commit"
else
git commit -m "Merge Translations"
git push origin
fi
5 changes: 4 additions & 1 deletion .github/workflows/upload-crowdin-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
branches:
- develop-exo
- develop-meed
- stable/*

jobs:
check-translation-change:
Expand Down Expand Up @@ -58,7 +59,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: "extract branch name"
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
run: |
branch_ref=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | sed 's/stable\///g');
echo "branch=$branch_ref" >> $GITHUB_OUTPUT;
id: extract_branch
- name: Crowdin push
uses: crowdin/github-action@v1
Expand Down
Loading