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

ci: use wp-cli i18n command instead of pb-cli #81

Merged
merged 7 commits into from Jun 6, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 13 additions & 14 deletions .github/workflows/update-pot.yml
Expand Up @@ -16,19 +16,18 @@ jobs:
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
tools: composer, wp-cli
- name: Install dependencies
run: |
wp package install wp-cli/i18n-command:2.2.8
cd /home/runner/.wp-cli/packages/
composer config repositories.wp-cli '{"type": "composer","url": "https://wp-cli.org/package-index/","canonical": false}'
cd ./
wp package install pressbooks/pb-cli:2.1.0
php-version: '7.4'
tools: composer, wp-cli/wp-cli-bundle
- name: Update POT file
run: wp pb make-pot . languages/pressbooks-cas-sso.pot --require=vendor/autoload.php --domain=pressbooks-cas-sso --slug=pressbooks-cas-sso --package-name="Pressbooks CAS SSO" --headers="{\"Report-Msgid-Bugs-To\":\"https://github.com/pressbooks/pressbooks-cas-sso/issues\"}"
- name: Commit updated POT file
uses: stefanzweifel/git-auto-commit-action@v4.13.1
run: wp i18n make-pot . languages/pressbooks-cas-sso.pot --domain=pressbooks-cas-sso --slug=pressbooks-cas-sso --package-name="Pressbooks CAS Single Sign-On" --headers="{\"Report-Msgid-Bugs-To\":\"https://github.com/pressbooks/pressbooks-cas-sso/issues\"}"
# Remove this step once you are satisfied with the results; alternatively, you can leave it in place and remove
# the commented out step that follows.
- name: Open PR with changes
uses: peter-evans/create-pull-request@v4
with:
commit_message: 'chore(l10n): update languages/pressbooks-cas-sso.pot'
file_pattern: '*.pot'
title: 'chore(l10n): update languages/pressbooks-cas-sso.pot'
# - name: Commit updated POT file
# uses: stefanzweifel/git-auto-commit-action@v4.13.1
# with:
# commit_message: 'chore(l10n): update languages/pressbooks-cas-sso.pot'
# file_pattern: '*.pot'
23 changes: 16 additions & 7 deletions .github/workflows/update-translations.yml
Expand Up @@ -15,12 +15,21 @@ jobs:
run: tx pull --all --force --minimum-perc=25
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Install xgettext
run: sudo apt-get install -y gettext
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer, wp-cli/wp-cli-bundle
- name: Generate MO files
run: for file in languages/*.po ; do msgfmt $file -o `echo $file | sed 's/\(.*\.\)po/\1mo/'` ; done
- name: Commit updated translation files
uses: stefanzweifel/git-auto-commit-action@v4.13.1
run: wp i18n make-mo languages
# Remove this step once you are satisfied with the results; alternatively, you can leave it in place and remove
# the commented out step that follows.
- name: Open PR with changes
uses: peter-evans/create-pull-request@v4
with:
commit_message: 'chore(l10n): update translations'
file_pattern: '*.mo *.po'
title: 'chore(l10n): update translations'
# - name: Commit updated translation files
# uses: stefanzweifel/git-auto-commit-action@v4.13.1
# with:
# commit_message: 'chore(l10n): update translations'
# file_pattern: '*.mo'