Giter VIP home page Giter VIP logo

version-from-git's Introduction

version-from-git

npm version Build Status

Background

We want to use npm version to bump to a customized version that contains both Git branch and commit hash.

And use Travis CI to automatically publish the prerelease version to NPM, tagged using npm dist-tag.

Instead of using plus (+) to denote build information, we prefer period (.) for simpler escapes.

How to use

Run npx version-from-git, it will run npm version 1.0.0-master+1a2b3c4.

  Usage: version-from-git [options]

  Bump package.json version to pre-release tagged with Git branch and short commit hash, 1.0.0-master.1a2b3c4

  Options:

    -V, --version            output the version number
    -p, --path <path>        path to package.json, default to current directory (default: C:\Users\Compulim\Source\Repos\version-from-git)
    -t, --travis             run in Travis CI: skip when TRAVIS_TAG present
    -f, --force              run "npm version" with --force
    -m, --message <message>  run "npm version" with --message
    --allow-same-version     run "npm version" with --allow-same-version
    --sign-git-tag           run "npm version" with --sign-git-tag
    --no-commit-hooks        run "npm version" with --commit-hooks
    --no-git-tag-version     run "npm version" with --no-git-tag-version
    -h, --help               output usage information

How to use under Travis

In Travis, when you push a tag (probably by npm version 1.0.0 followed by git push origin v1.0.0), you may want to skip version-from-git from generating a pre-release tag.

Run npx version-from-git -t, it will detect whether TRAVIS_TAG environment variable is present and skip.

Contributions

Like us? Star us.

Want to make it better? File us an issue.

Don't like something you see? Submit a pull request.

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.