diff --git a/.github/workflows/split.yaml b/.github/workflows/split.yaml new file mode 100644 index 00000000..bd3572b6 --- /dev/null +++ b/.github/workflows/split.yaml @@ -0,0 +1,22 @@ +name: 'Packages Split' + +on: + push: + branches: + - main + release: + types: [ published ] + +jobs: + packages_split: + name: "Packages Split" + runs-on: "ubuntu-latest" + + steps: + - name: "Checkout" + run: git clone https://github.com/yann-eugone/test-monorepo /home/runner/work/yann-eugone/test-monorepo && cd $_ + + - name: "Gitsplit" + run: docker run --rm -t -e GH_TOKEN -v /cache/gitsplit:/cache/gitsplit -v /home/runner/work/yann-eugone/test-monorepo:/srv jderusse/gitsplit gitsplit + env: + GH_TOKEN: ${{ secrets.GITSPLIT_TOKEN }} diff --git a/.gitsplit.yml b/.gitsplit.yml new file mode 100644 index 00000000..3c47e77e --- /dev/null +++ b/.gitsplit.yml @@ -0,0 +1,49 @@ +# Path to a cache directory Used to speed up the split over time by reusing git's objects +cache_url: "/cache/gitsplit" + +# Packages to split +splits: + - + prefix: "src/batch" + target: "https://${GH_TOKEN}@github.com/yokai-php/batch-documentation.git" + - + prefix: "docs" + target: "https://${GH_TOKEN}@github.com/yokai-php/batch.git" + - + prefix: "src/batch-doctrine-dbal" + target: "https://${GH_TOKEN}@github.com/yokai-php/batch-doctrine-dbal.git" + - + prefix: "src/batch-doctrine-orm" + target: "https://${GH_TOKEN}@github.com/yokai-php/batch-doctrine-orm.git" + - + prefix: "src/batch-doctrine-persistence" + target: "https://${GH_TOKEN}@github.com/yokai-php/batch-doctrine-persistence.git" + - + prefix: "src/batch-league-flysystem" + target: "https://${GH_TOKEN}@github.com/yokai-php/batch-league-flysystem.git" + - + prefix: "src/batch-openspout" + target: "https://${GH_TOKEN}@github.com/yokai-php/batch-openspout.git" + - + prefix: "src/batch-symfony-console" + target: "https://${GH_TOKEN}@github.com/yokai-php/batch-symfony-console.git" + - + prefix: "src/batch-symfony-framework" + target: "https://${GH_TOKEN}@github.com/yokai-php/batch-symfony-framework.git" + - + prefix: "src/batch-symfony-messenger" + target: "https://${GH_TOKEN}@github.com/yokai-php/batch-symfony-messenger.git" + - + prefix: "src/batch-symfony-pack" + target: "https://${GH_TOKEN}@github.com/yokai-php/batch-symfony-pack.git" + - + prefix: "src/batch-symfony-serializer" + target: "https://${GH_TOKEN}@github.com/yokai-php/batch-symfony-serializer.git" + - + prefix: "src/batch-symfony-validator" + target: "https://${GH_TOKEN}@github.com/yokai-php/batch-symfony-validator.git" + +# List of references to split (defined as regexp) +origins: + - ^(0\.x)$ # the default branch + - ^v\d+\.\d+\.\d+$ # the version tags diff --git a/scripts/split-branch b/scripts/split-branch deleted file mode 100755 index 56e58946..00000000 --- a/scripts/split-branch +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -x - -# Make sure the branch is provided. -if (( "$#" != 1 )) -then - echo "Branch has to be provided." - - exit 1 -fi - -BRANCH=$1 - -function split() -{ - SHA1=`./scripts/splitsh-lite --prefix=$1` - git push $2 "$SHA1:refs/heads/$BRANCH" -f -} - -function remote() -{ - git remote add $1 $2 || true -} - -remote batch git@github.com:yokai-php/batch.git -remote batch-doctrine-dbal git@github.com:yokai-php/batch-doctrine-dbal.git -remote batch-doctrine-orm git@github.com:yokai-php/batch-doctrine-orm.git -remote batch-doctrine-persistence git@github.com:yokai-php/batch-doctrine-persistence.git -remote batch-league-flysystem git@github.com:yokai-php/batch-league-flysystem.git -remote batch-openspout git@github.com:yokai-php/batch-openspout.git -remote batch-symfony-console git@github.com:yokai-php/batch-symfony-console.git -remote batch-symfony-framework git@github.com:yokai-php/batch-symfony-framework.git -remote batch-symfony-messenger git@github.com:yokai-php/batch-symfony-messenger.git -remote batch-symfony-pack git@github.com:yokai-php/batch-symfony-pack.git -remote batch-symfony-serializer git@github.com:yokai-php/batch-symfony-serializer.git -remote batch-symfony-validator git@github.com:yokai-php/batch-symfony-validator.git - -split 'src/batch' batch -split 'src/batch-doctrine-dbal' batch-doctrine-dbal -split 'src/batch-doctrine-orm' batch-doctrine-orm -split 'src/batch-doctrine-persistence' batch-doctrine-persistence -split 'src/batch-league-flysystem' batch-league-flysystem -split 'src/batch-openspout' batch-openspout -split 'src/batch-symfony-console' batch-symfony-console -split 'src/batch-symfony-framework' batch-symfony-framework -split 'src/batch-symfony-messenger' batch-symfony-messenger -split 'src/batch-symfony-pack' batch-symfony-pack -split 'src/batch-symfony-serializer' batch-symfony-serializer -split 'src/batch-symfony-validator' batch-symfony-validator diff --git a/scripts/split-tag b/scripts/split-tag deleted file mode 100755 index bfd0b202..00000000 --- a/scripts/split-tag +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -x - -# Make sure the tag is provided. -if (( "$#" != 1 )) -then - echo "Tag has to be provided." - - exit 1 -fi - -TAG=$1 - -function split() -{ - SHA1=`./scripts/splitsh-lite --prefix=$1` - git push $2 "$SHA1:refs/tags/$TAG" -f -} - -function remote() -{ - git remote add $1 $2 || true -} - -remote batch git@github.com:yokai-php/batch.git -remote batch-doctrine-dbal git@github.com:yokai-php/batch-doctrine-dbal.git -remote batch-doctrine-orm git@github.com:yokai-php/batch-doctrine-orm.git -remote batch-doctrine-persistence git@github.com:yokai-php/batch-doctrine-persistence.git -remote batch-league-flysystem git@github.com:yokai-php/batch-league-flysystem.git -remote batch-openspout git@github.com:yokai-php/batch-openspout.git -remote batch-symfony-console git@github.com:yokai-php/batch-symfony-console.git -remote batch-symfony-framework git@github.com:yokai-php/batch-symfony-framework.git -remote batch-symfony-messenger git@github.com:yokai-php/batch-symfony-messenger.git -remote batch-symfony-pack git@github.com:yokai-php/batch-symfony-pack.git -remote batch-symfony-serializer git@github.com:yokai-php/batch-symfony-serializer.git -remote batch-symfony-validator git@github.com:yokai-php/batch-symfony-validator.git - -split 'src/batch' batch -split 'src/batch-doctrine-dbal' batch-doctrine-dbal -split 'src/batch-doctrine-orm' batch-doctrine-orm -split 'src/batch-doctrine-persistence' batch-doctrine-persistence -split 'src/batch-league-flysystem' batch-league-flysystem -split 'src/batch-openspout' batch-openspout -split 'src/batch-symfony-console' batch-symfony-console -split 'src/batch-symfony-framework' batch-symfony-framework -split 'src/batch-symfony-messenger' batch-symfony-messenger -split 'src/batch-symfony-pack' batch-symfony-pack -split 'src/batch-symfony-serializer' batch-symfony-serializer -split 'src/batch-symfony-validator' batch-symfony-validator diff --git a/scripts/splitsh-lite b/scripts/splitsh-lite deleted file mode 100755 index ddefe95a..00000000 Binary files a/scripts/splitsh-lite and /dev/null differ