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.
- Deploy plugin releases on QGIS official plugin repository
- Publish plugin in Github releases, option to deploy a custom repository
- Easily integrated in Travis-CI or github workflows
- Completely handle translations with Transifex:
- create the project and the languages
- pull and push translations
- all TS/QM files can be managed on the CI, the
i18n
folder can be omitted from the Git repository
changelog
section in the metadata.txt can be populated if the CHANGELOG.md is present
📖 For further information, see the documentation.
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
- The code is under a git repository (
git archive
is used to bundle the plugin) - There is no uncommitted changes when doing a package/release (there is an option to allow this)
- A configuration at the top directory either in
.qgis-plugin-ci
or insetup.cfg
with a[qgis-plugin-ci]
section. - The source files of the plugin are within a sub-directory. The name of this directory will be used for the zip file.
- Any .qrc file in the source top directory (plugin_path) will be compiled and output as filename_rc.py. You can then import it using
import plugin_path.resources_rc
- Currently, qgis-plugin-ci does not compile any .ui file.
When releasing, you can publish the plugin :
- In the official QGIS plugin repository. You need to provide user name and password for your Osgeo account.
- 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.
In the case of a pre-release (from GitHub), the plugin will be flagged as experimental. If pushed to the QGIS plugin repository, the QGIS minimum version will be raised to QGIS 3.14 (only 3.14 and above support testing of experimental versions).
In any Python module, you can have a global variable as DEBUG = True
, which will be changed to False
when packaging the plugin.