Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo scripts #95

Merged
merged 6 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@ on:
push:
branches: [project-demo-v1]

defaults:
run:
working-directory: demos

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
- name: Checkout repository 🛎️
uses: actions/checkout@v3
- name: Install and build 🔧
run: npm run build:demos
run: npm run build
- name: Run tests ✅
run: npm run test
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
folder: demos/build
branch: gh-pages
clean-exclude: pr-preview
12 changes: 8 additions & 4 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@ on:
pull_request:
branches: ['*demo*']

defaults:
run:
working-directory: demos

jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
- name: Checkout repository 🛎️
uses: actions/checkout@v3
- name: Install and build 🔧
run: npm run build:demos
run: npm run build
- name: Run tests ✅
run: npm run test:demo-react-ts
run: npm run test
- name: Deploy preview 🚀
uses: rossjrw/pr-preview-action@v1.3.0
with:
source-dir: ./build
source-dir: demos/build
esme marked this conversation as resolved.
Show resolved Hide resolved
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ dist
bin
*.pem
coverage
build/*
.DS_STORE
lib
__tests__
!build/.gitkeep
demos/build/*
!demos/build/.gitkeep
File renamed without changes.
1 change: 1 addition & 0 deletions demos/demo-minimal-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"private": true,
"scripts": {
"build": "node scripts/support_node_17+.js webpack",
"build:gh": "npm ci && npm run build",
"start": "node scripts/support_node_17+.js webpack-dev-server --open"
},
"license": "ISC",
Expand Down
1 change: 1 addition & 0 deletions demos/demo-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"private": true,
"scripts": {
"build": "webpack",
"build:gh": "npm ci && npm run build",
"serve": "webpack-dev-server --open",
"start": "npm run build && npm run serve",
"test:build": "cross-env NODE_ENV=test npx webpack --config webpack-test.config.js --mode development",
Expand Down
12 changes: 12 additions & 0 deletions demos/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "calling-extensions-sdk-demos",
"homepage": "https://github.hubspot.com/calling-extensions-sdk",
esme marked this conversation as resolved.
Show resolved Hide resolved
"description": "Build files for deployment to GitHub Pages",
"scripts": {
"build:js": "cd demo-minimal-js && npm run build:gh",
"build:react": "cd demo-react-ts && npm run build:gh",
"build": "npm run build:js && npm run build:react && cp ./src/index.html build/index.html && cp -a demo-minimal-js/bin/. build && cp -a demo-react-ts/dist/. build",
"test:react": "cd demo-react-ts && npm run test",
"test": "npm run test:react"
}
}
File renamed without changes.
10 changes: 1 addition & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@hubspot/calling-extensions-sdk",
"version": "0.0.12",
"homepage": "https://github.hubspot.com/calling-extensions-sdk",
"description": "HubSpot calling extensions sdk for call widget integration.",
"publishConfig": {
"access": "public"
Expand All @@ -24,13 +23,7 @@
"publish:major": "npm publish --access public",
"test": "karma start karma.conf.js --browsers ChromeHeadless --single-run",
"test:debug": "karma start karma.conf.js --browsers Chrome",
"travis": "npm run build:test",
"build:demo-minimal-js": "cd demos/demo-minimal-js && npm ci && npm run build",
"build:demo-react-ts": "cd demos/demo-react-ts && npm ci && npm run build",
"build:demos": "npm run build:demo-react-ts && npm run build:demo-minimal-js && cp ./src/index.html build/index.html && cp -a demos/demo-minimal-js/bin/. build && cp -a demos/demo-react-ts/dist/. build",
"test:demo-react-ts": "cd demos/demo-react-ts && npm run test",
"predeploy": "npm run build:demos",
"deploy": "gh-pages -d build"
"travis": "npm run build:test"
},
"main": "./dist/main.js",
"module": "./index.js",
Expand All @@ -52,7 +45,6 @@
"eslint-plugin-jsx-a11y": "^3.0.2",
"eslint-plugin-mocha": "^4.7.0",
"eslint-plugin-react": "^6.9.0",
"gh-pages": "^5.0.0",
"jasmine-core": "^3.3.0",
"karma": "^6.3.17",
"karma-babel-preprocessor": "^8.0.2",
Expand Down