Skip to content

Commit

Permalink
Add Jitsi SDK as a static resource and set up CI to update it on change
Browse files Browse the repository at this point in the history
  • Loading branch information
Johennes committed Nov 21, 2023
1 parent 8025711 commit b08f83b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 34 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/update-jitsi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Re-fetches the Jitsi SDK and opens a PR to update it if it's different from what's in the repository
name: Update Jitsi
on:
workflow_dispatch: {}
schedule:
- cron: "0 3 * * 0" # 3am every Sunday
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
cache: "yarn"

- name: Install Deps
run: "yarn install --frozen-lockfile"

- name: Fetch Jitsi
run: "yarn update:jitsi"

- name: Create Pull Request
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5
with:
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
branch: actions/jitsi-update
delete-branch: true
title: Jitsi Update
labels: |
T-Task
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@
"clean": "rimraf lib webapp",
"build": "yarn clean && yarn build:genfiles && yarn build:bundle",
"build-stats": "yarn clean && yarn build:genfiles && yarn build:bundle-stats",
"build:jitsi": "ts-node scripts/build-jitsi.ts",
"build:res": "ts-node scripts/copy-res.ts",
"build:genfiles": "yarn build:res && yarn build:jitsi && yarn build:module_system",
"build:genfiles": "yarn build:res && yarn build:module_system",
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
"build:bundle": "webpack --progress --mode production",
"build:bundle-stats": "webpack --progress --mode production --json > webpack-stats.json",
"build:module_system": "ts-node --project ./tsconfig.module_system.json module_system/scripts/install.ts",
"dist": "scripts/package.sh",
"start": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n modules,res,jitsi \"yarn build:module_system\" \"yarn build:res\" \"yarn build:jitsi\" && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js\"",
"start": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n modules,res \"yarn build:module_system\" \"yarn build:res\" && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js\"",
"start:https": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js --https\"",
"start:res": "ts-node scripts/copy-res.ts -w",
"start:js": "webpack serve --output-path webapp --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js --mode development",
Expand All @@ -63,7 +62,8 @@
"test": "jest",
"coverage": "yarn test --coverage",
"analyse:unused-exports": "ts-node ./scripts/analyse_unused_exports.ts",
"analyse:webpack-bundles": "webpack-bundle-analyzer webpack-stats.json webapp"
"analyse:webpack-bundles": "webpack-bundle-analyzer webpack-stats.json webapp",
"update:jitsi": "curl -s https://meet.element.io/libs/external_api.min.js > ./res/jitsi_external_api.min.js"
},
"resolutions": {
"@types/react-dom": "17.0.21",
Expand Down
3 changes: 3 additions & 0 deletions res/jitsi_external_api.min.js

Large diffs are not rendered by default.

30 changes: 0 additions & 30 deletions scripts/build-jitsi.ts

This file was deleted.

1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ module.exports = (env, argv) => {
new CopyWebpackPlugin({
patterns: [
"res/apple-app-site-association",
"res/jitsi_external_api.min.js",
"res/manifest.json",
"res/sw.js",
"res/welcome.html",
Expand Down

0 comments on commit b08f83b

Please sign in to comment.