77#
88# 1. Replaces x-release-please-version placeholders with actual version
99# 2. Updates the Upgrade Notice section in readme.txt if there are breaking changes
10+ # 3. Regenerates the POT file for translations (if languages/ directory exists)
1011#
1112# The workflow identifies release-please PRs by:
1213# - Branch name starting with "release-please--"
@@ -27,8 +28,8 @@ permissions:
2728 pull-requests : write
2829
2930jobs :
30- update-upgrade-notice :
31- name : Update Upgrade Notice
31+ update-release-pr :
32+ name : Update Release PR
3233 # Only run on release-please PRs
3334 if : startsWith(github.head_ref, 'release-please--')
3435 runs-on : ubuntu-latest
4546 with :
4647 node-version : " 22"
4748
49+ - name : Install WP-CLI
50+ run : |
51+ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
52+ chmod +x wp-cli.phar
53+ sudo mv wp-cli.phar /usr/local/bin/wp
54+ wp --info
55+
4856 - name : Extract version and component from PR
4957 id : version_info
5058 run : |
@@ -127,6 +135,30 @@ jobs:
127135 --version=${{ steps.version_info.outputs.version }} \
128136 --plugin-dir=${{ steps.version_info.outputs.plugin_dir }}
129137
138+ - name : Check for languages directory
139+ id : i18n
140+ run : |
141+ PLUGIN_DIR="${{ steps.version_info.outputs.plugin_dir }}"
142+ if [ -d "${PLUGIN_DIR}/languages" ]; then
143+ echo "enabled=true" >> $GITHUB_OUTPUT
144+ echo "Languages directory found - will regenerate POT file"
145+ else
146+ echo "enabled=false" >> $GITHUB_OUTPUT
147+ echo "No languages directory - skipping POT generation"
148+ fi
149+
150+ - name : Regenerate POT file
151+ if : steps.i18n.outputs.enabled == 'true' && steps.version_info.outputs.version != ''
152+ working-directory : ${{ steps.version_info.outputs.plugin_dir }}
153+ run : |
154+ COMPONENT="${{ steps.version_info.outputs.component }}"
155+ wp i18n make-pot . languages/${COMPONENT}.pot \
156+ --slug=${COMPONENT} \
157+ --domain=${COMPONENT} \
158+ --include=src,access-functions.php,*.php \
159+ --exclude=node_modules,vendor,tests,build,packages
160+ echo "POT file regenerated: languages/${COMPONENT}.pot"
161+
130162 - name : Check for changes
131163 id : changes
132164 run : |
@@ -156,5 +188,5 @@ jobs:
156188 git config --local user.email "github-actions[bot]@users.noreply.github.com"
157189 git config --local user.name "github-actions[bot]"
158190 git add "$PLUGIN_DIR"
159- git commit -m "chore: replace x-release-please-version placeholders and update upgrade notice for ${COMPONENT}"
191+ git commit -m "chore: replace x-release-please-version placeholders, update upgrade notice, and regenerate translations for ${COMPONENT}"
160192 git push
0 commit comments