[QGIS-Developer] Deploy plugins directly from github

Olivier Dalang olivier.dalang at gmail.com
Thu Jul 20 07:52:22 PDT 2017


Dear List,

Using QGIS 2.18, I'm trying to find a way to deploy plugins directly from
github using the following procedure :

1. Add a plugin.xml file to my repo, with this content :

> <?xml version = '1.0' encoding = 'UTF-8'?>

> <plugins>
    <pyqgis_plugin name="MyPlugin" version="0.0.13">

>         <version>0.0.13</version>

>         <author_name>Olivier Dalang</author_name>

>         <download_url>
https://github.com/{username}/MyPlugin/archive/0.0.13.zip</download_url>

>         <file_name>MyPlugin-0.0.13.zip</file_name>

>     </pyqgis_plugin>
</plugins>

2. Add the xml repo in QGIS plugin manager
https://raw.githubusercontent.com/{username}/MyPlugin/master/repository.xml

3. Create and push a tag named 0.0.13

If this worked, it would be a big win, as it would allow to deploy plugins
updates really easily, just by creating tags and updating the xml file
whenever I want my users to update the plugin. It avoids having to create
the zip, host it somewhere else, and maintain an up to date xml separately
for each update.

The only thing is that it doesn't work. I get an error on installing the
plugin : "Plugin installation failed. Failed to unzip package".

Github appends the tag name (or branch name) to the downloaded folder
(inside the zip). When unpacking the zip, I get a folder called
MyPlugin-0.0.13 instead of just MyPlugin. I suspect this causes the problem.
I tried to workaround this problem by using the master branch, and renaming
my plugin to MyPlugin-master, but I still get the same error. Maybe it is
so that dashes are not supported at all in plugin names ?

Was anyone able to setup such a workflow ?

Kind regards,

Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170720/fd8e52d0/attachment.html>


More information about the QGIS-Developer mailing list