Giter VIP home page Giter VIP logo

get-next-version's Introduction

get-next-version

get-next-version gets the next version for your repository according to semantic versioning based on conventional commits.

Installation

Go to the releases page, find the download url for your architecture and operating system, and copy it.

Then, run the following steps:

# Download the latest release (insert the url here)
$ curl -L -o get-next-version <URL>

# Ensure the binary is executable
$ chmod a+x get-next-version

# Move the binary to the application directory
$ sudo mv get-next-version /usr/local/bin

Quick Start

Go to the repository and run get-next-version. The tool will analyse the history of your repository and output the next version for your release.

$ get-next-version

Optionally, you may hand over the --repository (or short -r) flag to specify the path to the repository you want to analyse, if it is not in the current working directory.

$ get-next-version --repository <PATH>

By default, output will be shown in a human-readable format. If you want to show the output in a machine-readable format, you can use the --format (or short -f) flag:

# Show output in JSON format
$ get-next-version --format json

# Show output in GitHub Action format
$ get-next-version --format github-action

Using the GitHub Action

For convenience, you may use the GitHub Action when running get-next-version inside a workflow on GitHub.

โš ๏ธ When cloning the repository, make sure to set the fetch-depth option to 0, otherwise get-next-version will not be able to analyse the history of the repository!

An example workflow that makes use of the GitHub Action is shown below:

name: Example workflow

on: pull_request

jobs:
  example:
    name: Example
    runs-on: ubuntu-latest

    steps:
    - name: Clone repository
      uses: actions/checkout@v3
      with:
        fetch-depth: 0
        ref: ${{ github.event.pull_request.head.sha }}
    - name: Get next version
      id: get_next_version
      uses: thenativeweb/get-next-version@main
    - name: Show the next version
      run: |
        echo ${{ steps.get_next_version.outputs.version }}
        echo ${{ steps.get_next_version.outputs.hasNextVersion }}

get-next-version's People

Contributors

curiosdevcookie avatar dependabot[bot] avatar dotkuro avatar forestsoft-de avatar goloroden avatar stefanniemeyer avatar

Watchers

 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.