Skip to content

Commit

Permalink
Add workflows documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
phnzb committed Sep 27, 2024
1 parent 2159e3d commit fa4d75e
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/extension-release.yml
Original file line number Diff line number Diff line change
@@ -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: ""
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
110 changes: 110 additions & 0 deletions WORKFLOWS.md
Original file line number Diff line number Diff line change
@@ -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
```

0 comments on commit fa4d75e

Please sign in to comment.