Skip to main content

Tool for merging XML files from QGIS-Plugin-CI.

Project description

QGIS-Plugin-Repo

🧪 Tests PyPi version badge PyPI - Downloads PyPI - Python Version

Presentation

Merge some QGIS plugin repository together

Single QGIS repository

qgis-plugin-repo merge output_qgis_plugin_ci.xml all_plugins.xml
qgis-plugin-repo merge https://path/to/plugins_to_add.xml all_plugins.xml

The file all_plugins.xml will be edited, according to the plugin name, plugin version and its experimental flag or not. In an XML file, the plugin can have two versions : one experimental and the other one not.

Many QGIS repositories

You can also have multiple XML files like :

qgis/
├── plugins-3.4.xml
├── plugins-3.10.xml
├── plugins-3.16.xml
├── plugins-3.22.xml
└── plugins-3-28.xml

Then, it's possible to call qgis-plugin-repo to dispatch an XML plugin in matching QGIS XML files :

qgis-plugin-repo merge output_qgis_plugin_ci.xml plugins-*.xml

According to QGIS minimum/maximum versions hardcoded in the XML (and therefore in the metadata.txt), only corresponding QGIS XML files will be edited.

For now, only plugins between 3.0 and 3.99 and without a patch QGIS version number are supported.

Read a QGIS repository

You can read an XML file :

qgis-plugin-repo read https://plugins.qgis.org/plugins/plugins.xml?qgis=3.10

GitHub Actions

The main purpose of this tool is to run on CI.

In the plugin repository, after QGIS-Plugin-CI :

  - name: Repository Dispatch
      uses: peter-evans/repository-dispatch@v1
      with:
        token: ${{ secrets.TOKEN }}
        repository: organisation/repository
        event-type: merge-plugins
        client-payload: '{"name": "NAME_OF_PLUGIN", "version": "${{ env.RELEASE_VERSION }}", "url": "URL_OF_LATEST.xml"}'

Note that QGIS-Plugin-CI package or release must be been called with --create-plugin-repo because this tool will use the XML file generated.

In the main repository with a docs/plugins.xml to edit :

name: 🔀 Plugin repository

on:
  repository_dispatch:
    types: [merge-plugins]

jobs:
  merge:
    runs-on: ubuntu-latest
    steps:
      - run: >
         echo ${{ github.event.client_payload.name }}
         echo ${{ github.event.client_payload.version }}
         echo ${{ github.event.client_payload.url }}

      - name: Get source code
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
          token: ${{ secrets.BOT_HUB_TOKEN }}  # Important to launch CI on a commit from a bot

      - name: Set up Python 3.8
        uses: actions/setup-python@v2.2.2
        with:
          python-version: 3.8

      - name: Install qgis-plugin-repo
        run: pip3 install qgis-plugin-repo

      - name: Merge
        run: qgis-plugin-repo merge ${{ github.event.client_payload.url }} docs/plugins.xml

      - name: Commit changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "Publish QGIS Plugin ${{ github.event.client_payload.name }} ${{ github.event.client_payload.version }}"
          commit_user_name: ${{ secrets.BOT_NAME }}
          commit_user_email: ${{ secrets.BOT_MAIL }}
          commit_author: ${{ secrets.BOT_NAME }}

Tests

cd tests
python -m unittest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qgis-plugin-repo-0.4.3.tar.gz (8.9 kB view details)

Uploaded Source

File details

Details for the file qgis-plugin-repo-0.4.3.tar.gz.

File metadata

  • Download URL: qgis-plugin-repo-0.4.3.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for qgis-plugin-repo-0.4.3.tar.gz
Algorithm Hash digest
SHA256 67bc62287f5dfb11422216606b282bb019209ca0a85a6a5fefc6d09f9488c20a
MD5 d27e77c18dd56300c903eda0440dfd89
BLAKE2b-256 a7f60328a94032c86cd4e0c13ba7772a52edb14f0bdaaefffb2b65703f8ec380

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page