3.1.3 • Published 2 years ago

@qiwi/semrel-metabranch v3.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@qiwi/semrel-metabranch

Semrel plugin for two-way data sync with any remote branch on any release step.

StepDescription
verifyConditionsPerforms actions as declared in step options.
analyzeCommitsAs prev.
verifyRelease...
generateNotes...
prepare...
publish...
addChannel...
success...
fail...

Install

yarn add @qiwi/semrel-metabranch -D

Usage

As a part of plugin declaration:

// .release.rc
{
  "plugins": [[
    "@qiwi/semrel-multibranch",
    {
      "verify": {
        "action": "fetch",
        "branch": "metabranch",
        "from": "foo",
        "to": "bar"
      }
    }
  ]]
}

Action declared in release step:

{
  "publish": [[
    "@qiwi/semrel-multibranch",
    {
      "action": "push",
      "branch": "metabranch",
      "from": "foo/**/*.txt",
      "to": "bar",
      "message": "commit message"
    }
  ]]
}

GitHub Pages docs pushing example

module.exports = {
  debug: true,
  branch: 'master',
  plugins: [
    [
      '@qiwi/semrel-metabranch',
      {
        publish: {
          action: 'push',
          branch: 'gh-pages',
          from: './docs',
          to: '.',
          message: 'update docs ${nextRelease.gitTag}'
        }
      }
    ],
    ...
  ]
}

Configuration

Environment variables
VariableDescription
GH_TOKEN or GITHUB_TOKENRequired. The token used to authenticate with GitHub.
Options
OptionDescriptionDefault
actionAction to perform: fetch/push
branchBranch to pushmetabranch
messageCommit message powered by lodash.template: docs <%= nextRelease.gitTag %>update meta
fromSource glob pattern. (root)
toDestination directory. (root)

API

TActionOptions

export type TBaseActionOptions = {
  branch: string
  from: string | string[]
  to: string
  message: string
}

export type TActionOptionsNormalized = TBaseActionOptions & {
  repo: string
  cwd: string
  temp: string
}

export type TActionType = 'fetch' | 'push'

export type TActionOptions = Partial<TActionOptionsNormalized> & {
  repo: string
}

export type TPluginOptions = Partial<TBaseActionOptions> & {
  action: TActionType
}

Defaults

export const branch = 'metabranch'
export const from = '.'
export const to = '.'
export const message = 'update meta'

export const defaults = {
  branch,
  from,
  to,
  message,
}

License

MIT

3.1.3

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.6.7

3 years ago

1.6.6

3 years ago

1.6.4

3 years ago

1.6.5

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.4.4

3 years ago

1.5.0

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago