From 6a9d38bd66dcd04f7eccdd6e1c40eb4d28fe6087 Mon Sep 17 00:00:00 2001 From: Stefania Mellai Date: Thu, 4 Jul 2024 16:21:34 +0200 Subject: [PATCH] chore(ci): restore semantic-release plugins --- package.json | 2 +- repo-scripts/release.ts | 62 +++++++++++++++++++++++++++++++++++------ 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 338c44e..6c21edd 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "lint": "eslint ./src/ --fix", "prettier": "prettier --write src/", "prepare": "husky", - "semantic-release": "node ./repo-scripts/release.ts", + "semantic-release": "node --loader ts-node/esm ./repo-scripts/release.ts", "test:watch": "jest --watch", "test": "jest --coverage", "typecheck": "tsc --noEmit", diff --git a/repo-scripts/release.ts b/repo-scripts/release.ts index 60998b2..4f8c825 100644 --- a/repo-scripts/release.ts +++ b/repo-scripts/release.ts @@ -19,14 +19,60 @@ try { // Plugin options githubUrl: 'https://my-ghe.com', githubApiPathPrefix: '/api-prefix', */ - analyzeCommits: '@semantic-release/commit-analyzer', - verifyConditions: '@semantic-release/npm', - prepare: '@semantic-release/npm', - generateNotes: '@semantic-release/release-notes-generator', - publish: '@semantic-release/npm', - success: false, - fail: false, - npmPublish: true, + plugins: [ + [ + '@semantic-release/commit-analyzer', + { + preset: 'conventionalcommits', + releaseRules: [ + { + type: 'build', + scope: 'deps', + release: 'patch', + }, + ], + }, + ], + [ + '@semantic-release/release-notes-generator', + { + preset: 'conventionalcommits', + presetConfig: { + types: [ + { + type: 'feat', + section: 'Features', + }, + { + type: 'fix', + section: 'Bug Fixes', + }, + { + type: 'build', + section: 'Dependencies and Other Build Updates', + hidden: false, + }, + ], + }, + }, + ], + '@semantic-release/npm', + [ + '@semantic-release/github', + { + successComment: + ":tada: This ${issue.pull_request ? 'pull request' : 'issue'} is included in version ${nextRelease.version}", + }, + ], + [ + '@semantic-release/git', + { + assets: ['package.json', 'package-lock.json'], + message: + 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}', + }, + ], + ], } /* { // Run semantic-release from `/path/to/git/repo/root` without having to change local process `cwd` with `process.chdir()`