Skip to content

Commit 197cc4b

Browse files
antobinaryGuiLeme
andauthored
Merge with template (packaging, CI, ...) (#2)
* [add-lint-and-ci] - added lint, ci and boilerplate for plugin building * [add-lint-and-ci] Customize files for plugin, not SDK * fix typo * build: initial stab at packaging * build: deviate from template * bump to 0.1.1 * allow manual trigger of build action * update README * add missing dependencies from template * audit fix force --------- Co-authored-by: Guilherme Leme <leme.guilherme.p@gmail.com>
1 parent e3fed06 commit 197cc4b

21 files changed

Lines changed: 1257 additions & 642 deletions
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: BBB-Plugin-SDK
3+
about: Template for creating BBB-Plugin-SDK Issue (SDK to create plugins for BigBlueButton).
4+
title: ''
5+
labels: 'module: client'
6+
assignees: ''
7+
8+
---
9+
10+
<!--PLEASE DO NOT FILE ISSUES FOR GENERAL SUPPORT QUESTIONS.
11+
This issue tracker is only for bbb development related issues.-->
12+
13+
**Describe the bug**
14+
A clear and concise description of what the bug is.
15+
16+
**To Reproduce**
17+
Steps to reproduce the behavior:
18+
1. Go to '...'
19+
2. Click on '....'
20+
3. Scroll down to '....'
21+
4. See error
22+
23+
**Expected behavior**
24+
A clear and concise description of what you expected to happen.
25+
26+
**Actual behavior**
27+
A clear and concise description of what you expected to happen.
28+
29+
**Screenshots**
30+
If applicable, add screenshots to help explain your problem.
31+
32+
**BBB version, plugin in which The bug happened and SDK version:**
33+
BigBlueButton continually evolves. Providing the version/build helps us to pinpoint when an issue was introduced.
34+
Example:
35+
$ sudo bbb-conf --check | grep BigBlueButton
36+
BigBlueButton Server 2.2.2 (1816)
37+
38+
The SDK version is mentioned in the package.json file of the plugin, so search for "bigbluebutton-html-plugin-sdk" inside that file.
39+
40+
**Desktop (please complete the following information):**
41+
- OS: [e.g. Windows, Mac]
42+
- Browser [e.g. Chrome, Safari]
43+
- Version [e.g. 22]
44+
45+
**Smartphone (please complete the following information):**
46+
- Device: [e.g. iPhone6]
47+
- OS: [e.g. iOS8.1]
48+
- Browser [e.g. stock browser, Safari]
49+
- Version [e.g. 22]
50+
51+
**Additional context**
52+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: BigBlueButton GitHub Repository
4+
url: https://github.com/bigbluebutton/bigbluebutton
5+
- name: BigBlueButton Plugin SDK GitHub Repository
6+
url: https://github.com/bigbluebutton/bigbluebutton-html-plugin-sdk
7+
about: Everything BigBlueButton (in case you are looking for something different than plugin sdk)
8+
- name: Looking for commercial support in building/maintaining plugins
9+
url: https://bigbluebutton.org/commercial-support
10+
about: List of companies offering commercial BigBlueButton support
11+
- name: BigBlueButton Developers Mailing List:
12+
url: https://groups.google.com/forum/#!forum/bigbluebutton-dev
13+
about: Ask questions and share experiences with other BigBlueButton developers (including about plugins).

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!--
2+
PLEASE READ THIS MESSAGE.
3+
4+
HOW TO WRITE A GOOD PULL REQUEST?
5+
6+
- Make it small.
7+
- Do only one thing.
8+
- Avoid re-formatting.
9+
- Make sure the code builds and works.
10+
- Write useful descriptions and titles.
11+
- Address review comments in terms of additional commits.
12+
- Do not amend/squash existing ones unless the PR is trivial.
13+
- Read the contributing guide: https://docs.bigbluebutton.org/support/faq.html#bigbluebutton-development-process
14+
- Sign and send the Contributor License Agreement: https://docs.bigbluebutton.org/support/faq.html#why-do-i-need-to-sign-a-contributor-license-agreement-to-contribute-source-code
15+
16+
-->
17+
18+
### What does this PR do?
19+
20+
<!-- A brief description of each change being made with this pull request. -->
21+
22+
### Closes Issue(s)
23+
<!-- List here all the issues closed by this pull request. Use keyword `closes` before each issue number
24+
Closes #123456
25+
-->
26+
Closes #
27+
28+
29+
### Motivation
30+
31+
<!-- What inspired you to submit this pull request? -->
32+
33+
### More
34+
35+
<!-- Anything else we should know when reviewing? -->
36+
- [ ] Added/updated documentation
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Merge branches
2+
on:
3+
workflow_call:
4+
5+
runs:
6+
using: "composite"
7+
steps:
8+
- name: Checkout ${{ github.event.pull_request.base.ref || 'master' }}
9+
uses: actions/checkout@v4
10+
with:
11+
ref: ${{ github.event.pull_request.base.ref || '' }}
12+
fetch-depth: 0 # Fetch all history
13+
- name: Merge pr-${{ github.event.number }} into ${{ github.event.pull_request.base.ref }}
14+
if: github.event_name == 'pull_request'
15+
shell: bash
16+
run: |
17+
git config user.name "BBB Automated Tests"
18+
git config user.email "tests@bigbluebutton.org"
19+
git config pull.rebase false
20+
git pull origin pull/${{ github.event.number }}/head:${{ github.head_ref }}

.github/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ newPRWelcomeComment: >
55
Thank you for this contribution!
66
Could you please confirm if you already sent in the signed Contributor License Agreement? See https://docs.bigbluebutton.org/support/faq.html#why-do-i-need-to-sign-a-contributor-license-agreement-to-contribute-source-code
77
Thanks in advance!
8-

.github/stale.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 270
3+
# Number of days of inactivity before a stale issue is closed
4+
daysUntilClose: 90
5+
# Issues with these labels will never be considered stale
6+
exemptLabels:
7+
- "status: accepted"
8+
- "status: verify"
9+
- "target: security"
10+
- "type: discussion"
11+
# Label to use when marking an issue as stale
12+
staleLabel: "status: stale"
13+
# Comment to post when marking an issue as stale. Set to `false` to disable
14+
markComment: >
15+
This issue has been automatically marked as stale because it has not had
16+
recent activity. It will be closed if no further activity occurs. Thank you
17+
for your contributions.
18+
# Comment to post when closing a stale issue. Set to `false` to disable
19+
closeComment: false
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Automated tests - publish results
2+
on:
3+
workflow_run:
4+
workflows:
5+
- Automated tests
6+
types:
7+
- completed
8+
9+
jobs:
10+
get-pr-data:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.event.workflow_run.event == 'pull_request' }}
13+
outputs:
14+
pr-number: ${{ steps.set-env.outputs.pr-number }}
15+
workflow-id: ${{ steps.set-env.outputs.workflow-id }}
16+
steps:
17+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
18+
- name: Download artifact
19+
uses: actions/github-script@v6
20+
with:
21+
script: |
22+
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
23+
owner: context.repo.owner,
24+
repo: context.repo.repo,
25+
run_id: context.payload.workflow_run.id,
26+
});
27+
28+
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
29+
return artifact.name == "pr-comment-data"
30+
})[0];
31+
let download = await github.rest.actions.downloadArtifact({
32+
owner: context.repo.owner,
33+
repo: context.repo.repo,
34+
artifact_id: matchArtifact.id,
35+
archive_format: 'zip',
36+
});
37+
let fs = require('fs');
38+
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr-comment-data.zip`, Buffer.from(download.data));
39+
- name: Unzip artifact
40+
run: unzip pr-comment-data.zip
41+
- name: Set env variables
42+
id: set-env
43+
run: |
44+
echo "pr-number=$(cat ./pr_number)" >> $GITHUB_OUTPUT
45+
echo "workflow-id=$(cat ./workflow_id)" >> $GITHUB_OUTPUT
46+
comment-pr:
47+
runs-on: ubuntu-latest
48+
permissions:
49+
pull-requests: write
50+
needs: get-pr-data
51+
steps:
52+
- name: Find Comment
53+
uses: peter-evans/find-comment@v2
54+
id: fc
55+
with:
56+
issue-number: ${{ needs.get-pr-data.outputs.pr-number }}
57+
comment-author: "github-actions[bot]"
58+
body-includes: Automated tests Summary
59+
- name: Remove previous comment
60+
if: steps.fc.outputs.comment-id != ''
61+
uses: actions/github-script@v6
62+
with:
63+
script: |
64+
github.rest.issues.deleteComment({
65+
owner: context.repo.owner,
66+
repo: context.repo.repo,
67+
comment_id: ${{ steps.fc.outputs.comment-id }}
68+
})
69+
- name: Passing tests comment
70+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
71+
uses: peter-evans/create-or-update-comment@v2
72+
with:
73+
issue-number: ${{ needs.get-pr-data.outputs.pr-number }}
74+
body: |
75+
<h1>Automated tests Summary</h1>
76+
<h3><strong>:white_check_mark:</strong> All the CI tests have passed!</h3>
77+
- name: Failing tests comment
78+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
79+
uses: peter-evans/create-or-update-comment@v2
80+
with:
81+
issue-number: ${{ needs.get-pr-data.outputs.pr-number }}
82+
body: |
83+
<h1> Automated tests Summary</h1>
84+
<h3><strong>:rotating_light:</strong> Test workflow has failed</h3>
85+
86+
___
87+
88+
[Click here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ needs.get-pr-data.outputs.workflow-id }}) to check the action test reports
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
name: "📦 Build .deb package for plugin"
3+
on:
4+
push:
5+
branches: [ "main"]
6+
paths-ignore:
7+
- debian/changelog
8+
pull_request:
9+
branches: [ "main" ]
10+
paths-ignore:
11+
- debian/changelog
12+
workflow_dispatch: # enable manual triggering
13+
14+
jobs:
15+
build-deb-package:
16+
runs-on: ${{ matrix.os }}
17+
18+
strategy:
19+
matrix:
20+
os: [ubuntu-22.04]
21+
22+
env:
23+
OS_VERSION: ${{ matrix.os }}
24+
defaults:
25+
run:
26+
working-directory: .
27+
steps:
28+
- name: Checkout source code
29+
uses: actions/checkout@v4
30+
31+
- name: Extract and print repository name
32+
run: |
33+
echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> $GITHUB_ENV
34+
35+
- name: Set up Node.js
36+
run: |
37+
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
38+
sudo apt-get install -y nodejs
39+
40+
- name: Verify Node.js installation
41+
run: |
42+
node -v
43+
npm -v
44+
45+
- name: Install dependencies
46+
run: |
47+
sudo apt-get update
48+
sudo apt-get install -y devscripts debhelper
49+
50+
- name: Build Debian package
51+
run: |
52+
sudo dpkg-buildpackage -us -uc
53+
54+
- name: Create artifacts directory and move .deb files
55+
run: |
56+
mkdir -p artifacts
57+
mv ../*.deb artifacts/ || mv ./*.deb artifacts/
58+
ls -la artifacts
59+
60+
- name: Upload Debian Package
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: "${{ env.REPO_NAME }}-${{ env.OS_VERSION }}"
64+
path: artifacts/*.deb
65+
66+
release:
67+
name: "Upload assets to release"
68+
needs: build-deb-package
69+
runs-on: ${{ matrix.os }}
70+
71+
strategy:
72+
matrix:
73+
os: [ubuntu-22.04]
74+
75+
env:
76+
OS_VERSION: ${{ matrix.os }}
77+
if: ${{ github.ref_type == 'tag' }}
78+
permissions:
79+
contents: write
80+
actions: read
81+
steps:
82+
- uses: actions/checkout@v4
83+
84+
- name: Extract and print repository name
85+
run: |
86+
echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> $GITHUB_ENV
87+
88+
- uses: actions/download-artifact@v4
89+
with:
90+
name: "${{ env.REPO_NAME }}-${{ env.OS_VERSION }}"
91+
path: "${{ env.REPO_NAME }}-${{ env.OS_VERSION }}"
92+
93+
- name: Create release asset archives
94+
run: zip --junk-paths --recurse-paths --compression-method store "${{ env.REPO_NAME }}-${{ env.OS_VERSION }}.zip" "${{ env.REPO_NAME }}-${{ env.OS_VERSION }}"
95+
96+
- name: Upload release assets
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
run: gh release upload ${{ github.ref_name }} "${{ env.REPO_NAME }}-${{ env.OS_VERSION }}.zip"
100+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Merge conflict check
2+
on:
3+
push:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
main:
14+
permissions:
15+
pull-requests: write # for eps1lon/actions-label-merge-conflict to label PRs
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Check for dirty pull requests
19+
uses: eps1lon/actions-label-merge-conflict@v3
20+
with:
21+
dirtyLabel: "status: conflict"
22+
repoToken: "${{ secrets.GITHUB_TOKEN }}"
23+
commentOnDirty: |
24+
This pull request has conflicts ☹
25+
Please resolve those so we can review the pull request.
26+
Thanks.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Typescript - compile code
2+
on: [pull_request]
3+
permissions:
4+
contents: read
5+
jobs:
6+
ts-code-compilation:
7+
runs-on: ubuntu-22.04
8+
steps:
9+
- uses: actions/checkout@v4
10+
with:
11+
fetch-depth: 1
12+
- name: Merge branches
13+
uses: ./.github/actions/merge-branches
14+
- name: install node
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 20.x
18+
- name: run npm install
19+
run: npm install
20+
- name: typescript code compilation
21+
run: npx tsc

0 commit comments

Comments
 (0)