Skip to content

Commit

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

* fix: add release pipe line
  • Loading branch information
nimatrengo authored Jun 9, 2023
1 parent caf5155 commit 0185af8
Show file tree
Hide file tree
Showing 5 changed files with 6,073 additions and 1,516 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Release

on:
push:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
- run: npm run release
5 changes: 1 addition & 4 deletions .github/workflows/node.js.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI
name: Test

on:
push:
Expand Down
115 changes: 115 additions & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
branches: ['main']
ci: true
debug: true
dryRun: false

verifyConditions:
- '@semantic-release/changelog'
- '@semantic-release/git'
- '@semantic-release/github'
- '@semantic-release/npm'

# Responsible for determining the type of the next release (major, minor or patch).
# If multiple plugins with a analyzeCommits step are defined, the release type will be
# the highest one among plugins output.
# Look details at: https://github.com/semantic-release/commit-analyzer#configuration
analyzeCommits:
- path: '@semantic-release/commit-analyzer'
# Determine the type of release by analyzing commits with conventional-changelog
releaseRules:
- breaking: true
release: major
- type:
build # Changes that affect the build system or external dependencies
# (example scopes: gulp, broccoli, npm)
release: patch
- type: chore # Other changes that don't modify src or test files
release: false
- type: ci # Changes to our CI configuration files and scripts
release: false
- type: docs # Documentation only changes
release: patch
- type: feat # A new feature
release: minor
- type: fix # A bug fix
release: patch
- type: perf # A code change that improves performance
release: patch
- type: refactor # A code change that neither fixes a bug nor adds a feature
release: false
- type: revert # Reverts a previous commit
release: patch
- type:
style # Changes that do not affect the meaning of the code
# (white-space, formatting, missing semi-colons, etc)
release: false
- type: test # Adding missing tests or correcting existing tests
release: false

# Responsible for generating the content of the release note.
# If multiple plugins with a generateNotes step are defined,
# the release notes will be the result of the concatenation of each plugin output.
generateNotes:
- path: '@semantic-release/release-notes-generator'
writerOpts:
groupBy: 'type'
commitGroupsSort: 'title'
commitsSort: 'header'
linkCompare: true
linkReferences: true
parserOpts:
# detect JIRA issues in merge commits
mergePattern: "^Merge branch '(.*)' into (.*)$"
mergeCorrespondence: ['branch_src', 'branch_dst']
presetConfig:
types: # looks like it only works with 'conventionalcommits' preset
- type: 'build'
section: '🦊 CI/CD'
hidden: false
- type: 'chore'
section: 'Other'
hidden: false
- type: 'ci'
section: '🦊 CI/CD'
hidden: false
- type: 'docs'
section: '📔 Docs'
hidden: false
- type: 'example'
section: '📝 Examples'
hidden: false
- type: 'feat'
section: '🚀 Features'
hidden: false
- type: 'fix'
section: '🛠 Fixes'
hidden: false
- type: 'perf'
section: '⏩ Performance'
- type: 'refactor'
section: ':scissors: Refactor'
hidden: false
- type: 'revert'
section: '🙅‍♂️ Reverts'
- type: 'style'
section: '💈 Style'
- type: 'test'
section: '🧪 Tests'
hidden: false

# Responsible for preparing the release, for example creating or updating files
# such as package.json, CHANGELOG.md, documentation or compiled assets
# and pushing a commit.
prepare:
- path: '@semantic-release/changelog'
# Create or update the changelog file in the local project repository
- path: '@semantic-release/git'
# Push a release commit and tag, including configurable files
message: "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
assets: ['package.json', 'package-lock.json']

# Responsible for publishing the release.
publish:
- path: '@semantic-release/github'
- path: '@semantic-release/npm'
npmPublish: true
Loading

0 comments on commit 0185af8

Please sign in to comment.