feat: support config-free ERP app versioning
Update major version tag / update-major-tag (push) Successful in 5s
Test action / integration (push) Successful in 11s

This commit is contained in:
NikoKS committed 2026-08-26 23:45:11 +07:00
1 parent 59e040994b
commit 75fdf8a822
5 files changed
+32 -102

No files matched your search

+5 -20
View File
@@ -2,7 +2,7 @@
A forge-neutral composite action for preparing a versioned Frappe/ERPNext app before merging its release branch. It uses [`bump-my-version`](https://callowayproject.github.io/bump-my-version/) and ordinary Git commands, without `gh` or GitHub API calls.
The action compares `[tool.bumpversion].current_version` on the checked-out target branch with the configured base branch:
The action compares the app's `__version__` on the checked-out target branch with the configured base branch:
- Equal: bump, commit, and optionally push the new version.
- Target newer than base: do nothing, making PR synchronization events idempotent.
@@ -13,22 +13,9 @@ The action compares `[tool.bumpversion].current_version` on the checked-out targ
- A Linux runner with Bash, Git, and Python 3.11 or newer.
- A clean checkout of the branch that should receive the version commit.
- Persisted Git credentials with permission to push that branch.
- Stable `MAJOR.MINOR.PATCH` versions.
- A `bump-my-version` configuration that includes every version file.
- A version file containing a stable `MAJOR.MINOR.PATCH` assignment such as `__version__ = "0.0.1"`.
Example `pyproject.toml` for a Frappe app:
```toml
[tool.bumpversion]
current_version = "0.0.1"
commit = false
tag = false
[[tool.bumpversion.files]]
filename = "erp_operations/__init__.py"
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'
```
No `bump-my-version` configuration is required in the consuming app. The action passes the current version, search/replace templates, and version file directly to the CLI.
## Gitea Actions usage
@@ -61,7 +48,6 @@ jobs:
# The absolute URL is required when Gitea's DEFAULT_ACTIONS_URL is "github".
uses: https://gitea.cptckp.com/Nurinda/bump-erp-app-version@v1
with:
config-file: pyproject.toml
version-file: erp_operations/__init__.py
base-branch: main
target-branch: develop
@@ -79,8 +65,7 @@ Gitea may suppress workflows caused by pushes authenticated with its built-in `G
| Input | Default | Description |
|---|---|---|
| `config-file` | `pyproject.toml` | `bump-my-version` TOML configuration |
| `version-file` | empty | App `__init__.py` used to bootstrap a base branch that predates the configuration |
| `version-file` | required | App `__init__.py` containing the authoritative `__version__` |
| `base-branch` | `main` | Branch providing the baseline version |
| `target-branch` | `develop` | Checked-out branch receiving the commit |
| `bump` | `patch` | `major`, `minor`, or `patch` |
@@ -104,7 +89,7 @@ Gitea may suppress workflows caused by pushes authenticated with its built-in `G
The action does not force-push, create tags, publish releases, or call forge APIs. Concurrent release jobs are resolved safely by the remote rejecting a non-fast-forward push. Configure workflow-level concurrency if release PRs can overlap.
For the first versioned release, the base branch might not contain `[tool.bumpversion]` yet. Set `version-file` to the app's `__init__.py`; the action will read its base-branch `__version__` as the bootstrap baseline. Once the configuration reaches the base branch, it becomes the authoritative baseline.
The configured `version-file` is the only version source. The action reads it from both branches and commits only the version change produced by `bump-my-version`.
## Releasing the action