for developers
Welcome
Boilerplates
Code Linting
Github Actions
Getting StartedLerna ReleasePull Request Changelog GeneratorSemantic ReleaseBehaviorInstallationPublish under registry.npmjs.org
Private Registry
Styled
🔒  Local Setup
🔒  Server Setup
🔒  Code Challenge

Semantic Release

A Github Action for release a package under registry.wild.plus.

Behavior

On every push on the main branch:

  • If needed, a new package version will be published under registry.wild.plus.
  • Based on the commit history, a changelog will be generated.
  • A Github release will be created.

Installation

  • Install semantic-release, launching yarn add @semantic-release/changelog @semantic-release/git semantic-release -D
  • Create a new release script in your package.json:
{
...
"scripts": {
...
"release": "semantic-release"
}
}
  • Add a new publishConfig field in your package.json:
{
...
"publishConfig": {
"registry": "https://registry.wild.plus/"
},
}
  • Then add this to a release.config.js file:
module.exports = {
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github",
"@semantic-release/changelog",
["@semantic-release/git", {
"assets": ["CHANGELOG.md", "package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]"
}],
"@semantic-release/npm",
],
branches: ["main"]
}
  • Then add this to a .github/workflows/action.yml file:
name: Semantic Release
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- '**.mdx'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: yarn install
- run: yarn release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  • Create a secret clicking on Settings > Secrets > New Repository Secrets:
NameValue
NPM_TOKENSearch registry.wild.plus on 1Password

Publish under registry.npmjs.org

In some cases, you might need to publish directly under registry.npmjs.org.
Be sure to follow these steps:

  • Drop the publishConfig field in package.json
  • Search NPM wild user on 1Password and replace the NPM_TOKEN value.