GithubHelp home page GithubHelp logo

isabella232 / release-tool-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twilio/release-tool

0.0 0.0 0.0 101 KB

Release Tool

License: BSD 3-Clause "New" or "Revised" License

JavaScript 100.00%

release-tool-1's Introduction

release-tool

NPM Build Status

release-tool is a tool for releasing software. It supports bumping version numbers in JavaScript projects out-of-the-box, but is otherwise generic enough to release any kind of software.

npm install --save-dev release-tool

Usage

By default, the tool runs in an interactive mode. It will prompt you for the version numbers and plans you want to execute before confirming whether or not to proceed.

$ ./node_modules/.bin/release --help

  Usage: release [Options...] [CURRENT_VERSION] [RELEASE_VERSION|NEXT_VERSION] \
             [DEVELOPMENT_VERSION]

  release is a tool for releasing software. It supports bumping version numbers
  in JavaScript projects out-of-the-box, but is otherwise generic enough to
  release any kind of software. Run release with no arguments for interactive
  mode.

  For more information, refer to the README.

  Options:

    -h, --help             output usage information
    -V, --version          output the version number
    -b, --branch [branch]  the branch to release from (defaults to the current branch)
    --bump                 bump CURRENT_VERSION to NEXT_VERSION
    -n, --non-interactive  run in non-interactive mode (e.g., in a script)
    -p, --publish          execute the publish plan
    -s, --slug             specify the repository slug (owner_name/repo_name)
    -t, --token            assign the CI token to use
    -x, --execute          execute the plans (defaults to true unless using Travis CI)

--bump

The tool also bundles a "bump" subcommand for updating version numbers in supported types of software projects (currently only JavaScript). It will bump the version number in package.json (and bower.json, if it exists) from version CURRENT_VERSION to version NEXT_VERSION:

$ ./node_modules/.bin/release --bump ${CURRENT_VERSION} ${NEXT_VERSION}

.release.json

The tool executes up to three types of plans on your Software:

  1. Release: create a Release (or Release Candidate) of the Software.
  2. Development: continue a Development Version (or "snapshot") of the Software.
  3. Publish: publish a Release of the Software.

These plans are described in a .release.json file where you can specify exactly what should happen in each plan.

For example, the tool's own .release.json specifies that, in order to create a Release, the version number must be bumped before committing and tagging the software. In order to continue a Development Version, the version number must be bumped before committing the Software.

{
  "type": "JavaScript",
  "ci": "circleci",
  "slug": "twilio/release-tool",
  "env": {
    "GH_REF": "github.com/twilio/release-tool.git"
  },
  "plans": {
    "release": {
      "env": {
        "GIT_USER_NAME": "travis-ci",
        "GIT_USER_EMAIL": "[email protected]"
      },
      "commands": [
        "node ./node_modules/.bin/release --bump ${CURRENT_VERSION} ${RELEASE_VERSION}",
        "git config user.name \"${GIT_USER_NAME}\"",
        "git config user.email \"${GIT_USER_EMAIL}\"",
        "git add .",
        "git commit -m \"Release ${RELEASE_VERSION}\"",
        "git tag ${RELEASE_VERSION}"
      ]
    },
    "development": {
      "commands": [
        "node ./node_modules/.bin/release --bump ${RELEASE_VERSION} ${DEVELOPMENT_VERSION}",
        "git add .",
        "git commit -m \"Continue development on ${DEVELOPMENT_VERSION}\""
      ]
    },
    "publish": {
      "commands": [
        "git remote set-url origin \"https://${GH_TOKEN}@${GH_REF}\"",
        "git rebase HEAD ${BRANCH}",
        "git push origin ${BRANCH} --tags",
        "git checkout ${RELEASE_VERSION}"
      ]
    }
  }
}

Environment Variables

Variables can be assigned in the top-level or plan-level "env" sections. Any unassigned variables referenced in a plan's commands can be overridden by the environment or command-line arguments. All other assigned variables are fixed and cannot be overridden except in the .release.json itself.

Travis CI Or CircleCI

If you set the property ci to travis , circleci or travis-pro in the top-level of your software's .release.json, then the tool will not execute any plans locally; instead, it will POST a request to Travis CI or CircleCi in order to execute the plans.

Be very careful not to leak any sensitive data.

release-tool-1's People

Contributors

charliesantos avatar makarandp0 avatar markandrus avatar ryan-rowland 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.