From b399f8f4f3c54a7d12b851f3828ce7a51fa25c81 Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Thu, 18 Jul 2024 09:32:25 -0400 Subject: [PATCH] build: initial stab at packaging (#7) * build: initial stab at packaging * disable the build for template --- .../workflows/build-plugin-deb-package.yml | 99 +++++++++++++++++++ .gitignore | 9 ++ .../bbb-plugin-generic-link-share.substvars | 2 + .../DEBIAN/control | 12 +++ debian/changelog | 5 + debian/compat | 1 + debian/control | 15 +++ debian/copyright | 18 ++++ debian/rules | 12 +++ src/index.tsx | 0 10 files changed, 173 insertions(+) create mode 100644 .github/workflows/build-plugin-deb-package.yml create mode 100644 .gitignore create mode 100644 debian/bbb-plugin-generic-link-share.substvars create mode 100644 debian/bbb-plugin-generic-link-share/DEBIAN/control create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100755 debian/rules create mode 100644 src/index.tsx diff --git a/.github/workflows/build-plugin-deb-package.yml b/.github/workflows/build-plugin-deb-package.yml new file mode 100644 index 0000000..3b2bab7 --- /dev/null +++ b/.github/workflows/build-plugin-deb-package.yml @@ -0,0 +1,99 @@ +--- +name: "📦 Build .deb package for plugin" +on: + push: + branches: [ "main"] + paths-ignore: + - debian/changelog + pull_request: + branches: [ "main" ] + paths-ignore: + - debian/changelog + +jobs: + build-deb-package: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-22.04] + + env: + OS_VERSION: ${{ matrix.os }} + defaults: + run: + working-directory: . + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Extract and print repository name + run: | + echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> $GITHUB_ENV + + - name: Set up Node.js + run: | + curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - + sudo apt-get install -y nodejs + + - name: Verify Node.js installation + run: | + node -v + npm -v + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y devscripts debhelper + + # - name: Build Debian package + # run: | + # sudo dpkg-buildpackage -us -uc + + # - name: Create artifacts directory and move .deb files + # run: | + # mkdir -p artifacts + # mv ../*.deb artifacts/ || mv ./*.deb artifacts/ + # ls -la artifacts + + # - name: Upload Debian Package + # uses: actions/upload-artifact@v4 + # with: + # name: "${{ env.REPO_NAME }}-${{ env.OS_VERSION }}" + # path: artifacts/*.deb + + release: + name: "Upload assets to release" + needs: build-deb-package + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-22.04] + + env: + OS_VERSION: ${{ matrix.os }} + if: ${{ github.ref_type == 'tag' }} + permissions: + contents: write + actions: read + steps: + - uses: actions/checkout@v4 + + - name: Extract and print repository name + run: | + echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> $GITHUB_ENV + + - uses: actions/download-artifact@v4 + with: + name: "${{ env.REPO_NAME }}-${{ env.OS_VERSION }}" + path: "${{ env.REPO_NAME }}-${{ env.OS_VERSION }}" + + - name: Create release asset archives + run: zip --junk-paths --recurse-paths --compression-method store "${{ env.REPO_NAME }}-${{ env.OS_VERSION }}.zip" "${{ env.REPO_NAME }}-${{ env.OS_VERSION }}" + + - name: Upload release assets + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload ${{ github.ref_name }} "${{ env.REPO_NAME }}-${{ env.OS_VERSION }}.zip" + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6416ab4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +node_modules +dist +debian/.debhelper/ +debian/debhelper-build-stamp +debian/files +debian/**/copyright +debian/**/changelog.gz +debian/**/md5sums +debian/**/var/www/* diff --git a/debian/bbb-plugin-generic-link-share.substvars b/debian/bbb-plugin-generic-link-share.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/bbb-plugin-generic-link-share.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/bbb-plugin-generic-link-share/DEBIAN/control b/debian/bbb-plugin-generic-link-share/DEBIAN/control new file mode 100644 index 0000000..afa1129 --- /dev/null +++ b/debian/bbb-plugin-generic-link-share/DEBIAN/control @@ -0,0 +1,12 @@ +Package: bbb-plugin-template +Version: 0.1.0 +Architecture: all +Maintainer: Anton Georgiev +Installed-Size: 252 +Section: web +Priority: extra +Homepage: https://github.com/bigbluebutton/plugin-template +Description: Share a webpage with all session participants + An official BigBlueButton plugin which allows + the presenter to display a web page to + all viewers inside of a session. diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..a0833cf --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +bbb-plugin-template (0.1.0) jammy; urgency=medium + + * initial build + + -- Anton Georgiev Thu, 04 Jul 2024 14:56:18 -0400 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b1bd38b --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +13 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..d4f3177 --- /dev/null +++ b/debian/control @@ -0,0 +1,15 @@ +Source: bbb-plugin-template +Section: web +Priority: extra +Maintainer: Anton Georgiev +Build-Depends: debhelper (>= 13), nodejs (>= 18) +Standards-Version: 4.1.4 +Homepage: https://github.com/bigbluebutton/plugin-template + +Package: bbb-plugin-template +Architecture: all +Depends: ${misc:Depends}, nodejs +Description: Share a webpage with all session participants + An official BigBlueButton plugin which allows + the presenter to display a web page to + all viewers inside of a session. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..a6d5b06 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,18 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: bbb-plugin-template + +Files: * +Copyright: 2024 BigBlueButton Inc. and by respective authors +License: LGPL-3.0+ + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along + with this program. If not, see . diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..513df94 --- /dev/null +++ b/debian/rules @@ -0,0 +1,12 @@ +#!/usr/bin/make -f + +%: + dh $@ --no-parallel --verbose + +override_dh_auto_build: + npm install + npm run build-bundle + +override_dh_auto_install: + install -d debian/bbb-plugin-template/var/www/bigbluebutton-default/assets/plugins/bbb-plugin-template + cp -r dist/* debian/bbb-plugin-template/var/www/bigbluebutton-default/assets/plugins/bbb-plugin-template diff --git a/src/index.tsx b/src/index.tsx new file mode 100644 index 0000000..e69de29