-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (156 loc) · 8.03 KB
/
publish-packages.ci.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Publish Packages
on:
push:
branches:
- lab
- beta
- main
jobs:
package:
env:
VITE_SUPERVIZ_ROOM_PREFIX: ${{ secrets.VITE_SUPERVIZ_ROOM_PREFIX }}
VITE_SUPERVIZ_DEVELOPER_TOKEN: ${{ secrets.VITE_SUPERVIZ_DEVELOPER_TOKEN }}
VITE_MATTERPORT_KEY: ${{ secrets.VITE_MATTERPORT_KEY }}
VITE_FORGE_CLIENT_SECRET: ${{ secrets.VITE_FORGE_CLIENT_SECRET }}
VITE_FORGE_CLIENT_ID: ${{ secrets.VITE_FORGE_CLIENT_SECRET }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.10.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create a .remote-config.js file
run: |
touch packages/sdk/.remote-config.js && echo "echo \"module.exports = { remoteConfig: { apiUrl: 'https://api.superviz.com', conferenceLayerUrl: 'https://video-frame.superviz.com/lab/index.html'}};\" > .remote-config.js" | bash -
touch packages/realtime/.remote-config.js && echo "echo \"module.exports = { remoteConfig: { apiUrl: 'https://api.superviz.com' }};\" > .remote-config.js" | bash -
- name: Configure Git credentials
run: |
git config --global user.name SuperViz
git config --global user.email dev@superviz.com
- name: Build package
run: pnpm run build
- name: Check for changes in packages/socket-client
id: check_socket_client_changes
run: |
git diff --quiet HEAD^ HEAD -- packages/socket-client ':(exclude)packages/socket-client/package.json' || echo "socket_client_changed=true" >> $GITHUB_OUTPUT
- name: Publish Socket Client package
if: steps.check_socket_client_changes.outputs.socket_client_changed == 'true'
run: npm whoami && pnpm run semantic-release --filter=@superviz/socket-client
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check for changes in packages/realtime
id: check_realtime_changes
run: |
git diff --quiet HEAD^ HEAD -- packages/realtime ':(exclude)packages/realtime/package.json' || echo "realtime_changed=true" >> $GITHUB_OUTPUT
- name: Publish realtime package
if: steps.check_realtime_changes.outputs.realtime_changed == 'true'
run: npm whoami && pnpm run semantic-release --filter=@superviz/realtime
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check for changes in packages/sdk
id: check_sdk_changes
run: |
git diff --quiet HEAD^ HEAD -- packages/sdk ':(exclude)packages/sdk/package.json' || echo "sdk_changed=true" >> $GITHUB_OUTPUT
- name: Publish SDK package
if: steps.check_sdk_changes.outputs.sdk_changed == 'true'
run: npm whoami && pnpm run semantic-release --filter=@superviz/sdk
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check for changes in packages/yjs
id: check_yjs_changes
run: |
git diff --quiet HEAD^ HEAD -- packages/yjs ':(exclude)packages/yjs/package.json' || echo "yjs_changed=true" >> $GITHUB_OUTPUT
- name: Publish YJS package
if: steps.check_yjs_changes.outputs.yjs_changed == 'true'
run: npm whoami && pnpm run semantic-release --filter=@superviz/yjs
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check for changes in packages/autodesk
id: check_autodesk_changes
run: |
git diff --quiet HEAD^ HEAD -- packages/autodesk ':(exclude)packages/autodesk/package.json' || echo "autodesk_changed=true" >> $GITHUB_OUTPUT
- name: Publish Autodesk package
if: steps.check_autodesk_changes.outputs.autodesk_changed == 'true'
run: npm whoami && pnpm run semantic-release --filter=@superviz/autodesk-viewer-plugin
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check for changes in packages/matterport
id: check_matterport_changes
run: |
git diff --quiet HEAD^ HEAD -- packages/matterport ':(exclude)packages/matterport/package.json' || echo "matterport_changed=true" >> $GITHUB_OUTPUT
- name: Publish matterport package
if: steps.check_matterport_changes.outputs.matterport_changed == 'true'
run: npm whoami && pnpm run semantic-release --filter=@superviz/matterport-plugin
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check for changes in packages/three
id: check_three_changes
run: |
git diff --quiet HEAD^ HEAD -- packages/three ':(exclude)packages/three/package.json' || echo "three_changed=true" >> $GITHUB_OUTPUT
- name: Publish three package
if: steps.check_three_changes.outputs.three_changed == 'true'
run: npm whoami && pnpm run semantic-release --filter=@superviz/threejs-plugin
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check for changes in React SDK and dependencies
id: check_react_and_dependencies_changes
run: |
git diff --quiet HEAD^ HEAD -- packages/react ':(exclude)packages/react/package.json' || echo "react_changed=true" >> $GITHUB_OUTPUT
git diff --quiet HEAD^ HEAD -- packages/sdk ':(exclude)packages/sdk/package.json' || echo "react_changed=true" >> $GITHUB_OUTPUT
git diff --quiet HEAD^ HEAD -- packages/autodesk ':(exclude)packages/autodesk/package.json' || echo "react_changed=true" >> $GITHUB_OUTPUT
git diff --quiet HEAD^ HEAD -- packages/matterport ':(exclude)packages/matterport/package.json' || echo "react_changed=true" >> $GITHUB_OUTPUT
git diff --quiet HEAD^ HEAD -- packages/three ':(exclude)packages/three/package.json' || echo "react_changed=true" >> $GITHUB_OUTPUT
git diff --quiet HEAD^ HEAD -- packages/yjs ':(exclude)packages/yjs/package.json' || echo "react_changed=true" >> $GITHUB_OUTPUT
- name: Publish react package
if: steps.check_react_and_dependencies_changes.outputs.react_changed == 'true'
run: npm whoami && pnpm run semantic-release --filter=@superviz/react-sdk
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Deploy Playground to S3
run: aws s3 sync apps/playground/dist/ s3://sdk-playground.superviz.com --delete
- name: Create Cloudfront invalidation
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.PRODUCTION_DISTRIBUTION_ID }} --paths "/*"
- name: Commit, push changes, and push tags
run: |
git add . ':!.npmrc' ':!packages/**/.npmrc'
git commit -m "chore(release): update package versions [skip ci]" || echo "No changes to commit"
git push
git push --tags
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}