configurationsemantic-release-action

Semantic-release-action is a GitHub action that runs a semantic release.

Method of use

Step 1: Set up in your repositoryConfiguration file for Semantic ReleaseIf not, the default configuration of Semantic Release will be used

Step 2: In your Github repository forSemantic Release authenticationaddSecretsTo ensure normal permissions

GITHUB_TOKEN is generated by Github by default. To publish to NPM, manually add NPM_TOKEN to the Secrets list

Step 3: WillWorkflow fileAdd to your repository to create custom automated processes.

  • Seman-release-action supports the following inputs:
    • branch: [Optional] Sets which branch should publish on. This will override the Branch property in your configuration file. If this property is not configured here or in your configuration file, the default is to use the master branch for publishing
    • semantic_version: [Optional] Specifies the scope of semantic-Release versions to use
    • extra_plugins: [Optional] Used to preinstall additional Seman-Release plug-ins, which can specify the version range of the plug-in
    • dry_run: [Optional] Whether yesdry-runRun semantic publishing in mode, which overrides the dryRun property in your configuration file
  • Seman-release-action supports output of the following variables (if you want to use output variables, you need to assign an ID to your task beforehand, see the advanced example below) :
    • new_release_published: Indicates whether a new version has been releasedtrueorfalse
    • new_release_version: Indicates the version number of the new version
    • new_release_major_version: Indicates the major version number of the new version
    • new_release_minor_version: Indicates the minor version number of the new version
    • new_release_patch_version: Indicates the patch version number of the new version

A simple example

steps:
  - name: Semantic Release
    uses: cycjimmy/semantic-release-action@v2
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Copy the code

An advanced example

Steps: -name: Semantic Release uses: cycjimmy/semantic-release-action@v2 id: Semantic # You need an 'ID' to use the output variable with: branch: Master Semantic_version: 15.13.28 # Here, you can specify a version range for the Seman-release plug-in, or you can omit extra_plugins: | @ semantic - release/git @ semantic - release/[email protected] env: GITHUB_TOKEN: ${{secrets. GITHUB_TOKEN}} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Do something when a new release published if: steps.semantic.outputs.new_release_published == 'true' run: ...Copy the code

Old repositories use Semantic Releases

Manually tag the last released version. For example, if the release branch is master and the last released version is 1.1.0, the sha value of the commit is 1234567. Ensure that the commit is labeled with V1.1.0

# Make sure the commit 1234567 is in the release branch history $ git branch --contains 1234567 # If the commit is not in the branch history it means that either: # - you use a different branch than the one your release from before # - or the commit sha has been rewritten (with git rebase) # In both cases you need to configure your repository to have the last release commit in the history of the Release Branch # List the tags for the commit 1234567 $git tag --contains 1234567 # If V1.1.0 is not in the List you Add it with $git tag v1.1.0 1234567 $git push Origin v1.1.0Copy the code

Code submission specification

Using Commitizen

The installation

$ npm install -g commitizen cz-conventional-changelog
Copy the code

Globally, create a.czrc file in your home directory and point your path to the commitizen adapter installed above to support Angular’s Commit Message format

$ echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc
Copy the code

To configure the project level, run the following command in the project directory

$ commitizen init cz-conventional-changelog --save --save-exact
Copy the code

Replace git commit -m with the following command

$ git cz
Copy the code

The new process after commitizen is configured is as follows:

$git add $git add. $git cz $git pushCopy the code

A Commit Message format

