Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] feat: add dependency management automation (#1676). #1677

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,29 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release
64 changes: 64 additions & 0 deletions .releaserc.js
@@ -0,0 +1,64 @@
'use strict';

/* The releaseConfig object drives configuration across 5 semantic-release plugins. For more details on the
plugin options and overides used see:
- @semantic-release/commit-analyzer: https://github.com/semantic-release/commit-analyzer
- @semantic-release/release-notes-generator: https://github.com/semantic-release/release-notes-generator
- @semantic-release/changelog: https://github.com/semantic-release/changelog
- @semantic-release/npm: https://github.com/semantic-release/npm#semantic-releasenpm
- @semantic-release/git: https://github.com/semantic-release/git
- @semantic-release/github: https://github.com/semantic-release/github
*/

function compileReleaseRules(listOfTypes, release = 'patch') {
return listOfTypes.map(type => ({
type,
release
}));
}

const typesForPatch = ['docs', 'style', 'refactor', 'perf'];
const typesForMinor = ['feat'];
const parserOpts = {
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING']
};

const releaseConfig = {
branches: ['master'],
plugins: [
[
'@semantic-release/commit-analyzer',
{
releaseRules: [
...compileReleaseRules(typesForPatch),
...compileReleaseRules(typesForMinor, 'minor')
],
parserOpts
}
],
[
'@semantic-release/release-notes-generator',
{
parserOpts
}
],
'@semantic-release/changelog',
[
'@semantic-release/npm',
{
npmPublish: false
}
],
[
'@semantic-release/git',
{
assets: ['package.json', 'package-lock.json', 'CHANGELOG.md'],
message:
'chore(release): ${nextRelease.version} \n\n${nextRelease.notes}'
}
],
'@semantic-release/github'
]
};

module.exports = releaseConfig;