Giter Site home page Giter Site logo

tlii / increment-semantic-version-with-build-data Goto Github PK

View Code? Open in Web Editor NEW

This project forked from christian-draeger/increment-semantic-version

0.0 0.0 0.0 34 KB

Increment semantic version, including build data. Currently increments only build number, but will allow for other build data at some point.

License: MIT License

Shell 96.59% Dockerfile 3.41%
bash github-actions semver

increment-semantic-version-with-build-data's Introduction

Increment Semantic Version - with Build Numbers

Forked from christian-drager/increment-semantic-version.

This is a GitHub action to bump a given semantic version or build number within a 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 | bug | alpha | beta | pre | rc | build ]

include-build-number

Defaults to false. Whether you want to always include a build number. If true, all output versions will include a build number that resets with every semver change. If false, build numbers are only used if version-fragment is build.

Outputs

next-version

The incremented version.

Example usage

- name: Bump release version
  id: bump_version
  uses: TLii/[email protected]
  with:
    current-version: '2.11.7-alpha.3' # also accepted: 'v2.11.7-alpha.3' | '2.11.7-alpha3'
    version-fragment: 'feature'
    include-build-number: 'true'
- name: Do something with your bumped release version
  run: echo ${{ steps.bump_version.outputs.next-version }}
  # will print 2.12.0

Build numbers

Note: Build numbers are not considered version changes! You can use build number in two ways.

  1. By setting include-build-number (see above) to true, the build number is appended and either reset to 0 or incremented on every run of this action.
  2. If you use build as version-fragment, semantic version does not change, but build number is incremented. The intended use is when no version change is triggered (as per semantic version specification), but the change should still be noticeable in the version statement.

If semantic version changes in any way, build number is reset and the first build is 0.

Note that if semantic version does not change and current-version does not include a build number, it is assumed to be the first build (ie. 0) and will be incremented to 1 for next-version.

input / output Examples

version-fragment current-version output w/o build number output w/ build number
major 2.11.7 3.0.0 3.0.0+build.0
major v2.11.7 3.0.0 3.0.0+build.0
major 2.11.7-alpha3 3.0.0 3.0.0+build.0
major 2.11.7-alpha.3 3.0.0 3.0.0+build.0
major 2.11.7-alpha.3+build.23 3.0.0 3.0.0+build.0
feature 2.11.7 2.12.0 2.12.0+build.0
feature 2.11.7+build.5 2.12.0 2.12.0+build.0
feature 2.11.7-alpha3 2.12.0 2.12.0+build.0
feature 2.11.7-alpha.3 2.12.0 2.12.0+build.0
feature 2.11.7-alpha.3+build.5 2.12.0 2.12.0+build.0
bug 2.11.7 2.11.8 2.11.8+build.0
bug 2.11.7+build.2 2.11.8 2.11.8+build.0
bug 2.11.7-alpha3 2.11.8 2.11.8+build.0
bug 2.11.7-alpha.3 2.11.8 2.11.8+build.0
bug 2.11.7-alpha.3+build.7 2.11.8 2.11.8+build.0
alpha 2.11.7 2.11.7-alpha.1 2.11.7-alpha.1+build.0
alpha 2.11.7+build.2 2.11.7-alpha.1 2.11.7-alpha.1+build.0
alpha 2.11.7-alpha3 2.11.7-alpha.4 2.11.7-alpha.1+build.0
alpha 2.11.7-alpha.3 2.11.7-alpha.4 2.11.7-alpha.1+build.0
alpha 2.11.7-alpha.3+build.3 2.11.7-alpha.4 2.11.7-alpha.1+build.0
beta 2.11.7 2.11.7-beta.1 2.11.7-beta.1+build.0
beta 2.11.7+build.1 2.11.7-beta.1 2.11.7-beta.1+build.0
beta 2.11.7-alpha3 2.11.7-beta.1 2.11.7-beta.1+build.0
beta 2.11.7-alpha.3 2.11.7-beta.1 2.11.7-beta.1+build.0
beta 2.11.7-alpha.3+build.5 2.11.7-beta.1 2.11.7-beta.1+build.0
pre 2.11.7 2.11.7-pre.1 2.11.7-pre.1+build.0
pre 2.11.7+build.5 2.11.7-pre.1 2.11.7-pre.1+build.0
pre 2.11.7-alpha3 2.11.7-pre.1 2.11.7-pre.1+build.0
pre 2.11.7-alpha.3 2.11.7-pre.1 2.11.7-pre.1+build.0
pre 2.11.7-alpha.3+build.5 2.11.7-pre.1 2.11.7-pre.1+build.0
rc 2.11.7 2.11.7-rc.1 2.11.7-rc.1+build.0
rc 2.11.7+build.1 2.11.7-rc.1 2.11.7-rc.1+build.0
rc 2.11.7-alpha3 2.11.7-rc.1 2.11.7-rc.1+build.0
rc 2.11.7-alpha.3 2.11.7-rc.1 2.11.7-rc.1+build.0
rc 2.11.7-alpha.3+build.5 2.11.7-rc.1 2.11.7-rc.1+build.0
build 2.11.7 2.11.7+build.1 2.11.7.1+build.1
build 2.11.7+build.2 2.11.7+build.3 2.11.7.1+build.3
build 2.11.7-alpha3 2.11.7-alpha.1+build.1 2.11.7-alpha.1+build.1
build 2.11.7-alpha.3 2.11.7-alpha.1+build.1 2.11.7-alpha.1+build.1
build 2.11.7-alpha.3+build.5 2.11.7-alpha.1+build.6 2.11.7-alpha.1+build.6

License

The scripts and documentation in this project are released under the MIT License

increment-semantic-version-with-build-data's People

Contributors

christian-draeger avatar linuxidefix avatar martinbeentjes avatar mhristof avatar saito-ya avatar tlii avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.