1- // const { existsSync } = require('fs')
1+ const { existsSync } = require ( 'fs' )
22const path = require ( 'path' )
33const { reporter } = require ( '@dhis2/cli-helpers-engine' )
4- const semanticRelease = require ( 'semantic-release' )
4+ const semanticRelease = require ( 'semantic-release' ) . default
55const getWorkspacePackages = require ( '../support/getWorkspacePackages' )
66
77const packageIsPublishable = pkgJsonPath => {
@@ -20,6 +20,7 @@ function publisher(target = '', packages) {
2020 return [
2121 '@semantic-release/npm' ,
2222 {
23+ npmPublish : false ,
2324 pkgRoot : path . dirname ( pkgJsonPath ) ,
2425 } ,
2526 ]
@@ -32,7 +33,7 @@ function publisher(target = '', packages) {
3233 '@semantic-release/npm' ,
3334 {
3435 pkgRoot : path . dirname ( pkgJsonPath ) ,
35- npmPublish : false ,
36+ // npmPublish: false,
3637 } ,
3738 ]
3839 } )
@@ -67,27 +68,27 @@ const handler = async ({ publish }) => {
6768 } ,
6869 ]
6970
70- // const gitPlugin = [
71- // '@semantic-release/git',
72- // {
73- // assets: [
74- // 'CHANGELOG.md',
75- // packages.map(pkgJsonPath =>
76- // path.relative(process.cwd(), pkgJsonPath)
77- // ),
78- // packages
79- // .map(pkgJsonPath =>
80- // path.join(path.dirname(pkgJsonPath), 'pnpm-lock.yaml')
81- // )
82- // .filter(existsSync)
83- // .map(pkgJsonPath =>
84- // path.relative(process.cwd(), pkgJsonPath)
85- // ),
86- // ],
87- // message:
88- // 'chore(release): cut ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
89- // },
90- // ]
71+ const gitPlugin = [
72+ '@semantic-release/git' ,
73+ {
74+ assets : [
75+ 'CHANGELOG.md' ,
76+ packages . map ( pkgJsonPath =>
77+ path . relative ( process . cwd ( ) , pkgJsonPath )
78+ ) ,
79+ packages
80+ . map ( pkgJsonPath =>
81+ path . join ( path . dirname ( pkgJsonPath ) , 'pnpm-lock.yaml' )
82+ )
83+ . filter ( existsSync )
84+ . map ( pkgJsonPath =>
85+ path . relative ( process . cwd ( ) , pkgJsonPath )
86+ ) ,
87+ ] ,
88+ message :
89+ 'chore(release): cut ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}' ,
90+ } ,
91+ ]
9192
9293 const deferPlugin = require ( '../support/semantic-release-defer-release' )
9394
@@ -99,7 +100,7 @@ const handler = async ({ publish }) => {
99100 updateDepsPlugin ,
100101 changelogPlugin ,
101102 ...publisher ( publish , packages ) ,
102- // gitPlugin,
103+ gitPlugin ,
103104 '@semantic-release/github' ,
104105 ]
105106
@@ -120,6 +121,7 @@ const handler = async ({ publish }) => {
120121 }
121122
122123 try {
124+ console . log ( semanticRelease )
123125 const result = await semanticRelease ( options , config )
124126
125127 if ( result ) {
@@ -162,4 +164,4 @@ module.exports = {
162164 } ,
163165}
164166
165- // handler({ publish: 'npm' })
167+ handler ( { publish : 'npm' } )
0 commit comments