Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/christian-draeger/increment-semantic-version
https://github.com/christian-draeger/increment-semantic-version
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/christian-draeger/increment-semantic-version
- Owner: christian-draeger
- License: mit
- Created: 2020-01-17T19:53:24.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-12-21T23:31:41.000Z (24 days ago)
- Last Synced: 2025-01-04T09:46:09.439Z (11 days ago)
- Language: Shell
- Size: 48.8 KB
- Stars: 84
- Watchers: 2
- Forks: 25
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-actions - Increment Semantic Version - Bump a given semantic version (SemVer), depending on given release type. (Community Resources / Utility)
- fucking-awesome-actions - Increment Semantic Version - Bump a given semantic version (SemVer), depending on given release type. (Community Resources / Utility)
- awesome-workflows - Increment Semantic Version - Bump a given semantic version (SemVer), depending on given release type. (Community Resources / Utility)
README
# Increment Semantic Version
This is a GitHub action to bump a given semantic version, depending on a given version fragment.
## Inputs
### `current-version`
**Required** The current semantic version you want to increment. (e.g. 3.12.5)
### `version-fragment`
**Required** The versions fragment you want to increment.
Possible options are **[ major | feature | minor | bug | patch | hotfix | alpha | beta | pre | rc ]**
Note: [feature | minor] and [bug | patch | hotfix] are synonyms.
## Outputs
### `next-version`
The incremented version.
## Example usage
name: Update Version
on:
workflow_dispatch:
env:
CURRENT_VERSION_TOP_LEVEL: 'v2.11.7-alpha.3'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Bump release version
id: bump_version
uses: christian-draeger/[email protected]
with:
current-version: ${{ env.CURRENT_VERSION_TOP_LEVEL }} # also accepted: 'v2.11.7-alpha.3' | '2.11.7-alpha3'
version-fragment: 'feature'
- name: Do something with your bumped release version
run: echo ${{ steps.bump_version.outputs.next-version }} # will print 2.12.0
env-set-in-job:
runs-on: ubuntu-latest
steps:
- name: set current version from file
id: set_current_version
run: echo "::set-env name=CURRENT_VERSION::$(cat version.txt)"
- name: Bump release version
id: bump_version
uses: christian-draeger/[email protected]
with:
current-version: ${{ env.CURRENT_VERSION }} # also accepted: 'v2.11.7-alpha.3' | '2.11.7-alpha3'
version-fragment: 'feature'
- name: Do something with your bumped release version
run: echo ${{ steps.bump_version.outputs.next-version }} # will print 2.12.0
## input / output Examples| version-fragment | current-version | output |
|------------------|-----------------|----------------|
| major | 2.11.7 | 3.0.0 |
| major | v2.11.7 | 3.0.0 |
| major | 2.11.7-alpha.3 | 3.0.0 |
| feature | 2.11.7 | 2.12.0 |
| feature | 2.11.7-alpha.3 | 2.12.0 |
| minor | 2.11.7 | 2.12.0 |
| minor | 2.11.7-alpha.3 | 2.12.0 |
| bug | 2.11.7 | 2.11.8 |
| bug | 2.11.7-alpha.3 | 2.11.8 |
| patch | 2.11.7 | 2.11.8 |
| patch | 2.11.7-alpha.3 | 2.11.8 |
| hotfix | 2.11.7 | 2.11.8 |
| hotfix | 2.11.7-alpha.3 | 2.11.8 |
| alpha | 2.11.7 | 2.11.7-alpha.1 |
| alpha | 2.11.7-alpha | 2.11.7-alpha.1 |
| alpha | 2.11.7-alpha.3 | 2.11.7-alpha.4 |
| beta | 2.11.7 | 2.11.7-beta.1 |
| beta | 2.11.7-alpha.3 | 2.11.7-beta.1 |
| pre | 2.11.7 | 2.11.7-pre.1 |
| pre | 2.11.7-alpha.3 | 2.11.7-pre.1 |
| rc | 2.11.7 | 2.11.7-rc.1 |
| rc | 2.11.7-alpha.3 | 2.11.7-rc.1 |
| stable | 2.11.7 | 2.11.7 |
| stable | 2.11.7-alpha.3 | 2.11.7 |## License
The scripts and documentation in this project are released under the [MIT License](LICENSE)