Skip to content
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
6 changes: 6 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,10 @@ On every release PR, `scripts/sync-versions.sh` copies the version from `.releas
bash scripts/sync-versions.sh
```

Right after it, `scripts/make-pot.sh` regenerates `plugins/presence-api/languages/presence-api.pot` with WP-CLI, skipping everything in the plugin's `.distignore`, so the template ships with the release it names. It needs [WP-CLI](https://wp-cli.org/) to run locally:

```bash
bash scripts/make-pot.sh
```

</details>
10 changes: 10 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ jobs:
persist-credentials: false
ref: ${{ matrix.pr.headBranchName }}
- run: bash scripts/sync-versions.sh
# Regenerated after the version sync so the template's
# `Project-Id-Version` names the release it ships in.
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
if: ${{ endsWith(matrix.pr.headBranchName, '--components--presence-api') }}
with:
php-version: '8.3'
tools: wp-cli:2.12.0
- name: Regenerate the translation template
if: ${{ endsWith(matrix.pr.headBranchName, '--components--presence-api') }}
run: bash scripts/make-pot.sh
- name: Sync contributors from release props
if: ${{ endsWith(matrix.pr.headBranchName, '--components--presence-api') }}
env:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/workflow-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ on:
branches: [main]
paths:
- '.github/scripts/**'
- 'scripts/make-pot.sh'
pull_request:
paths:
- '.github/scripts/**'
- 'scripts/make-pot.sh'

# Disable permissions for all available scopes by default.
# Any needed permissions should be configured at the job level.
Expand All @@ -28,3 +30,27 @@ jobs:

- name: Run tests
run: node --test .github/scripts/*.test.js

# scripts/make-pot.sh otherwise runs only on a release-please branch, so a
# broken WP-CLI setup would first surface as a failed release PR sync.
make-pot:
name: Regenerate the translation template
runs-on: ubuntu-24.04
permissions:
contents: read
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: '8.3'
tools: wp-cli:2.12.0

- name: Regenerate and check the template is current
run: |
bash scripts/make-pot.sh
git diff --exit-code -- plugins/presence-api/languages/presence-api.pot
Loading
Loading