Giter VIP home page Giter VIP logo

release-action's Introduction

release-action

What is it?

It is a GitHub action, that does the following things:

  • when you push new commits into main branch (or any other branch you designate in on.push.branches field), a release PR is created which includes an automatically generated CHANGELOG.md and bumped NPM version, all this is done according to conventional commits spec
  • in case any new code is merged into main while that release PR is still open, it will be either updated (if bump type stays the same) or recreated (if bump type changes)
  • once the maintainer is ready to publish a new package version, he merges the release PR
  • package unit tests are run (at least "test": "exit 0" should be defined in package.json)
  • if they are successful, a new GitHub release is created and a new package version is published to NPM.

How should I use it?

Setting up

Create the file .github/workflows/release.yml at the root of your repo, providing at least the following inputs:

  • github-token (who does create release PR)
  • npm-token (who does publish NPM package)
  • node-version, optional - which node version to use for running unit tests.
  • default-branch, optional - branch to open release PR against.
  • npm-dist-tag, optional - if you want to release version of package with custom tag (e.g. alpha, beta, latest).
  • prerelease, optional - if set, create releases that are pre-major or pre-release version marked as pre-release on GitHub.

The file looks roughly like, you can change target branch, tokens and node version.

name: Release

on:
  push:
    branches: [main]

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: gravity-ui/release-action@v1
        with:
          github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
          npm-token: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }}

Early development

The action encourages "moving fast and breaking things" by preventing breaking changes from bumping major version in the early stages of project development (before you reach version 1.0.0). In other words, both the 'feat: something' commits and the commits with 'BREAKING CHANGE: something' footer bump a minor component automatically. Once you consider your project stable enough, you should add Release-As: 1.0.0 footer in one of the commits and see the usual effect of the 'BREAKING CHANGE: something' footer on you major version.

release-action's People

Contributors

amje avatar tsufiev avatar valeras avatar yuberdysheva avatar

Watchers

 avatar

Forkers

yuberdysheva

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.