diff --git a/.github/workflows/extension-release.yml b/.github/workflows/extension-release.yml index bc1e40b..f0a8985 100644 --- a/.github/workflows/extension-release.yml +++ b/.github/workflows/extension-release.yml @@ -1,14 +1,41 @@ name: extension release +# NZBGet reusable workflow for extension release +# should be triggered on tag push +# example use: + +# name: release + +# on: +# push: +# tags: +# - "v*" + +# jobs: +# release: +# uses: nzbgetcom/nzbget-extensions/.github/workflows/extension-release.yml@main +# with: +# release-file-list: lib/ ChangeLog.txt README.* main.py manifest.json +# release-file-name: videosort +# release-dir: VideoSort + on: workflow_call: inputs: + # File list to include in extension archive, space separated. + # Wildcards can be used, directories should be ended with '/' + # example: release-file-list: lib/ ChangeLog.txt README.* main.py manifest.json release-file-list: required: true type: string + # release file base name + # example: release-file-name: videosort + # will produce releases files like videosort-1.0-dist.zip release-file-name: required: true type: string + # top level directory in archive to put all files in + # can be empty release-dir: type: string default: "" diff --git a/README.md b/README.md index facb95d..3eb5da1 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Optional: - Tests check (Having tests for your extension is highly recommended) - 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). +Reusable workflows can be used from the current repository. Workflows documentation can be found [here](WORKFLOWS.md). 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 (by creating Issue or Discussion) to get it added into the extension manager. 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. diff --git a/WORKFLOWS.md b/WORKFLOWS.md new file mode 100644 index 0000000..7c3cbf5 --- /dev/null +++ b/WORKFLOWS.md @@ -0,0 +1,110 @@ +# Reusable workflows for NZBGet Extensions: + +- [Prospector](#prospector) +- [Manifest](#manifest) +- [Tests](#tests) +- [Release](#release) + +## Prospector + +Runs prospector static analysis check (strictness - medium, bundled libs ignored). + +Recommended use: branch and tags push + +Example: + +``` +jobs: + prospector: + uses: nzbgetcom/nzbget-extensions/.github/workflows/prospector.yml@main +``` + +## Manifest + +Runs extension manifest check with check-jsonschema. + +Recommended use: branch and tags push + +Example: + +``` +jobs: + manifest: + uses: nzbgetcom/nzbget-extensions/.github/workflows/manifest.yml@main +``` + +## Tests + +Can be used with extensions written in python. Runs tests check with specified python versions. + +Recommended use: branch and tags push + +Parameters: + +- `python-versions` + + Python versions for running tests, space separated + +- `supported-python-versions` + + Python versions for which tests must be passed without error + +- `test-script` + + Name of test script in repository + +- `debug` + + Enable debug output, recommended + +Example: + +``` +jobs: + tests: + uses: nzbgetcom/nzbget-extensions/.github/workflows/python-tests.yml@main + with: + python-versions: "3.6 3.7 3.8 3.9 3.10 3.11 3.12" + supported-python-versions: "3.8 3.9 3.10 3.11 3.12" + test-script: tests.py + debug: true +``` + +## Release + +Create extension release from tag. + +Recommended use: `v*` tags push + +Parameters: + +- `release-file-list` + + Space separated list of files to include in release archive. Wildcards can be used. To include directory with contents, end its name with '/' + +- `release-file-name` + + Base file name for release archive. For an example: `videosort` will create release archives like `videosort-10.9-dist.zip` + +- `release-dir` + + Top level directory in release archive to put all files in + +Example: + +``` +name: release + +on: + push: + tags: + - "v*" + +jobs: + release: + uses: nzbgetcom/nzbget-extensions/.github/workflows/extension-release.yml@main + with: + release-file-list: lib/ ChangeLog.txt README.* main.py manifest.json + release-file-name: videosort + release-dir: VideoSort +```