Giter Club home page Giter Club logo

yaba's Introduction

Yaba GitHub Release CLI

Yaba is a simple CLI tool that helps you manage releases of your GitHub projects.

GitHub Workflow Status version dependancies downloads license

Prerequisites

You need npm in order to run the project on your local environment.

Installing / Updating / Uninstalling

To install CLI package globally:

npm i -g yaba-release-cli

To Update:

npm update -g yaba-release-cli

To uninstall:

npm uninstall -g yaba-release-cli

Setup

Create Personal Access Token

Go to Personal Access Tokens page on GitHub and generate new token to enable yaba CLI to access your repos.

  • Give your desired name to your personal access token with Note section.
  • Choosing repo scope is enough to use yaba CLI tool.

Now, your personal access token is generated. Copy that token and define that one as an environment variable:

export YABA_GITHUB_ACCESS_TOKEN=generated_personal_access_token

You can define that env variable into ~/.bashrc, ~/.bash_profile or ~/.zshrc file, choose which one is suitable for you. After defining the env variable, open new terminal or simply run source ~/.zshrc(here again choose where you defined your env variable).

If the repository owner is another GitHub account or organisation, you can define that like below instead of passing the owner to the command in every run.

export YABA_GITHUB_REPO_OWNER=repository_owner

Always -o or --owner has precedence over authenticated user. Presendence is like -o > GITHUB_REPO_OWNER > authenticated-user.

Slack Integration

If you want to announce your release/changelog to the specific Slack channel, you have to define below environment variable with the appropriate value.

export YABA_SLACK_HOOK_URL=your_slack_hook_url

Also, multiple hook URLs allowed to be defined like below:

export YABA_SLACK_HOOK_URL=your_slack_hook_url_1,your_slack_hook_url_2,...

If the above variable is set and the -p command given while running the command, an announcement will be post to the given Slack channel. You can find detailed information in the Command Line Usage section.

yaba -p

Command Line Usage

Run yaba with --help options:

โžœ  ~ yaba --help
Usage: yaba -o <owner> -r <repository> -t <tag> -n <release-name> -b <body> -d
<draft> -c <changelog> -i <interactive> -p <publish>

Options:
  -o, --owner         The repository owner.                             [string]
  -r, --repo          The repository name.                              [string]
  -t, --tag           The name of the tag.                              [string]
  -n, --release-name  The name of the release.                          [string]
  -b, --body          Text describing the contents of the tag. If not provided,
                      the default changelog will be generated with the usage of
                      the difference of master and latest release.      [string]
  -d, --draft         Creates the release as draft.                    [boolean]
  -c, --changelog     Shows only changelog without creating the release.
                                                                       [boolean]
  -i, --interactive   Prompt before (draft) release is created (default true)
                                                                       [boolean]
  -p, --publish       Publishes the release announcement to the defined Slack
                      channel                                          [boolean]
  -h, --help          Show help                                        [boolean]
  -v, --version       Show version number                              [boolean]

You can run yaba from a git directory or any other directories which is not a git repo.

If you are in a git repo and if you want to prepare the release for that repo, you don't need to specify the repo name with the command. The command will automatically detect the current directory and if it is a git repository yaba will use it as repo for the command.

By default, if you don't specify -o, -t, -n and -b the command will prepare default values for them with the below pattern:

-o: authenticated_user
-t: prod_global_YYYYMMDD.1
-n: Global release YYYY-MM-DD
-b: Commits between last release and master/main branch

๐Ÿ’ก If you want to bypass the prompt that is before creating the actual release, you can use -i false flag. This could be useful if you use yaba in your automation tools.

Run Locally

You have to clone the repository to your local machine

git clone [email protected]:volkanto/yaba.git

Go to project folder

cd yaba

Build dependencies

npm install

You have to install globally in order to run your yaba command

npm install -g .

Issues

You can create an issue if you find any problem or feel free to create a PR with a possible fix or any other feature. Also, you can create an issue if you have any idea that you think it will be nice if we have it.

Authors

yaba's People

Contributors

dependabot[bot] avatar volkanto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

yaba's Issues

Getting error if there is no previous release

If we run yaba for the first time to prepare the release, it will get a 404 error while trying to get the latest release of the project.

For the initial release, all the commits can be put into the changelog if it is not explicitly defined.

Create release from commit id

Currently, yaba is comparing the last release against the master or main branch and preparing the changelog according to the result. Now there is a need to prepare a release from a specific commit id.

Cleanup flags

remove not critical flags and make yaba as clean as possible

  • remove sound

Add spinner

Add spinner during release creation so that if it takes long user can understand it easily.

Prompt before creating the release

Currently, yaba is not asking the user if he is really sure to create the release with the specified parameters. Input can be changed so that yaba must ask the user if he is sure about the process.

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.