All Projects → lukaszraczylo → semver-generator

lukaszraczylo / semver-generator

Licence: Apache-2.0 license
Semantic version generator using git commit keywords and overrides

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to semver-generator

awesome-blockchain
A curated list of blockchain resources for developers
Stars: ✭ 106 (+307.69%)
Mutual labels:  development, programming
Interactive Coding Challenges
120+ interactive Python coding interview challenges (algorithms and data structures). Includes Anki flashcards.
Stars: ✭ 24,317 (+93426.92%)
Mutual labels:  development, programming
landscape-of-programming
This repo aim to show you what to learn on the way to excellence.
Stars: ✭ 67 (+157.69%)
Mutual labels:  development, programming
Diccionario-JavaScript
project-dictionary.gitbooks.io/diccionario-javascript/content/
Stars: ✭ 13 (-50%)
Mutual labels:  development, programming
Forum
Dúvidas, dicas e sugestões gerais sobre carreira na área de desenvolvimento de software
Stars: ✭ 199 (+665.38%)
Mutual labels:  development, programming
Awesome Algorithms Education
A curated list to learning and practicing about algorithm.
Stars: ✭ 267 (+926.92%)
Mutual labels:  development, programming
Saws
A supercharged AWS command line interface (CLI).
Stars: ✭ 4,886 (+18692.31%)
Mutual labels:  development, programming
Programming Notes
Semua catatan tentang teknologi dan development 😎
Stars: ✭ 41 (+57.69%)
Mutual labels:  development, programming
Awesome Podcasts
🎙 A collection of awesome engineering podcasts! ARCHIVED in favor of https://github.com/rShetty/awesome-podcasts
Stars: ✭ 184 (+607.69%)
Mutual labels:  development, programming
Python Sploitkit
Devkit for building Metasploit-like consoles
Stars: ✭ 148 (+469.23%)
Mutual labels:  development, programming
System Design Primer
Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.
Stars: ✭ 154,659 (+594742.31%)
Mutual labels:  development, programming
Comunidade
✊🏽 A comunidade de programação da periferia
Stars: ✭ 252 (+869.23%)
Mutual labels:  development, programming
311
Interactive Web Development
Stars: ✭ 33 (+26.92%)
Mutual labels:  development, programming
standard-www
👆 Website for JavaScript Standard Style (@standard)
Stars: ✭ 28 (+7.69%)
Mutual labels:  development
SBTCVM-Gen2-9
SBTCVM is a virtual machine implementation of a balanced ternary (base 3) computer. Features several compiled languages for ternary software development.
Stars: ✭ 32 (+23.08%)
Mutual labels:  programming
30-seconds-of-git
Short git snippets for all your development needs
Stars: ✭ 235 (+803.85%)
Mutual labels:  programming
docker-go-dev
The containerized Go development environment.
Stars: ✭ 93 (+257.69%)
Mutual labels:  development
wallstant
Create your own social network for free with Wallstant social network, easy to install and fast to use .. Make people connected
Stars: ✭ 157 (+503.85%)
Mutual labels:  development
tutorials as code
so that stuff read/seen don't get muddled up with time
Stars: ✭ 42 (+61.54%)
Mutual labels:  programming
scilab
Open source, cross-platform numerical computational package and a high-level, numerically oriented programming language.
Stars: ✭ 52 (+100%)
Mutual labels:  programming

Semantic version generator

Docker image build. GitHub release (latest by date) codecov

Project created overnight, to prove that management of semantic versioning is NOT painful and do not require arguments and debates within the team. Simple, clean and only thing the project team should need to agree to are the keywords.

How does it work

  • Binary clones the github repository
  • Iterates through the list of commits looking for the keywords specified in config file for additional bumps of versions
  • Returns the semantic version which can be included in the release

Additional features

  • With flag -e or config force.existing: true the existing tags in versioning will be respected, helping you to avoid the version conflicts.
  • With config force.commit: deadbeef where deadbeef is the commit hash - calculations will start from the specified commit.

Important changes

  • From version 1.4.2+ as pointed out in issue #12 commits from merge will not be included in the calculations and commits themselves will bump the version on first match ( starting checks from patch upwards ).

Usage

Authentication

If you intend to use this project with remote repositories ( regardless of them being private or public ) you need to authenticate with your repository. To do so you can utilise the following environment variables ( they are NOT github specific, for other providers you can use the password )

