-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): replace inline release config with shared config
makes use of @codedependant/release-config-npm
- Loading branch information
1 parent
b9df7f3
commit c15c301
Showing
3 changed files
with
27 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
# root | ||
- package-ecosystem: "npm" | ||
directory: "/" # Location of package manifests | ||
allow: | ||
- dependency-type: "direct" | ||
versioning-strategy: increase | ||
commit-message: | ||
prefix: "chore(deps):" | ||
pull-request-branch-name: | ||
separator: "-" | ||
schedule: | ||
interval: "daily" | ||
labels: | ||
- "npm" | ||
- "dependencies" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,6 @@ | ||
'use strict' | ||
|
||
const now = new Date() | ||
const year = now.getFullYear() | ||
const day = String(now.getDate()).padStart(2, '0') | ||
const month = String(now.getMonth() + 1).padStart(2, '0') | ||
|
||
const COMMIT_TYPES = new Map([ | ||
['build', 'Build System'] | ||
, ['ci', 'Continuous Integration'] | ||
, ['chore', 'Chores'] | ||
, ['default', 'Miscellaneous'] | ||
, ['dep', 'Dependancies'] | ||
, ['doc', 'Documentation'] | ||
, ['docs', 'Documentation'] | ||
, ['feat', 'Features'] | ||
, ['fix', 'Bug Fixes'] | ||
, ['lint', 'Lint'] | ||
, ['perf', 'Performance Improvements'] | ||
, ['revert', 'Reverts'] | ||
, ['refactor', 'Code Refactoring'] | ||
, ['style', 'Style'] | ||
, ['test', 'Tests'] | ||
]) | ||
|
||
function typeOf(type) { | ||
return COMMIT_TYPES.get(type) || COMMIT_TYPES.get('default') | ||
} | ||
|
||
function transform(commit) { | ||
commit.type = typeOf(commit.type) | ||
commit.shortHash = commit.hash.substring(0, 7) | ||
return commit | ||
} | ||
|
||
module.exports = { | ||
branches: [ | ||
'main' | ||
] | ||
, parserOpts: { | ||
noteKeywords: ['BREAKING', 'BREAKING CHANGE', 'BREAKING CHANGES'] | ||
, headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/ | ||
, breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/ | ||
, headerCorrespondence: ['type', 'scope', 'subject'] | ||
, issuePrefixes: ['#', 'gh-'] | ||
, referenceActions: [ | ||
'close', 'closes', 'closed' | ||
, 'fix', 'fixes', 'fixed' | ||
, 'resolve', 'resolves', 'resolved' | ||
] | ||
} | ||
, writerOpts: {transform: transform} | ||
, releaseRules: [ | ||
{breaking: true, release: 'major'} | ||
, {revert: true, release: 'patch'} | ||
, {type: 'build', release: 'patch'} | ||
, {type: 'ci', release: 'patch'} | ||
, {type: 'release', release: 'patch'} | ||
, {type: 'doc', release: 'patch'} | ||
, {type: 'chore', release: 'patch'} | ||
, {type: 'ci', release: 'patch'} | ||
, {type: 'lib', release: 'patch'} | ||
, {type: 'perf', release: 'minor'} | ||
, {type: 'refactor', release: 'patch'} | ||
, {type: 'release', release: false} | ||
, {type: 'test', release: 'patch'} | ||
, {type: 'fix', release: 'patch'} | ||
] | ||
, plugins: [ | ||
['@semantic-release/commit-analyzer', null], | ||
, ['@semantic-release/release-notes-generator', null] | ||
, ['@semantic-release/changelog', { | ||
changelogTitle: '# Changlog' | ||
, changelogFile: 'CHANGELOG.md' | ||
}] | ||
, ['@semantic-release/npm', null] | ||
, ['@semantic-release/exec', { | ||
prepareCmd: 'npm run docs:build' | ||
}] | ||
, ['@semantic-release/git', { | ||
assets: ['package.json', 'package-lock.json', 'CHANGELOG.md', 'docs'] | ||
, message: `release: ${year}-${month}-${day}, ` | ||
+ 'Version <%= nextRelease.version %> [skip ci]' | ||
}] | ||
, ['@semantic-release/github', null] | ||
] | ||
'extends': '@codedependant/release-config-npm' | ||
, 'branches': ['main'] | ||
} |