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

Update extension workflows and docs #22

Merged
merged 16 commits into from
Sep 27, 2024
23 changes: 23 additions & 0 deletions .github/workflows/check-master-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: check master manifest

on:
push:
branches:
- feature/*
pull_request:
branches:
- main

jobs:
manifest:
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v4

- name: Check master extensions manifest
run: |
pip install --user check-jsonschema
check-jsonschema --schemafile json-schema/master-manifest.json extensions.json
19 changes: 19 additions & 0 deletions .github/workflows/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: manifest

on:
workflow_call:

jobs:
manifest:
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v4

- name: Check extension manifest
run: |
pip install --user check-jsonschema
curl -o /tmp/extension-manifest.json https://raw.githubusercontent.com/nzbgetcom/nzbget-extensions/feature/workflows/json-schema/extension-manifest.json
check-jsonschema --schemafile /tmp/extension-manifest.json manifest.json
18 changes: 18 additions & 0 deletions .github/workflows/prospector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: prospector

on:
workflow_call:

jobs:
prospector:
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v4

- name: Run prospector static analysis
run: |
pip install --user prospector
prospector --strictness medium -i lib
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,33 @@ This repository contains a list of NZBGet extensions, which is used by the Exten
1. Make your extension compatible with NZBGet spec v23+.
[Documentation](https://github.com/nzbgetcom/nzbget/blob/develop/docs/extensions/EXTENSIONS.md).

2. Once your extension is ready, please contact NZBGet maintainers to get it added into the extension manager
(we'll create a project for you - `https://github.com/nzbgetcom/Extension-YourExtensionName/`).
2. Make sure that yours extension repository contains the required and possibly optional workflows:
phnzb marked this conversation as resolved.
Show resolved Hide resolved

3. Create a fork of that repository, add your extension to it, and make a Pull request.
Mandatory:
- Prospector Python Static Analysis check
- Manifest check

>You can use any of nzbgetcom extension as example,
e.g [FakeDetector](https://github.com/nzbgetcom/Extension-FakeDetector).
Optional:
- Tests check (availability of tests is highly recommended)
phnzb marked this conversation as resolved.
Show resolved Hide resolved
- Release workflow

Reusable workflows can be used from the current repository. For an example of their use, please refer to the Example extensions repository (see below).

3. Once your extension is ready, please contact NZBGet maintainers to get it added into the extension manager.
phnzb marked this conversation as resolved.
Show resolved Hide resolved
We will create a fork of your extension repository, mirror your release to include it in the extension manager, and make a PR to that repository.

## Example extension (can be used as quickstart):

https://github.com/nzbgetcom/Extenson-Example

Demonstrates:
- Using extension parameters
- Using Tests
- Using workflows:
- Prospector check
- Manifest check
- Tests check
- Release workflow

## Questions
You can use [issues](https://github.com/nzbgetcom/nzbget/issues) for any questions.
Expand Down
208 changes: 208 additions & 0 deletions json-schema/extension-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://nzbget.com/extension-manifest.schema.json",
"title": "Extension manifest",
"description": "NZBGet Extension manifest schema",
"type": "object",
"properties": {
"main": {
"description": "The name of the executable file",
"type": "string"
},
"name": {
"description": "The extension name, identifier and prefix needed to save the extension configuration options to nzbget.conf",
"type": "string"
},
"homepage": {
"description": "Link to the extension homepage",
"type": "string"
},
"kind": {
"description": "Kind, depending on the purpose of the extension",
"type": "string"
},
"displayName": {
"description": "The name that will be displayed in the web interface",
"type": "string"
},
"version": {
"description": "Extension version",
"type": "string"
},
"nzbgetMinVersion": {
"description": "NZBGet minimum required version (optional)",
"type": "string"
},
"author": {
"description": "Author's name",
"type": "string"
},
"license": {
"description": "Extension license",
"type": "string"
},
"about": {
"description": "Brief description of the extension",
"type": "string"
},
"description": {
"description": "More detailed description of the extension",
"type": "array",
"items": {
"type": "string"
},
"minItems": 0
},
"queueEvents": {
"description": "Events that could be used by the extension",
"type": "string"
},
"requirements": {
"description": "List of requirements",
"type": "array",
"items": {
"type": "string"
},
"minItems": 0
},
"options": {
"description": "Extension configuration options",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "Option name",
"type": "string"
},
"displayName": {
"description": "Option display name in WebUI",
"type": "string"
},
"value": {
"description": "Default option value",
"type": [
"number",
"string"
]
},
"description": {
"description": "Option description",
"type": "array",
"items": {
"type": "string"
},
"minItems": 0
},
"select": {
"description": "Option values for select",
"type": "array",
"items": {
"type": [
"number",
"string"
]
},
"minItems": 0
}
},
"required": [
"name",
"displayName",
"value",
"description",
"select"
]
},
"minItems": 0
},
"commands": {
"description": "Extension commands",
"type": "array",
"items": {
"type": "object",
"properties": {
"section": {
"description": "Command section",
"type": "string"
},
"name": {
"description": "Command name",
"type": "string"
},
"action": {
"description": "Command action",
"type": "string"
},
"displayName": {
"description": "Option display name in WebUI",
"type": "string"
},
"description": {
"description": "Command description",
"type": "array",
"items": {
"type": "string"
},
"minItems": 0
}
},
"required": [
"name",
"action",
"displayName",
"description"
]
},
"minItems": 0
},
"sections": {
"description": "Extension sections",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "Section name",
"type": "string"
},
"prefix": {
"description": "Section prefix",
"type": "string"
},
"multi": {
"description": "Section is dynamic",
"type": "boolean"
}
},
"required": [
"name",
"prefix",
"multi"
]
},
"minItems": 0
},
"taskTime": {
"description": "For SCHEDULER extensions: start time of the extension",
"type": "string"
}
},
"required": [
"main",
"name",
"homepage",
"kind",
"displayName",
"version",
"author",
"license",
"about",
"description",
"queueEvents",
"requirements",
"options",
"commands",
"taskTime"
]
}
60 changes: 60 additions & 0 deletions json-schema/master-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://nzbget.com/master-manifest.schema.json",
"title": "Master list of extensions manifest",
"description": "NZBGet master list of extension manifest schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "The extension name",
"type": "string"
},
"homepage": {
"description": "Link to the extension homepage",
"type": "string"
},
"displayName": {
"description": "The name that will be displayed in the web interface",
"type": "string"
},
"version": {
"description": "Extension version",
"type": "string"
},
"nzbgetMinVersion": {
"description": "NZBGet minimum required version",
"type": "string"
},
"author": {
"description": "Author's name",
"type": "string"
},
"license": {
"description": "Extension license",
"type": "string"
},
"about": {
"description": "Brief description of the extension",
"type": "string"
},
"url": {
"description": "URL of extension archive",
"type": "string"
}
},
"minItems": 0,
"required": [
"name",
"homepage",
"displayName",
"version",
"nzbgetMinVersion",
"author",
"license",
"about",
"url"
]
}
}