export GITHUB_USERNAME=lukaszraczylo
export GITHUB_TOKEN=yourPersonalApiToken

As a binary

You can download latest versions of the binaries from the release page.

Supported OS and architectures: Darwin ARM64/AMD64, Linux ARM64/AMD64, Windows AMD64

bash$ ./semver-gen generate -r https://github.com/nextapps-de/winbox
SEMVER 9.0.10
bash$ ./semver-gen generate -l
SEMVER 5.1.1

Local repository flag -l will always take precedence over remote repository URL

Usage:
  semver-gen generate [flags]
  semver-gen [command]

Available Commands:
  generate    Generates semantic version
  help        Help about any command

Flags:
  -c, --config string       Path to config file (default "semver.yaml")
  -d, --debug               Enable debug mode
  -e, --existing            Respect existing tags
  -h, --help                help for semver-gen
  -l, --local               Use local repository
  -r, --repository string   Remote repository URL. (default "https://github.com/lukaszraczylo/simple-gql-client")
  -s, --strict              Strict matching
  -u, --update              Update binary with latest
  -v, --version             Display version

As a github action

jobs:
  prepare:
    name: Preparing build context
    runs-on: ubuntu-latest
    outputs:
      RELEASE_VERSION: ${{ steps.semver.outputs.semantic_version }}
    steps:
      - name: Checkout repo
        uses: actions/checkout@v2
        with:
          fetch-depth: '0'
      - name: Semver run
        id: semver
        uses: lukaszraczylo/semver-generator@PLACE_LATEST_TAG_HERE
        # you can also use v1 tag which _should_ automatically upgrade to latest
        # uses: lukaszraczylo/semver-generator@v1
        with:
          config_file: semver.yaml
          # either...
          repository_local: true
          # or...
          repository_url: https://github.com/lukaszraczylo/simple-gql-client
          # when using remote repository, especially with private one:
          github_username: lukaszraczylo
          github_token: MySupeRSecr3tPa$$w0rd
      - name: Semver check
        run: |
          echo "Semantic version detected: ${{ steps.semver.outputs.semantic_version }}"

As a docker container

docker pull ghcr.io/lukaszraczylo/semver-generator:latest

Docker supported architectures: Linux/arm64, Linux/amd64

Calculations example [standard]

- 0.0.1 - PATCH - starting commit
- 0.0.2 - PATCH - another commit
- 0.0.4 - PATCH - another commit with word 'Update' => DOUBLE increment PATCH
- 0.1.0 - MINOR - after commit with word 'Change' => increment MINOR, reset PATCH
- 0.1.1 - PATCH - additional commit
- 1.0.1 - MAJOR - commit with word 'BREAKING' = > INCREMENT MAJOR, reset MINOR
- 1.0.2 - PATCH - another commit

Calculations example [strict matching]

- 0.0.1 - PATCH - starting commit
- 0.0.1 - PATCH - another commit
- 0.0.1 - PATCH - another commit with word 'Update' => SINGLE increment PATCH
- 0.1.0 - MINOR - after commit with word 'Change' => increment MINOR, reset PATCH
- 0.1.0 - PATCH - additional commit
- 1.0.0 - MAJOR - commit with word 'BREAKING' = > INCREMENT MAJOR, reset MINOR
- 1.0.0 - PATCH - another commit

Release candidates

The semver-gen supports release candidates generation as well. Add following configuration ( and change the trigger keywords to anything what suits you ) to generate the appropriate release in format 1.3.37-rc.1 and counting up until next minor trigger will be detected.

  release:
    - release-candidate
    - add-rc

Example configuration

version: 1
force:
  major: 1
  minor: 0
  patch: 1
  commit: 69fbe2df696f40281b9104ff073d26186cde1024
wording:
  patch:
    - update
    - initial
  minor:
    - change
    - improve
  major:
    - breaking
    - the # For testing purposes
  release:
    - release-candidate
    - add-rc
  • version: is not respected at the moment, introduced for potential backwards compatibility in future
  • force: sets the "starting" version, you don't need to specify this section as the default is always 0
  • force.commit: allows you to set commit hash from which the calculations should start
  • wording: words the program should look for in the git commits to increment (patch|minor|major)

Good to know

  • Word matching uses fuzzy search AND is case INSENSITIVE
  • I do not recommend using common words ( like "the" from the example configuration )
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].