forked from highlight/highlight
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (116 loc) · 5.12 KB
/
turbo.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
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
name: Monorepo
on:
push:
branches: ['main']
pull_request:
types: [opened, synchronize]
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
yarn-monorepo:
name: Build Yarn Turborepo
timeout-minutes: 60
runs-on: buildjet-4vcpu-ubuntu-2204
# configures turborepo Remote Caching
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
npm-changed:
- 'sdk/client/**'
- 'sdk/firstload/**'
- 'sdk/highlight-apollo/**'
- 'sdk/highlight-cloudflare/**'
- 'sdk/highlight-nest/**'
- 'sdk/highlight-next/**'
- 'sdk/highlight-node/**'
- 'sdk/highlight-react/**'
- 'sdk/highlight-remix/**'
- 'sdk/opentelemetry-sdk-workers/packages/opentelemetry-sdk-workers/**'
# automatically caches dependencies based on yarn.lock
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'yarn'
- name: Install js dependencies
run: yarn
- name: Check check for duplicate deps
run: yarn dedupe --check
- name: Check generated files for Reflame
run: yarn reflame-check
- name: Check formatting
run: yarn format-check
- name: Configure AWS credentials
if: github.event.pull_request.head.repo.full_name == 'highlight/highlight' || github.ref == 'refs/heads/main'
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Install Doppler CLI
uses: dopplerhq/cli-action@v3
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Build & test (in a fork without doppler)
run: yarn test:all
env:
GRAPHCMS_TOKEN: ${{ secrets.GRAPHCMS_TOKEN }}
NEXT_PUBLIC_HIGHLIGHT_PROJECT_ID: 1jdkoe52
REACT_APP_COMMIT_SHA: ${{ github.sha }}
- name: Build render
# does not work for open source builds as doppler is required
if: github.event.pull_request.head.repo.full_name == 'highlight/highlight' || github.ref == 'refs/heads/main'
run: doppler run -- yarn build:render
env:
DOPPLER_TOKEN: ${{ secrets.DOPPLER_PROD_RENDER_SECRET }}
- name: Upload frontend sourcemaps
if: github.ref == 'refs/heads/main'
run: yarn sourcemaps:frontend
env:
HIGHLIGHT_API_KEY: ${{ secrets.HIGHLIGHT_SOURCEMAP_API_KEY }}
APP_VERSION: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Configure yarn npm registry credentials
if: github.event.pull_request.head.repo.full_name == 'highlight/highlight' || github.ref == 'refs/heads/main'
run: |
yarn config set npmRegistryServer "https://registry.npmjs.org"
yarn config set npmAuthToken "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish npm packages
if: github.ref == 'refs/heads/main'
id: changesets-publish
uses: changesets/action@v1
with:
publish: yarn publish:turbo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish ai lambda
if: github.ref == 'refs/heads/main'
run: yarn publish:ai
- name: Publish session-insights-email lambda
if: github.ref == 'refs/heads/main'
run: yarn publish:react-email-templates
- name: Publish render lambda
if: github.ref == 'refs/heads/main'
run: yarn publish:render
- name: Release changesets
if: github.ref == 'refs/heads/main'
id: changesets-version
uses: changesets/action@v1
with:
version: yarn changeset version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}