GithubHelp home page GithubHelp logo

irfanhabib / chandler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattbrictson/chandler

0.0 1.0 0.0 437 KB

chandler syncs your CHANGELOG entries to GitHub's release notes

License: MIT License

Ruby 99.81% Shell 0.19%

chandler's Introduction

chandler

Gem Version Build Status Build status Code Climate Coverage Status

chandler syncs your CHANGELOG entries to GitHub's release notes so you don't have to enter release notes manually. For Ruby projects, you can even add chandler to your gem's Rakefile to make this an automatic part of your release process!

How does it work?

chandler scans your git repository for version tags (e.g. v1.0.2), parses out the corresponding release notes for those tags from your CHANGELOG, and uploads those notes to the GitHub releases area via the GitHub API.

Chandler makes reasonable assumptions as to the name of your CHANGELOG file, your project's GitHub repository URL, and the naming convention of your Git version tags. These can all be overridden with command line options.

Why go through the trouble?

GitHub's releases feature is a nice UI for browsing the history of your project and downloading snapshots of each version. It is also structured data that can be queried via GitHub's API, making it a available for third-party integrations. For example, Sibbell can automatically send the release notes out to interested parties whenever you publish a new version.

Of course, as a considerate developer you also want to have a plain text CHANGELOG that travels with the code, can be collaboratively edited in pull requests, and so on. But that means you need two copies of the same release notes!

chandler takes the hassle out of maintaining these two separate formats: your CHANGELOG is the authoritative source, and GitHub releases are updated with a simple chandler command.

Requirements

  • Ruby 2.1 or higher
  • Your project's CHANGELOG must be in Markdown with version numbers in the headings (similar to the format advocated by keepachangelog.com)
  • You must be an owner or collaborator of the GitHub repository to update its releases

Installation

1. Install the gem

gem install chandler

2. Configure .netrc or set ENV vars

In order to access the GitHub API on your behalf, you must provide chandler with your GitHub credentials.

Do this by creating a ~/.netrc file with your GitHub username and password, like this:

machine api.github.com
  login defunkt
  password c0d3b4ssssss!

Or expose an ENV variable: CHANDLER_GITHUB_API_TOKEN inside your CI.

For more security, you can use an OAuth access token in place of your password. Here's how to generate one. Make sure to enable public_repo scope for the token.

Usage

To push all CHANGELOG entries for all tags to GitHub, just run:

chandler push

chandler will make educated guesses as to what GitHub repository to use, the location of the CHANGELOG, and the tags that represent releases. To see what will happen without actually making changes, run:

chandler push --dry-run

To upload only a specific tag, v1.0.2 for example:

chandler push v1.0.2

Other command-line options:

  • --git=/path/to/project/.git – location of the local git repository (defaults to .git)
  • --github=username/repo – GitHub repository to upload to (if unspecified, chandler will guess based on your git remotes)
  • --changelog=History.md – location of the CHANGELOG (defaults to CHANGELOG.md)
  • --tag-prefix=myapp- – specify Git version tags are in the format myapp-1.0.0 instead of 1.0.0

GitHub Enterprise

Chandler supports GitHub Enterprise as well as public GitHub repositories. It will make an educated guess as to where your GitHub Enterprise installation is located based on the origin git remote. You can also specify your GitHub Enterprise repository using the --github option like this:

[email protected]:organization/project.git

Or like this:

--github=https://github.mycompany.com/organization/project

To authenticate, Chandler relies on your ~/.netrc, as explained above. Replace api.github.com with the hostname of your GitHub Enterprise installation (github.mycompany.com in the example).

Rakefile integration

If you maintain a Ruby gem and use Bundler's gem tasks (i.e. rake release) to publish your gem, then you can use chandler to update your GitHub release notes automatically.

1. Update the gemspec

spec.add_development_dependency "chandler"

2. Modify the Rakefile

require "bundler/gem_tasks"
require "chandler/tasks"

# Optional: override default chandler configuration
Chandler::Tasks.configure do |config|
  config.changelog_path = "History.md"
  config.github_repository = "mattbrictson/mygem"
end

# Add chandler as a prerequisite for `rake release`
task "release:rubygem_push" => "chandler:push"

That's it! Now when you run rake release, your GitHub release notes will be updated automatically based on your CHANGELOG entries.

And yes, chandler uses itself to automatically push its own release notes to GitHub! Check out the Rakefile.

Contributing

Contributions are welcome! Read CONTRIBUTING.md to get started.

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.