diff --git a/.github/workflows/publish-sample-add-ons.yml b/.github/workflows/publish-sample-add-ons.yml new file mode 100644 index 0000000..eedfdee --- /dev/null +++ b/.github/workflows/publish-sample-add-ons.yml @@ -0,0 +1,58 @@ +name: Deploy sample Add-ons to GitHub Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main", "teddy_hello-world"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + # TODO: run this in a loop when there are multiple samples. + - run: npm run build + working-directory: addons-web-sdk/hello-world + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + # TODO: run this in a loop when there are multiple samples. + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './addons-web-sdk/hello-world/dist/' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2fb7550 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# Build outputs for sample Meet Add-ons +addons-web-sdk/*/dist/ +addons-web-sdk/*/node_modules/ +addons-web-sdk/*/.DS_STORE +addons-web-sdk/*/package-lock.json diff --git a/addons-web-sdk/hello-world/README.md b/addons-web-sdk/hello-world/README.md new file mode 100644 index 0000000..565f859 --- /dev/null +++ b/addons-web-sdk/hello-world/README.md @@ -0,0 +1 @@ +This is approximately the simplest possible add-on. The only requirements to get started here are npm and GitHub. The intent of publishing this add-on is to demonstrate how easy it is to get started with rendering custom content using an add-on. Please see other samples at https://github.com/googleworkspace/meet/tree/main/addons-web-sdk/samples to learn more advanced functionality! diff --git a/addons-web-sdk/hello-world/package.json b/addons-web-sdk/hello-world/package.json new file mode 100644 index 0000000..98c5cbf --- /dev/null +++ b/addons-web-sdk/hello-world/package.json @@ -0,0 +1,12 @@ +{ + "scripts": { + "build": "cp src/*.html dist/ && npx webpack" + }, + "dependencies": { + "@googleworkspace/meet-addons": "^0.9.1" + }, + "devDependencies": { + "webpack": "^5.92.1", + "webpack-cli": "^5.1.4" + } +} \ No newline at end of file diff --git a/addons-web-sdk/hello-world/src/MainStage.html b/addons-web-sdk/hello-world/src/MainStage.html new file mode 100644 index 0000000..8438b0d --- /dev/null +++ b/addons-web-sdk/hello-world/src/MainStage.html @@ -0,0 +1,15 @@ + + + + +
+