Skip to content

A Github action to output a semantic version number for Forgebox from a github release

Notifications You must be signed in to change notification settings

pixl8/github-action-twgit-release-version-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 

Repository files navigation

Generate semver release version in Github actions

This helper Github Action outputs several semantic versioning variables based on the git branch/tag that is building. It assumes that you are using the twgit git flow with conventions of:

  • Released tags: vx.x.x
  • Upcoming releases: release-x.x.x

(where x.x.x is your release number)

Inputs

  • build_number_start: Allows you to bump the Github build number by some predermined value - useful for migrating from another build system and wanting to resume from where you left off (or higher). Not required, defaults to 0

Outputs

  • semver_release_string: The full semver release string. e.g. 1.0.0+000598 or 2.1.0-SNAPSHOT4994.
  • semver_release_number: Just the release number part, e.g. 1.0.0 or 2.1.0
  • semver_is_stable: true or false, whether or not this release is a stable released version or an upcoming snapshot release.
  • semver_is_snapshot: true or false, whether or not this release is an upcoming snapshot release or a stable released version.

Usage in a Github actions workflow

# .github/workflows/publish.yml
name: Publish 
# you may wish to trigger this for other specifics, this is an example
on: 
  push:
    tags: 
      - v*
    branches:
      - release-*

jobs:
  publish:
    name: Publish
    runs-on: ubuntu-latest
    steps:
    - id: releasenumber
      uses: pixl8/github-action-twgit-release-version-generator@v1
      with:
        build_number_start: 5609

    # then can use ${{ steps.releasenumber.outputs.variable_name }} in 
    # your step env vars, e.g.
    - name: my-next-step
      env:
        VERSION_NUMBER: ${{ steps.releasenumber.outputs.semver_release_string }}

About

A Github action to output a semantic version number for Forgebox from a github release

Resources

Stars

Watchers

Forks

Packages

No packages published