Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nguyenvukhang/semver-increment
Increments a SemVer string in a project file
https://github.com/nguyenvukhang/semver-increment
Last synced: 24 days ago
JSON representation
Increments a SemVer string in a project file
- Host: GitHub
- URL: https://github.com/nguyenvukhang/semver-increment
- Owner: nguyenvukhang
- License: mit
- Created: 2023-07-06T08:11:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-06T18:21:02.000Z (over 1 year ago)
- Last Synced: 2024-11-08T20:48:08.612Z (about 2 months ago)
- Language: TypeScript
- Size: 75.2 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `semver-increment`
![tests](https://img.shields.io/github/actions/workflow/status/nguyenvukhang/semver-increment/tests.yml?label=tests)
The `semver-increment` action lets the GitHub Action Runner obtain the
current version of the project from a file in the repository and
increment it using npm's [semver][npm-semver] library.## Example Configuration
```yaml
steps:
- uses: actions/checkout@v3
- uses: nguyenvukhang/semver-increment@v1
with:
increment: 'prerelease'
identifier: 'alpha'
version-file: 'Cargo.toml'
version-regex: '^version = "(.*)"'
```## Usage
- `increment`: How far to push the next version.
Possible values: `major`,
`premajor`, `minor`, `preminor`, `patch`, `prepatch`, or
`prerelease`.
- `identifier`: _(optional)_ The pre-release identifier. Can be `alpha`, `beta`, or
any string.
- `version-file`: The file which the SemVer string of the project is
stored in. This file will be mutated after the action completes.
- `version-regex`: A line-matching regex to let `semver-increment`
know which line to edit in `version-file`.## Outputs
- `version`: The value of the version after the increment.
- `error`: The error message, if the execution failed.### Example output usage
```yaml
steps:
- uses: actions/checkout@v3
- uses: nguyenvukhang/semver-increment@v1
id: semver
continue-on-error: true
with:
increment: 'prerelease'
identifier: 'alpha'
version-file: 'Cargo.toml'
version-regex: '^version = "(.*)"'- name: Get error message (if any)
run: echo ${{ steps.semver.outputs.error }}- name: Get the new latest version after incrementing
run: echo ${{ steps.semver.outputs.version }}
```[npm-semver]: https://www.npmjs.com/package/semver