WelcomePrivate Registry🔒 Code Challenge
Boilerplates
Code Linting
Github Actions
Styled
🔒 Local Setup
🔒 Server Setup
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 yourpackage.json
:
{..."scripts": {..."release": "semantic-release"}}
- Add a new
publishConfig
field in yourpackage.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 Releaseon:push:branches:- mainpaths-ignore:- '**.md'- '**.mdx'jobs:release:name: Releaseruns-on: ubuntu-lateststeps:- name: Checkoutuses: actions/checkout@v2with:fetch-depth: 0- uses: actions/setup-node@v2with:node-version: '14'- run: yarn install- run: yarn releaseenv:NPM_TOKEN: ${{ secrets.NPM_TOKEN }}GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- Create a secret clicking on Settings > Secrets > New Repository Secrets:
Name | Value |
---|---|
NPM_TOKEN | Search 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 inpackage.json
- Search
NPM wild user
on 1Password and replace the NPM_TOKEN value.