Merge pull request #19 from boxuk/dependabot/npm_and_yarn/wordpress/e… #28
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" | |
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: mv .deployignore .gitignore | |
- name: Split Monorepo | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
uses: "symplify/monorepo-split-github-action@v2.3.0" | |
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: "developers@boxuk.com" | |
- name: Split Monorepo with Tag | |
if: "startsWith(github.ref, 'refs/tags/')" | |
uses: "symplify/monorepo-split-github-action@v2.3.0" | |
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: "developers@boxuk.com" |