-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (67 loc) · 2.33 KB
/
subtree.yml
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
name: subtree-matrix
on:
workflow_dispatch:
push:
branches:
- next
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
sync-downstream:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
path: [
#
.experimental/next-app-dir,
minimal-react,
minimal,
next-big-router,
next-formdata,
next-minimal-starter,
next-prisma-starter,
next-prisma-todomvc,
next-prisma-websockets-starter,
next-sse-chat,
]
name: Update downstream ${{ matrix.path }} package
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run find-and-replace to remove '.experimental/' from above paths
uses: mad9000/actions-find-and-replace-string@5
id: findandreplace
with:
source: ${{ matrix.path }}
find: '.experimental/'
replace: ''
- name: Get the above output
run: echo "The replaced value is ${{ steps.findandreplace.outputs.value }}"
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'pnpm'
- name: Install dependencies and create separate lockfile
run: |
cd ./examples/${{ matrix.path }}
# replace all instances of "@trpc/<<anything but a quote>>": "<<anything but a quote>>" with "@trpc/*": "next" in the package.json
find . -name 'package.json' -print0 | xargs -0 sed -i 's/\("@trpc\/[^"]*"\): "[^"]*"/\1: "next"/g'
pnpm install --no-frozen-lockfile --ignore-scripts --ignore-workspace
- name: Commit changes
run: |
git config --global user.email "<>"
git config --global user.name "trpc-bot"
git add .
git commit -m "chore: sync lockfile"
- name: Sync downstream
uses: nxtlvlsoftware/[email protected]
with:
repo: 'trpc/examples-${{ steps.findandreplace.outputs.value }}'
path: 'examples/${{ matrix.path }}'
deploy_key: ${{ secrets.TRPC_DEPLOY_TOKEN }}
force: true # will force push to the downstream repository
branch: main # will push to the main branch of the downstream repository