-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
57 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"sub-splits": [ | ||
{ | ||
"name": "core", | ||
"directory": "packages/sprinkle-core", | ||
"target": "git@github.com:userfrosting/sprinkle-core.git" | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,47 @@ | ||
name: Monorepo Split | ||
|
||
on: | ||
push: | ||
branches: ['*'] | ||
tags: ['*'] | ||
workflow_dispatch: | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
# Only trigger for specific branches or changes in specific paths. | ||
branches: | ||
- "*" | ||
# paths: | ||
# - src/** | ||
# Tag push events should be ignored, they will be handled with the create event below. | ||
tags-ignore: | ||
- "*" | ||
# create: | ||
# tags: | ||
# - "*" | ||
# delete: | ||
# tags: | ||
# - "*" | ||
|
||
jobs: | ||
packages_split: | ||
sync_commits: | ||
runs-on: ubuntu-latest | ||
name: Split Monorepo - ${{ matrix.package.name }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
package: | ||
- name: "Framework" | ||
local_path: "packages/framework" | ||
split_repository: "framework" | ||
branch: "6.0" | ||
- name: "Skeleton" | ||
local_path: "packages/skeleton" | ||
split_repository: "UserFrosting" | ||
branch: "6.0" | ||
- name: "Sprinkle Account" | ||
local_path: "packages/sprinkle-account" | ||
split_repository: "sprinkle-account" | ||
branch: "6.0" | ||
- name: "Sprinkle Admin" | ||
local_path: "packages/sprinkle-admin" | ||
split_repository: "sprinkle-admin" | ||
branch: "6.0" | ||
- name: "Sprinkle Core" | ||
local_path: "packages/sprinkle-core" | ||
split_repository: "sprinkle-core" | ||
branch: "6.0" | ||
- name: "Pink Cupcake" | ||
local_path: "packages/theme-pink-cupcake" | ||
split_repository: "theme-pink-cupcake" | ||
branch: "main" | ||
|
||
name: Sync commits | ||
if: github.repository == 'userfrosting/monorepo' # Execute this workflow job only on the main repository. | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
|
||
# no tag | ||
- if: ${{ !startsWith(github.ref, 'refs/tags/') }} | ||
uses: "danharrin/monorepo-split-github-action@v2.3.0" | ||
# Add a personal access token to the repository secrets. This will allow the splitter action to push the new commits | ||
- uses: frankdejonge/use-github-token@1.0.2 | ||
with: | ||
package_directory: "${{ matrix.package.local_path }}" | ||
repository_organization: "userfrosting" | ||
repository_name: "${{ matrix.package.split_repository }}" | ||
authentication: "username:${{ secrets.ACCESS_TOKEN }}" | ||
user_name: "UserFrosting Bot" | ||
user_email: "no-reply@userfrosting.com" | ||
branch: "${{ matrix.package.branch }}" | ||
|
||
# with tag | ||
- if: startsWith(github.ref, 'refs/tags/') | ||
uses: "danharrin/monorepo-split-github-action@v2.3.0" | ||
# Cache the splitsh executable to speedup future runs | ||
- name: Cache splitsh-lite | ||
uses: actions/cache@v2 | ||
with: | ||
tag: ${GITHUB_REF#refs/tags/} | ||
package_directory: "${{ matrix.package.local_path }}" | ||
repository_organization: "userfrosting" | ||
repository_name: "${{ matrix.package.split_repository }}" | ||
user_name: "UserFrosting Bot" | ||
user_email: "no-reply@userfrosting.com" | ||
branch: "${{ matrix.package.branch }}" | ||
path: "./splitsh" | ||
key: "${{ runner.os }}-splitsh-v101" | ||
|
||
# Sync commits and tags for the configured subtree splits | ||
- name: subtree split | ||
uses: acrobat/subtree-splitter@v1.1.3 | ||
with: | ||
config-path: .github/subtree-splitter-config.json # Reference the location where you saved your config file |