opengisch / qgis-plugin-ci

Let it package and release your QGIS plugin and do something funnier instead!
https://opengisch.github.io/qgis-plugin-ci/
GNU General Public License v3.0
51 stars 17 forks source link
ci-cd cli qgis qgis-plugin

QGIS Plugin CI

PyPi version badge PyPI - Downloads PyPI - Python Version

Code style: black Imports: isort pre-commit pre-commit.ci status

Contains scripts to perform automated testing and deployment for QGIS plugins. These scripts are written for and tested on GitHub, Travis-CI, github workflows and Transifex.

:book: For further information, see the documentation.

QGIS-Plugin-CI is best served if you use these two conventions :

Command line

usage: qgis-plugin-ci [-h] [-v]
                      {package,changelog,release,pull-translation,push-translation}
                      ...

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         print the version and exit

commands:
  qgis-plugin-ci command

  {package,changelog,release,pull-translation,push-translation}
    package             creates an archive of the plugin
    changelog           gets the changelog content
    release             release the plugin
    pull-translation    pull translations from Transifex
    push-translation    update strings and push translations

Requirements

See parameters.py for more parameters and details. Notice that the name of this directory will be used for the zip file.

QRC and UI files

Publishing plugins

When releasing, you can publish the plugin :

  1. In the official QGIS plugin repository. You need to provide user name and password for your Osgeo account.
  2. As a custom repository in Github releases and which can be added later in QGIS. The address will be: https://github.com/__ORG__/__REPO__/releases/latest/download/plugins.xml

Both can be achieved in the same process.

Pre-release and experimental

In the case of a pre-release (either from the tag name according to Semantic Versioning or from the GitHub release), the plugin will be flagged as experimental.

The tool will recognise any label use as a suffix to flag it as pre-release :

Debug

In any Python module, you can have a global variable as DEBUG = True, which will be changed to False when packaging the plugin.

Other tools

QGIS-Plugin-Repo

QGIS-Plugin-CI can generate the plugins.xml file, per plugin. If you want to merge many XML files into one to have a single QGIS plugin repository providing many plugins, you should check QGIS-Plugin-Repo. It's designed to run on CI after QGIS-Plugin-CI.