Add QGIS plugin publish workflow#90
Merged
Merged
Conversation
|
🚀 Deployed on https://69ff68577bef4d7a740c8ac7--opengeos.netlify.app |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an automated publishing pipeline for the OpenGeoAgent QGIS plugin, including a helper script to upload the packaged plugin zip to plugins.qgis.org via XML-RPC.
Changes:
- Added a GitHub Actions
Publishworkflow to build the plugin zip, validatemetadata.txtversion against the release tag, attach the artifact to the GitHub release, and upload to plugins.qgis.org. - Added a Python helper script to upload the plugin zip to plugins.qgis.org using the XML-RPC
plugin.uploadendpoint.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
scripts/upload_to_qgis_plugin_repo.py |
New XML-RPC uploader script for pushing the packaged plugin zip to plugins.qgis.org. |
.github/workflows/publish.yml |
New release/workflow_dispatch publishing workflow to package, validate, attach, and upload the QGIS plugin. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+18
to
+35
| import os | ||
| import sys | ||
| from urllib.parse import quote | ||
| from xmlrpc.client import Binary, Fault, ProtocolError, ServerProxy | ||
|
|
||
| REPO_URL_TEMPLATE = "https://{user}:{password}@plugins.qgis.org/plugins/RPC2/" | ||
|
|
||
|
|
||
| def upload(zip_path: str, username: str, password: str) -> tuple[int, int]: | ||
| """Upload the given zip to plugins.qgis.org and return ``(plugin_id, version_id)``.""" | ||
| with open(zip_path, "rb") as fh: | ||
| payload = Binary(fh.read()) | ||
|
|
||
| endpoint = REPO_URL_TEMPLATE.format( | ||
| user=quote(username, safe=""), | ||
| password=quote(password, safe=""), | ||
| ) | ||
| server = ServerProxy(endpoint, verbose=False) |
| return 1 | ||
| except ProtocolError as exc: | ||
| print(f"Upload failed: HTTP {exc.errcode} {exc.errmsg}", file=sys.stderr) | ||
| return 1 |
| PLUGIN_NAME: open_geoagent | ||
| ZIP_PATH: dist/open_geoagent.zip | ||
| steps: | ||
| - uses: actions/checkout@v6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
metadata.txtand__init__.pyunder the expected plugin root.