-
Notifications
You must be signed in to change notification settings - Fork 4
159 lines (140 loc) · 5.36 KB
/
split.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# --------------------------------------------------------------------------------------------------------- #
# Split Packages Workflow
#
# Inspiration from: https://blog.logrocket.com/hosting-all-your-php-packages-together-in-a-monorepo/
# Based on: https://github.com/symplify/monorepo-split-github-action
# --------------------------------------------------------------------------------------------------------- #
name: 'Split Packages'
on:
push:
branches:
- 'main'
tags:
- '*'
# Avoid running on pull requests
pull_request: null
env:
# 1. for GitHub split
GITHUB_TOKEN: ${{ secrets.SPLIT_ACCESS_TOKEN }}
# 2. for Gitlab split
# GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
# Repository organisation
ORGANISATION: "aedart"
# Author and Email for signing split
USER_NAME: "aedart"
USER_EMAIL: "aedart@gmail.com"
jobs:
# ------------------------------------------------------------------------------------------------------- #
# Split mono repository into several packages...
# ------------------------------------------------------------------------------------------------------- #
split_monorepo:
if: github.repository == 'aedart/athenaeum'
name: "Split mono-repository"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Define the local directory and remote repository for each package!
# - local = Directory name inside packages
# - remote = Repository name
#
# NOTE: When creating new packages, make sure to manually create the first
# commit ~ initialise the remote repo, or split will fail.
#
package:
- local: 'Acl'
remote: 'athenaeum-acl'
- local: 'Antivirus'
remote: 'athenaeum-antivirus'
- local: 'Audit'
remote: 'athenaeum-audit'
- local: 'Auth'
remote: 'athenaeum-auth'
- local: 'Circuits'
remote: 'athenaeum-circuits'
- local: 'Collections'
remote: 'athenaeum-collections'
- local: 'Config'
remote: 'athenaeum-config'
- local: 'Console'
remote: 'athenaeum-console'
- local: 'Container'
remote: 'athenaeum-container'
- local: 'Contracts'
remote: 'athenaeum-contracts'
- local: 'Core'
remote: 'athenaeum-core'
- local: 'Database'
remote: 'athenaeum-database'
- local: 'Dto'
remote: 'athenaeum-dto'
- local: 'ETags'
remote: 'athenaeum-etags'
- local: 'Events'
remote: 'athenaeum-events'
- local: 'Filters'
remote: 'athenaeum-filters'
- local: 'Flysystem/Db'
remote: 'athenaeum-flysystem-db'
- local: 'Http/Api'
remote: 'athenaeum-http-api'
- local: 'Http/Clients'
remote: 'athenaeum-http-clients'
- local: 'Http/Cookies'
remote: 'athenaeum-http-cookies'
- local: 'Http/Messages'
remote: 'athenaeum-http-messages'
- local: 'Maintenance/Modes'
remote: 'athenaeum-maintenance-modes'
- local: 'MimeTypes'
remote: 'athenaeum-mime-types'
- local: 'Pagination'
remote: 'athenaeum-pagination'
- local: 'Properties'
remote: 'athenaeum-properties'
- local: 'Redmine'
remote: 'athenaeum-redmine'
- local: 'Service'
remote: 'athenaeum-service'
- local: 'Streams'
remote: 'athenaeum-streams'
- local: 'Support'
remote: 'athenaeum-support'
- local: 'Testing'
remote: 'athenaeum-testing'
- local: 'Translation'
remote: 'athenaeum-translation'
- local: 'Utils'
remote: 'athenaeum-utils'
- local: 'Validation'
remote: 'athenaeum-validation'
steps:
- uses: actions/checkout@v3
# When no tag available
- name: "Split of ${{ matrix.package.local }} to remote ${{ matrix.package.remote }} - NO TAG"
if: "!startsWith(github.ref, 'refs/tags/')"
uses: "symplify/monorepo-split-github-action@v2.3.0"
with:
# ↓ split "packages/xyz" directory
package_directory: 'packages/${{ matrix.package.local }}'
# ↓ into https://github.com/aedart/xyz repository
repository_organization: "${ORGANISATION}"
repository_name: '${{ matrix.package.remote }}'
# ↓ the user signed under the split commit
user_name: "${USER_NAME}"
user_email: "${USER_EMAIL}"
# When tag available
- name: "Split of ${{ matrix.package.local }} to remote ${{ matrix.package.remote }} - WITH TAG"
if: "startsWith(github.ref, 'refs/tags/')"
uses: "symplify/monorepo-split-github-action@v2.3.0"
with:
# Set tag
tag: ${GITHUB_REF#refs/tags/}
# ↓ split "packages/xyz" directory
package_directory: 'packages/${{ matrix.package.local }}'
# ↓ into https://github.com/aedart/xyz repository
repository_organization: "${ORGANISATION}"
repository_name: '${{ matrix.package.remote }}'
# ↓ the user signed under the split commit
user_name: "${USER_NAME}"
user_email: "${USER_EMAIL}"