-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: try to split main repository into sub repositories
- Loading branch information
1 parent
450b77c
commit e380894
Showing
4 changed files
with
87 additions
and
82 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,2 @@ | ||
[safe] | ||
directory = "*" |
This file was deleted.
Oops, something went wrong.
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,84 @@ | ||
--- | ||
name: 'Packages Split' | ||
|
||
on: | ||
push: | ||
branches: | ||
- v2-unstable-repository-split | ||
tags: | ||
- '*' | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
|
||
jobs: | ||
sub_packages: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
package: | ||
- path: 'src/Core' | ||
remote: 'knplabs/snappy-core' | ||
- path: 'src/Backend/WkHtmlToPdf' | ||
remote: 'knplabs/snappy-wkhtmltopdf' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: ./monolyth | ||
- run: mkdir ./readonly | ||
- name: git clone | ||
run: | | ||
cd ./readonly | ||
git clone -- https://${{ secrets.ACCESS_TOKEN }}@github.com/${{ matrix.package.remote }} . | ||
git checkout -b main || git branch main | ||
- name: git fetch | ||
run: | | ||
cd ./readonly | ||
git fetch | ||
- run: cp --verbose -ra ./monolyth/${{ matrix.package.path }}/* ./readonly | ||
- run: ls -la ./readonly | ||
- name: git status | ||
run: | | ||
cd ./readonly | ||
git status | ||
- name: git add | ||
run: | | ||
cd ./readonly | ||
git add . | ||
- id: commit_message | ||
name: commit_message | ||
run: | | ||
echo "COMMIT_MESSAGE=$(cd ./monolyth; git show -s --format=%B ${GITHUB_SHA})" | ||
export "COMMIT_MESSAGE=$(cd ./monolyth; git show -s --format=%B ${GITHUB_SHA})" >> $GITHUB_OUTPUT | ||
- name: git commit | ||
run: | | ||
cd ./readonly | ||
git commit --message `${{ steps.commit_message.output.COMMIT_MESSAGE }}` | ||
- name: git push | ||
run: | | ||
cd ./readonly | ||
git push --quiet origin main | ||
- if: "startsWith(github.ref, 'refs/tags/')" | ||
name: git tag | ||
run: | | ||
cd ./readonly | ||
git tag %s -m "${GITHUB_REF#refs/tags/}" | ||
git push --quiet origin "${GITHUB_REF#refs/tags/}" | ||
# - if: "!startsWith(github.ref, 'refs/tags/')" | ||
# uses: "symplify/monorepo-split-github-action@2.1" | ||
# with: | ||
# package_directory: '${{ matrix.package.path }}' | ||
# repository_organization: 'knplabs' | ||
# repository_name: '${{ matrix.package.remote }}' | ||
# user_name: "knpEdgar" | ||
# user_email: "hello@knplabs.com" | ||
# - if: "startsWith(github.ref, 'refs/tags/')" | ||
# uses: "symplify/monorepo-split-github-action@2.1" | ||
# with: | ||
# tag: ${GITHUB_REF#refs/tags/} | ||
# package_directory: '${{ matrix.package.path }}' | ||
# repository_organization: 'knplabs' | ||
# repository_name: '${{ matrix.package.remote }}' | ||
# user_name: "knpEdgar" | ||
# user_email: "hello@knplabs.com" |
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