< type > (< scope >) : < subject > < empty row > < body > < empty row > < footer >Copy the code
  • <type>
    • feat: New feature
    • fix: fixing bugs
    • docs: Documentation
    • style: format (changes that do not affect code execution)
    • refactor: Refactoring (i.e. code changes that are not new features or bug fixes)
    • perf: Changes code to improve performance
    • test: Add tests
    • chore: Changes to the build process or ancillary tools
  • <scope>: Optional item that describes the scope of impact of this submission, such as$location.$browser. Can be used when the change affects more than one scope*
  • <subject>: is used to briefly describe the change, try to follow:
    • Start with a verb and use the first person present tense, as inchangeRather thanchangedorchanges
    • Don’t capitalize the first letter
    • Ending without a period.
  • <body>:<subject>A description of the
  • <footer>: Main placementIncompatible changeandClose the IssueThe information of
    • Incompatible changes: toBREAKING CHANGE:At the beginning, describe the change, the reason for the change, and the migration method.
    • Close the Issue, such asclose #123

Special format

  • Revert: In addition, if you want to undo a previous Commit, this Commit Message must be used as an RevertRevert:At the beginning, followed by what was described earlierHeaderPart, format unchanged. And,<body>The format of the part is also fixed, and the SHA value must be recorded before the Commit is revoked.

Here are some examples of submissions

feat
feat($browser): onUrlChange event (popstate/hashchange/polling)

Added new event to $browser:
- forward popstate event if available
- forward hashchange event if popstate not available
- do polling when neither popstate nor hashchange available

Breaks $browser.onHashChange, which was removed (use onUrlChange instead)
Copy the code
feat(directive): ng:disabled, ng:checked, ng:multiple, ng:readonly, ng:selected

New directives for proper binding these attributes in older browsers (IE).
Added coresponding description, live examples and e2e tests.

Closes #351
Copy the code
feat($compile): simplify isolate scope bindings

Changed the isolate scope binding options to:
  - @attr - attribute binding (including interpolation)
  - =model - by-directional model binding
  - &expr - expression execution binding

This change simplifies the terminology as well as
number of choices available to the developer. It
also supports local name aliasing from the parent.

BREAKING CHANGE: isolate scope bindings definition has changed and
the inject option for the directive controller injection was removed.

To migrate the code follow the example below:

Before:

scope: {
  myAttr: 'attribute',
  myBind: 'bind',
  myExpression: 'expression',
  myEval: 'evaluate',
  myAccessor: 'accessor'
}

After:

scope: {
  myAttr: '@',
  myBind: '@',
  myExpression: '&',
  // myEval - usually not useful, but in cases where the expression is assignable, you can use '='
  myAccessor: '=' // in directive's template change myAccessor() to myAccessor
}

The removed `inject` wasn't generaly useful for directives so there should be no code using it.
Copy the code
fix
fix($compile): couple of unit tests for IE9

Older IEs serialize html uppercased, but IE9 does not...
Would be better to expect case insensitive, unfortunately jasmine does
not allow to user regexps for throw expectations.

Closes #392
Breaks foo.bar api, foo.baz should be used instead
Copy the code
Fix (package): update read-PKG-up to version 7.0.0 fix: Clarify message for EGITNOPERMISSION errorCopy the code
docs
docs(guide): updated fixed docs from Google Docs

Couple of typos fixed:
- indentation
- batchLogbatchLog -> batchLog
- start periodic checking
- missing brace
Copy the code
docs: fix grammar
docs: corrections and further clarifications 
docs: update broken link
docs(README): update version number
docs(README): place badge
docs(inputs): remove redundant defaults
Copy the code
style
style: fix table indentation
style($location): add couple of missing semi colons
Copy the code
refactor
refactor: remove unnecessary object destructuring
refactor: use `Object.entries` rather than `Object.keys`
Copy the code
perf
perf(*): Update network configuration
Copy the code
test
test: clarify variables name
test(testRelease): set schedule test
Copy the code
chore
Chore (package): Update xo to version 0.25.0 chore(package): Remove Commitizen from Our dependencies chore(*): transfer repo to cycjimmyCopy the code
revert
revert: "fix: do not convert ssh `repositoryUrl` to https"

This reverts commit b895231.
Copy the code

The related documents

  • semantic-release-action
  • Guide to writing Commit Message and Change log