Code Monkey home page Code Monkey logo

merge-release's Introduction

merge-release

GitHub Action for automated npm publishing.

This Action publishes a package to npm. It is meant to be used on every successful merge to master but you'll need to configure that workflow yourself. You can look to the .github/workflows/push.yml file in this project as an example.

Workflow

  • Check for the latest version number published to npm.
  • Lookup all commits between the git commit that triggered the action and the latest publish.
    • If the package hasn't been published or the prior publish does not include a git hash, we'll only pull the commit data that triggered the action.
  • Based on the commit messages, increment the version from the lastest release.
    • If the string "BREAKING CHANGE" is found anywhere in any of the commit messages or descriptions the major version will be incremented.
    • If a commit message begins with the string "feat" then the minor version will be increased. This works for most common commit metadata for feature additions: "feat: new API" and "feature: new API".
    • All other changes will increment the patch version.
  • Publish to npm using the configured token.
  • Push a tag for the new version to GitHub.

Configuration

You can configure some aspects of merge-release action by passing some environmental variables.

  • GITHUB_TOKEN (required)
    • Github token to allow tagging the version.
  • NPM_AUTH_TOKEN (required)
    • NPM Auth Token to publish to NPM, read here how to setup it as a secret.
  • DEPLOY_DIR
    • The path where the dist package.json is to run npm publish. Defaults to the root dir.
  • SRC_PACKAGE_DIR
    • The path where the src package.json is found. Defaults to the root dir.
  • NPM_REGISTRY_URL
    • NPM Registry URL to use. defaults to: https://registry.npmjs.org/

merge-release will use npm publish unless you've defined a publish script in your package.json.

- uses: mikeal/merge-release@master
  env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
      DEPLOY_DIR: my/deploy/dir
      SRC_PACKAGE_DIR: my/src/package

merge-release's People

Contributors

mikeal avatar benwinding avatar fadeenk avatar mattdsteele avatar josejulio avatar glensc avatar elliot-nelson avatar honzabilek4 avatar jlipps avatar joscha avatar nrn avatar olleolleolle avatar beatthat 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.