Skip to content

Commit

Permalink
feat: add semantic release (#17)
Browse files Browse the repository at this point in the history
* feat: add husky

* feat: add semantic-release

* ci: fix build process

* fix: fix inquirer default options
  • Loading branch information
adrianiy committed Oct 16, 2021
1 parent 254b3d1 commit 3a76fc5
Show file tree
Hide file tree
Showing 14 changed files with 16,596 additions and 2,523 deletions.
2 changes: 2 additions & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extends:
- '@commitlint/config-conventional'
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release
on:
push:
branches:
- main
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- run: npm ci
- run: npm run build
- run: npm run rng
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ dist
# test files
RELEASE_NOTES_TEST.md
.releasenotes-test.yml

# build
lib
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint
5 changes: 1 addition & 4 deletions .releasenotes.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
token: TOKEN
#name: RELEASE_NOTES_TEST
#commit: false

publish: true
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Currently we are only supporting **GITHUB**.
- Usage
- [Installation](#installation)
- [Configuration](#configuration)
- [CI Configuration](#ci-configuration)
- [Cli commands](#cli)
- Examples
- [Configuration](#configuration-example)
Expand All @@ -53,7 +54,7 @@ We support `.yml` and `.json` formats with these options
| Options | Default | Description |
|---------|---------|-------------|
| token | `GITHUB_TOKEN` | Authorization token. This will allow **rng** to access your repo! |
| repo | `undefined` | Repository name with `user/repo` format |
| repo | `GITHUB_REPOSITORY` | Repository name with `user/repo` format |
| out | `'.'` | Base path where `RELEASE-NOTES` will be generated |
| name | `RELEASE-NOTES` | Output file name |
| labels | `[ 'release-note' ]` | Only PRs with these labels will be used in generation process |
Expand All @@ -64,6 +65,10 @@ We support `.yml` and `.json` formats with these options
| title | `RELEASE NOTES` | Title used in output markdown |
| decoration | [Decoration object](#decoration-object) | Icon decoration for each issue type |

##### CI Configuration

This configuration depends entirely on your necessities, just keep in mind that PRs are parsed since last release so you'll need to execute **RNG** before new release step.

##### Decoration object

This object of `key:value` have as key the issue type and value desired decotaion
Expand Down
3 changes: 3 additions & 0 deletions bin/rng.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node

require('../lib/index');

0 comments on commit 3a76fc5

Please sign in to comment.