-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (65 loc) · 2.16 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
name: subtree-matrix
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
sync-downstream:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
path: [
#
next-prisma-starter,
next-prisma-websockets-starter,
next-prisma-todomvc,
next-minimal-starter,
next-big-router,
minimal,
minimal-react,
.experimental/next-formdata,
.experimental/next-app-dir,
]
name: Update downstream ${{ matrix.path }} package
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run find-and-replace to remove '.experimental/' from above paths
uses: mad9000/actions-find-and-replace-string@4
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@v2
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'pnpm'
- name: Install dependencies and create separate lockfile
run: |
echo "shared-workspace-lockfile=false" >> .npmrc
echo "link-workspace-packages=false" >> .npmrc
cp ./pnpm-lock.yaml ./examples/${{ matrix.path }}/pnpm-lock.yaml
pnpm install --no-frozen-lockfile
- 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