Code Monkey home page Code Monkey logo

autopublish's Introduction

Introduction

This project provides an automatic publishing solution based on monorepo, presented in the form of Github Action. Action will analyze the user's Git Commit, and then publish the corresponding module according to the regulations. The specific regulations are as follows:

  • Action acts on branches master, next, alpha, beta, N.x, N.N.x
  • Branch naming rules: <workspace>@@<branch name>
  • commit follows the form of "<commit type>: <workspace>@@<commit content>
  • Commit type has "init", "feat", "fix", "breaking change"
  • workspace is the module to be published
  • If the workplace is not set, the action publishes for the entire project
  • The publishing action follows the decision table

Quick Start

name: Node.js Auto Publish

on:
  push

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 12
      - uses: wangziling100/[email protected]
        with:
          scope: '@wangziling100'
          strict_error: false
        env:
          NPM_TOKEN: ${{secrets.NPM_TOKEN}}

No parameters are required, but usually you need to set scope and NPM_TOKEN

Parameter Descriptions

  • scope: Scope of your package
  • root_dir: Root directory of your monorepo
  • strict_error: If it is true, it will report an error once it is not successfully published. If it is false, it will ignore the commit format error.

Example

This action will not generate a release every time a module is published, but it will generate a tag for this module, like this.

More examples see here

autopublish's People

Watchers

 avatar  avatar

autopublish's Issues

Comment area for idea 1

Title: General Idea

https://github.com/wangziling100/AutoPublish/milestone/1

This project provides an automatic publishing solution based on monorepo, presented in the form of Github Action. Action will analyze the user's Git Commit, and then publish the corresponding module according to the regulations. The specific regulations are as follows:

  • Action acts on branches master, next, alpha, beta, N.x, N.N.x
  • Branch naming rules: <workspace>@@<branch name>
  • commit follows SemVer, in the form of "<commit type>: <workspace>@@<commit content>
  • Commit type has "init", "feat", "fix", "breaking change"
  • workspace is the module to be published
  • If the workplace is not set, the action publishes for the entire project
  • The publishing action follows the judgment table in the plan page

Decision table design

{"priority":0,"duration":0,"target":"let it work","difficulty":3,"urgency":0,"endDate":"2020-08-07","period":0,"planType":0,"itemId":"0.635088620765072","version":"2020-08-08T07:50:00.143Z","parents":"0.0012910288713291473","layer":1,"completeness":0,"allowPriorityChange":false,"contributor":null,"evaluation":null,"owner":null,"startTime":null,"url":"https://github.com/wangziling100/AutoPublish/issues/4","tag":"#!1, decision table, discuss","itemStatus":"active","labels":["decision table","discuss"],"milestone":1}

branch commit action publishing tag
master init major+1 latest
master breaking change major+1 latest
master feat minor+1 latest
master fix patch+1 latest
master merge N.x.x change tag latest
master merge N.N.x change tag latest
master merge next change tag latest
master merge alpha minor+1 latest
master merge beta minor+1 latest
next init minor+1 next
next feat minor+1 next
next fix patch+1 next
next merge N.x.x change tag next
next merge N.N.x change tag next
next merge alpha minor+1 next
next merge beta minor+1 next
N.x.x init minor+1 dev
N.x.x feat minor+1 dev
N.x.x fix patch+1 dev
N.x.x merge N.N.x nothing dev
N.x.x merge alpha minor+1 dev
N.x.x merge beta minor+1 dev
N.N.x init patch+1 dev
N.N.x fix patch+1 dev
alpha init preminor+1 alpha
alpha feat prerelease+1 alpha
alpha fix prerelease+1 alpha
alpha merge N.x.x deprecated alpha
alpha merge N.N.x deprecated alpha
beta init preminor+1 beta
beta feat prerelease+1 beta
beta fix prerelease+1 beta
beta merge N.x.x deprecated beta
beta merge N.N.x deprecated beta

Design phase

{"priority":0,"duration":0,"target":"show the title","difficulty":3,"urgency":0,"endDate":"2020-08-07","period":0,"planType":0,"itemId":"0.0012910288713291473","version":"2020-08-07T05:49:07.577Z","parents":"root","layer":0,"completeness":0,"allowPriorityChange":false,"contributor":null,"evaluation":null,"owner":null,"startTime":null,"url":"https://github.com/wangziling100/AutoPublish/issues/5","tag":"#!1, design phase","itemStatus":"completed","labels":["design phase"],"milestone":1}

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.