Skip to content

Commit 333566f

Browse files
committed
ci: try to split main repository into sub repositories
1 parent 857cad1 commit 333566f

File tree

2 files changed

+75
-82
lines changed

2 files changed

+75
-82
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 82 deletions
This file was deleted.

.github/workflows/split.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: 'Packages Split'
3+
4+
on:
5+
push:
6+
branches:
7+
- v2-unstable-*
8+
- v2-unstable # Remove before releasing v2
9+
- master
10+
tags:
11+
- '*'
12+
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
15+
16+
concurrency:
17+
group: "Packages Split"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
split:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
package:
27+
- remote: 'knplabs/snappy-core'
28+
path: 'src/Core'
29+
- remote: 'knplabs/snappy-bundle'
30+
path: 'src/Bundle'
31+
- remote: 'knplabs/snappy-wkhtmltopdf'
32+
path: 'src/Backend/WkHtmlToPdf'
33+
steps:
34+
- run: |
35+
git config --global user.name "knpEdgar"
36+
git config --global user.email "[email protected]"
37+
- uses: actions/checkout@v2
38+
with:
39+
path: ./monolyth
40+
- run: mkdir ./readonly
41+
- run: mkdir ./build
42+
- name: git clone
43+
run: |
44+
cd ./readonly
45+
git clone -- https://${{ secrets.ACCESS_TOKEN }}@github.com/${{ matrix.package.remote }} .
46+
git fetch
47+
- name: cleanup
48+
run: cp --verbose -ra ./readonly/.git ./build/.git
49+
- run: cp --verbose -ra ./monolyth/${{ matrix.package.path }}/* ./build
50+
- run: ls -la ./build
51+
- name: git add .
52+
id: git_status
53+
run: |
54+
cd ./build
55+
git status --porcelain
56+
echo "STATUS=$(git status --porcelain)" >> $GITHUB_OUTPUT
57+
git add . --verbose
58+
- name: git commit
59+
if: ${{ '' != steps.git_status.outputs.STATUS }}
60+
run: |
61+
cd ./monolyth
62+
COMMIT_MESSAGE=$(git show -s --format=%B ${GITHUB_SHA})
63+
cd ../build
64+
git commit --message "$COMMIT_MESSAGE"
65+
- name: git push
66+
if: ${{ '' != steps.git_status.outputs.STATUS }}
67+
run: |
68+
cd ./build
69+
git push --quiet origin main
70+
- name: git tag
71+
if: "startsWith(github.ref, 'refs/tags/')"
72+
run: |
73+
cd ./build
74+
git tag %s -m "${GITHUB_REF#refs/tags/}"
75+
git push --quiet origin "${GITHUB_REF#refs/tags/}"

0 commit comments

Comments
 (0)