Repository navigation
157 lines (138 loc) · 5.77 KB
/
Copy pathmonorepo-split.yml
File metadata and controls
157 lines (138 loc) · 5.77 KB
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
on:
push:
branches:
- 1.x
tags:
- '*'
paths-ignore:
- 'CHANGELOG.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: read
jobs:
packages_split:
runs-on: ubuntu-24.04
env:
PACKAGES: |
src/core/etl etl
src/cli cli
src/lib/array-dot array-dot
src/lib/azure-sdk azure-sdk
src/lib/doctrine-dbal-bulk doctrine-dbal-bulk
src/lib/parquet parquet
src/lib/parquet-viewer parquet-viewer
src/lib/dremel dremel
src/lib/filesystem filesystem
src/lib/snappy snappy
src/lib/types types
src/lib/postgresql postgresql
src/lib/telemetry telemetry
src/adapter/etl-adapter-avro etl-adapter-avro
src/adapter/etl-adapter-chartjs etl-adapter-chartjs
src/adapter/etl-adapter-csv etl-adapter-csv
src/adapter/etl-adapter-doctrine etl-adapter-doctrine
src/adapter/etl-adapter-excel etl-adapter-excel
src/adapter/etl-adapter-google-sheet etl-adapter-google-sheet
src/adapter/etl-adapter-http etl-adapter-http
src/adapter/etl-adapter-json etl-adapter-json
src/adapter/etl-adapter-logger etl-adapter-logger
src/adapter/etl-adapter-parquet etl-adapter-parquet
src/adapter/etl-adapter-text etl-adapter-text
src/adapter/etl-adapter-xml etl-adapter-xml
src/adapter/etl-adapter-postgresql etl-adapter-postgresql
src/adapter/etl-adapter-seal etl-adapter-seal
src/bridge/filesystem/azure filesystem-azure-bridge
src/bridge/filesystem/async-aws filesystem-async-aws-bridge
src/bridge/filesystem/sftp filesystem-sftp-bridge
src/bridge/monolog/http monolog-http-bridge
src/bridge/monolog/telemetry monolog-telemetry-bridge
src/bridge/openapi/specification openapi-specification-bridge
src/bridge/mago/types mago-types-bridge
src/bridge/phpstan/types phpstan-types-bridge
src/bridge/postgresql/valinor postgresql-valinor-bridge
src/bridge/psr3/telemetry psr3-telemetry-bridge
src/bridge/psr7/telemetry psr7-telemetry-bridge
src/bridge/psr18/telemetry psr18-telemetry-bridge
src/bridge/symfony/console symfony-console-bridge
src/bridge/symfony/filesystem-bundle symfony-filesystem-bundle
src/bridge/symfony/filesystem-cache symfony-filesystem-cache-bridge
src/bridge/symfony/http-foundation symfony-http-foundation-bridge
src/bridge/symfony/http-foundation-telemetry symfony-http-foundation-telemetry-bridge
src/bridge/symfony/postgresql-bundle symfony-postgresql-bundle
src/bridge/symfony/postgresql-cache symfony-postgresql-cache-bridge
src/bridge/symfony/postgresql-messenger symfony-postgresql-messenger-bridge
src/bridge/symfony/postgresql-session symfony-postgresql-session-bridge
src/bridge/symfony/telemetry-bundle symfony-telemetry-bundle
src/bridge/telemetry/otlp telemetry-otlp-bridge
src/bridge/phpunit/postgresql phpunit-postgresql-bridge
src/bridge/phpunit/telemetry phpunit-telemetry-bridge
src/extension/pg-query-ext pg-query-ext
src/extension/arrow-ext arrow-ext
src/extension/flow-php-ext flow-php-ext
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: "List split repositories"
id: packages
run: |
set -euo pipefail
{
echo "repositories<<REPOSITORIES"
awk 'NF && NF != 2 { exit 1 } NF { print $2 }' <<< "$PACKAGES"
echo "REPOSITORIES"
} >> "$GITHUB_OUTPUT"
- name: "Load GitHub App private key"
id: app-credentials
uses: 1password/load-secrets-action@70062d7a876d3eb6334754fa26efd2fbd90c32f2 # v5.0.1
with:
version: "2.42.0"
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
APP_PRIVATE_KEY: op://ci/github-app-flow-ci/private
- name: "Create GitHub App token"
id: app-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
client-id: ${{ vars.FLOW_PHP_CI_CLIENT_ID }}
private-key: ${{ steps.app-credentials.outputs.APP_PRIVATE_KEY }}
owner: flow-php
repositories: ${{ steps.packages.outputs.repositories }}
permission-contents: write
permission-workflows: write
- name: "Resolve GitHub App bot identity"
id: bot
env:
APP_SLUG: ${{ steps.app-token.outputs.app-slug }}
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
id="$(gh api "users/${APP_SLUG}%5Bbot%5D" --jq .id)"
{
echo "name=${APP_SLUG}[bot]"
echo "email=${id}+${APP_SLUG}[bot]@users.noreply.github.com"
} >> "$GITHUB_OUTPUT"
- name: "Split packages"
env:
SPLIT_TOKEN: ${{ steps.app-token.outputs.token }}
BOT_NAME: ${{ steps.bot.outputs.name }}
BOT_EMAIL: ${{ steps.bot.outputs.email }}
run: |
set -euo pipefail
failed=()
while read -r local_path split_repository; do
if [ -z "$local_path" ]; then
continue
fi
echo "::group::${local_path} to flow-php/${split_repository}"
if ! bash .github/scripts/monorepo-split.sh "$local_path" "$split_repository" < /dev/null; then
failed+=("$split_repository")
fi
echo "::endgroup::"
done <<< "$PACKAGES"
if [ "${#failed[@]}" -gt 0 ]; then
echo "::error::Split failed for: ${failed[*]}"
exit 1
fi