Skip to content

Commit

Permalink
Try splitsh
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Dec 17, 2024
1 parent 9ba89cc commit 9bee1d8
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 57 deletions.
9 changes: 9 additions & 0 deletions .github/subtree-splitter-config.json
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"
}
]
}
91 changes: 34 additions & 57 deletions .github/workflows/Monorepo.yml
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

0 comments on commit 9bee1d8

Please sign in to comment.