Merge pull request #175 from SuperViz/feat/new-room-package #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |