This template integrates GitHub Action/GitLab Pipeline for automated release. By pushing a Git tag, you can automatically trigger the build and release process.
Note
If you want to release a wheel package,
you need to update the project.version field in pyproject.toml before creating a Git tag.
-
Runner Configuration: Verify that the GitLab Runner for the target platform is properly installed and configured.
-
Code Preparation: Set
base_url,project_namebefore call theGitlabUpdater.fetch()method.
- Code Preparation: Set
project_namebefore call theGithubUpdater.fetch()method.
Manually set the base_url and token.
e.g.
# before init QApplication
def init_updater():
from app.builtin.gitlab_updater import GitlabUpdater
updater = GitlabUpdater()
updater.base_url = "https://gitlab.example.com"
updater.project_name = "owner/project"
# check updates
async def check_updates():
import sys
from app.builtin.update_widget import UpdateWidget
from app.builtin.gitlab_updater import GitlabUpdater
updater = GitlabUpdater.instance()
await updater.fetch()
if updater.check_for_update():
# If you have a parent, set it as a parameter.
update_widget = UpdateWidget(parent=None, updater=updater)
# Force update without user confirm
# > await update_widget.on_update()
# Ask user for update
await update_widget.show()
if update_widget.need_restart:
# Apply update and restart if update is ready
updater.apply_update()
sys.exit(0)When you push a tag to the remote repository, the CI/CD pipeline will be automatically triggered to build and publish the release.
The tag_name will serve as both the version number and the release channel.
The tag must follow one of the following formats:
-
x.y.z -
x.y.z-stable -
x.y.z-beta
Regex pattern:
([0-9]+(.[0-9]+){1,3})(-(stable|alpha|beta|nightly|dev))?$
Where:
-
x.y.z → Semantic Versioning, e.g.,
1.2.3 -
channel → Release channel (optional). Currently supported values:
stable(stable release)alpha(alpha release)beta(beta release)nightly(nightly release)dev(dev release)
If additional release channels are required, the Version class constructor logic must be extended.
Type your configuration in updater.json:
{
"version": "0.0.0",
"proxy": "http://127.0.0.1:7890",
"channel": "beta"
}The version field will not be automatically updated; it is only used to manually set or override the current version.
This is typically used for testing purposes.
-
Version parsing and update logic:
app/builtin/updater.py,app/builtin/*_updater.py -
CI/CD release scripts:
.gitlab-ci.yml.github/workflow/release.yml- and related scripts