Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codaline-io/dev-version-action
A github action to create dev versions per git branch
https://github.com/codaline-io/dev-version-action
actions beta-versions github javascript node typescript versioning
Last synced: 3 months ago
JSON representation
A github action to create dev versions per git branch
- Host: GitHub
- URL: https://github.com/codaline-io/dev-version-action
- Owner: codaline-io
- License: mit
- Created: 2020-01-13T12:33:19.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-13T09:29:44.000Z (9 months ago)
- Last Synced: 2024-11-20T04:17:47.051Z (3 months ago)
- Topics: actions, beta-versions, github, javascript, node, typescript, versioning
- Language: JavaScript
- Homepage: https://github.com/marketplace/actions/dev-version
- Size: 418 KB
- Stars: 2
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dev-version
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.## What is happening
1. reads a json file - in general a package.json
2. check the **version** field in the json file
3. decides if there is already a dev release
4. creates a new version for that branch or increase the dev-release number
5. writes the new version into the json file
6. provides the new version string as output of the action
7. Now you can do what you want, e.g. commit & push the changes, use it for a build step or anything else :)## Examples
### Simple branch
1. there is a branch named `dev` and its base branch is `master`
2. the `package.json` version is `1.0.0`
3. Using this action results in version `1.0.0-dev.1`
4. Running this action again, it will result in `1.0.0-dev.2`### Nested branches
1. there is a branch named `parent` and its base branch is `master`
2. now another branch `child` is based on `parent`
3. there is already a dev version in `parent` - `1.0.0-parent.1`
4. Using this action for `child` results in version `1.0.0-child.1`
5. The **nesting** is not represented in the version!### Branch names with `/`
1. there is a branch named `feat/next-big-thing`
2. Using this action for `feat/next-big-thing` results in version `1.0.0-next-big-thing.1`## Inputs
- **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. Default `package.json`.## Outputs
- **version**: The generated version number.
## Example usage
```
uses: codaline-io/[email protected]
with:
branch: feat/dev-branch
filePath: ./package.json
```