Merge pull request #317 from boxuk/BWP-122 #117
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
name: "Packages Split" | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "*" | |
jobs: | |
packages_split: | |
runs-on: ubuntu-latest | |
name: "Publish changes to ${{ matrix.packages.target_repo }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
packages: | |
- local_path: "editor-tools" | |
target_repo: "wp-editor-tools" | |
- local_path: "iconography" | |
target_repo: "wp-iconography" | |
- local_path: "query-include-exclude" | |
target_repo: "wp-query-include-exclude" | |
- local_path: "consent-management" | |
target_repo: "wp-consent-management" | |
- local_path: "email-tld-checker" | |
target_repo: "wordpress-email-tld-checker" | |
- local_path: "deps-auto-update" | |
target_repo: "wp-deps-auto-update" | |
- local_path: "checkout-deps-auto-update" | |
target_repo: "wp-checkout-deps-auto-update" | |
- local_path: "feature-flags" | |
target_repo: "wp-feature-flags" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.BOXUK_WP_ROBOT_ACCESS_TOKEN }} | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install Dependencies | |
run: npm install | |
- name: Build Packages | |
run: npm run build | |
- name: Rename all `.deployignore` files to `.gitignore` in package | |
working-directory: packages/${{ matrix.packages.local_path }} | |
run: | | |
[ ! -f .deployignore ] || mv .deployignore .gitignore | |
- name: Split Monorepo | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
uses: "symplify/[email protected]" | |
env: | |
GITHUB_TOKEN: ${{ secrets.BOXUK_WP_ROBOT_ACCESS_TOKEN }} | |
with: | |
package_directory: "packages/${{ matrix.packages.local_path }}" | |
repository_organization: "boxuk" | |
repository_name: "${{ matrix.packages.target_repo }}" | |
user_name: "boxuk-wp-robot" | |
user_email: "[email protected]" | |
- name: Split Monorepo with Tag | |
if: "startsWith(github.ref, 'refs/tags/')" | |
uses: "symplify/[email protected]" | |
env: | |
GITHUB_TOKEN: ${{ secrets.BOXUK_WP_ROBOT_ACCESS_TOKEN }} | |
with: | |
tag: ${GITHUB_REF#refs/tags/} | |
package_directory: "packages/${{ matrix.packages.local_path }}" | |
repository_organization: "boxuk" | |
repository_name: "${{ matrix.packages.target_repo }}" | |
user_name: "boxuk-wp-robot" | |
user_email: "[email protected]" |