Skip to content

Commit e2dfca8

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

File tree

2 files changed

+74
-82
lines changed

2 files changed

+74
-82
lines changed

.github/workflows/build.yaml

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

.github/workflows/split.yaml

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

0 commit comments

Comments
 (0)