This action generates a new dev version number for a git branch, e.g. 1.0.0-dev.1
for all projects where the version is part of a json file, e.g. package.json
.
It accepts a json file path and a branch name as input.
No release magic or analyzing changelogs is happening.
The main part of the version, e.g. 1.0.0
will not be touched. It is more like "This dev-version is based on v1.0.0" instead of semantic releases, where each prerelease bumps the correct breaking, feature or fix version.
- reads a json file - in general a package.json
- check the version field in the json file
- decides if there is already a dev release
- creates a new version for that branch or increase the dev-release number
- writes the new version into the json file
- provides the new version string as output of the action
- Now you can do what you want, e.g. commit & push the changes, use it for a build step or anything else :)
- there is a branch named
dev
and its base branch ismaster
- the
package.json
version is1.0.0
- Using this action results in version
1.0.0-dev.1
- Running this action again, it will result in
1.0.0-dev.2
- there is a branch named
parent
and its base branch ismaster
- now another branch
child
is based onparent
- there is already a dev version in
parent
-1.0.0-parent.1
- Using this action for
child
results in version1.0.0-child.1
- The nesting is not represented in the version!
- there is a branch named
feat/next-big-thing
- Using this action for
feat/next-big-thing
results in version1.0.0-next-big-thing.1
- branch: The name of the branch to check if the current branch is master or a dev-branch. Default
master
. - filePath: The json file path or file name where the
version
field is present. Defaultpackage.json
.
- version: The generated version number.
uses: codaline-io/[email protected]
with:
branch: feat/dev-branch
filePath: ./package.json