Open atian25 opened 1 year ago
module.exports = { plugins: [ [ '@semantic-release/commit-analyzer', { } ], [ '@semantic-release/release-notes-generator', { } ], [ '@semantic-release/changelog', { changelogTitle: '# Changelog', } ], [ '@semantic-release/npm', { tarballDir: '.semantic-release', } ], [ '@semantic-release/exec', { 'publishCmd': 'ls -l dist && ls -l .semantic-release && tar -ztvf .semantic-release/*.tgz', } ], [ '@semantic-release/git', { } ], [ '@semantic-release/github', { addReleases: 'bottom', assets: '.semantic-release/*.tgz', } ], ], };
see the log: https://github.com/atian25/github-actions-test/actions/runs/3672673923/jobs/6209067073
the reason is when set tarballDir, this plugin will exec npm pack first then npm publish (see https://github.com/semantic-release/npm/blob/master/lib/prepare.js#LL24C20-L24C20)
tarballDir
npm pack
npm publish
Suggest: when set tarballDir, then just npm publish {path/to/pack_dist}.tgz , so the npm publish will not trigger prepack again
npm publish {path/to/pack_dist}.tgz
and when the prepack fail, the rest plugin's fail step can't process with it, due to un-wrapped error
prepack
fail step
see the log: https://github.com/atian25/github-actions-test/actions/runs/3672673923/jobs/6209067073
the reason is when set
tarballDir
, this plugin will execnpm pack
first thennpm publish
(see https://github.com/semantic-release/npm/blob/master/lib/prepare.js#LL24C20-L24C20)Suggest: when set
tarballDir
, then justnpm publish {path/to/pack_dist}.tgz
, so thenpm publish
will not trigger prepack again