-
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (68 loc) · 2.35 KB
/
monorepo.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
name: "monorepo"
on:
push:
branches:
- "main"
tags:
- v*
env:
extensions: "json"
cache-version: "1"
composer-version: "v2"
composer-install: "composer update --no-interaction --no-progress --prefer-dist --prefer-stable"
jobs:
monorepo_matrix:
name: "Create list of packages for split"
runs-on: "${{ matrix.operating-system }}"
strategy:
fail-fast: false
matrix:
operating-system: [ "ubuntu-latest" ]
# This step is needed, so the output gets to the next defined job
outputs:
matrix: ${{ steps.set-matrix.outputs.content }}
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Read matrix configuration"
id: "set-matrix"
uses: "juliangruber/read-file-action@v1"
with:
path: "./.github/workflows/monorepo-matrix.json"
split_monorepo:
name: "Update package"
runs-on: "${{ matrix.operating-system }}"
needs: [ "monorepo_matrix" ]
strategy:
fail-fast: false
matrix:
operating-system: [ "ubuntu-latest" ]
package: ${{fromJson(needs.monorepo_matrix.outputs.matrix)}}
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Monorepo Split of ${{ matrix.package.name }}"
if: "!startsWith(github.ref, 'refs/tags/')"
uses: "danharrin/monorepo-split-github-action@v2.3.0"
env:
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_ACCESS_TOKEN }}
with:
package_directory: "${{ matrix.package.local-path }}"
repository_organization: "${{ matrix.package.organization }}"
repository_name: "${{ matrix.package.name }}"
user_name: "GitHub Action"
user_email: "action@github.com"
branch: "main"
- name: "Monorepo Tagged Split of ${{ matrix.package.name }}"
if: "startsWith(github.ref, 'refs/tags/')"
uses: "danharrin/monorepo-split-github-action@v2.3.0"
env:
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_ACCESS_TOKEN }}
with:
tag: ${GITHUB_REF#refs/tags/}
package_directory: "${{ matrix.package.local-path }}"
repository_organization: "${{ matrix.package.organization }}"
repository_name: "${{ matrix.package.name }}"
user_name: "GitHub Action"
user_email: "action@github.com"
branch: "main"