diff --git a/package.json b/package.json index 1901c19..780e6ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-scaffold", - "version": "0.0.0", + "version": "1.9.0", "description": "Generate any file structure - from single components to entire app boilerplates, with a single command.", "homepage": "https://chenasraf.github.io/simple-scaffold", "repository": "https://github.com/chenasraf/simple-scaffold.git", diff --git a/release.config.js b/release.config.js index 72b055a..68211bd 100644 --- a/release.config.js +++ b/release.config.js @@ -1,30 +1,34 @@ -/** @type {import('semantic-release').Options} */ +const ref = process.env.GITHUB_REF || "" +const branch = ref.split("/").pop() + +/** + * @type {import('semantic-release').GlobalConfig} + */ module.exports = { branches: ["master", { name: "pre", prerelease: true }], - analyzeCommits: { - path: "semantic-release-conventional-commits", - }, plugins: [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", [ - "@semantic-release/changelog", + "@semantic-release/npm", { - changelogFile: "CHANGELOG.md", - changelogTitle: "# Change Log", + // only update the pkg version on root, don't publish + npmPublish: false, }, ], + // [ + // '@semantic-release/npm', + // { + // // only update the pkg version on doc, don't publish + // npmPublish: false, + // pkgRoot: 'doc', + // }, + // ] [ "@semantic-release/npm", { - npmPublish: true, - pkgRoot: "dist", - }, - ], - [ - "@semantic-release/git", - { - assets: ["CHANGELOG.md"], + // publish from build dir instead of root + pkgRoot: "build", }, ], [ @@ -33,5 +37,29 @@ module.exports = { assets: ["*.tgz"], }, ], + [ + "@semantic-release/git", + { + assets: ["package.json", "CHANGELOG.md"].filter(Boolean), + }, + ], + // + // [ + // '@semantic-release/exec', + // { + // verifyReleaseCmd: 'echo ${nextRelease.version} > .VERSION', + // }, + // ], ], } + +if (branch === "master") { + const gitIdx = module.exports.plugins.findIndex((plugin) => plugin[0] === "@semantic-release/git") + module.exports.plugins.splice(gitIdx, 0, [ + "@semantic-release/changelog", + { + changelogFile: "CHANGELOG.md", + changelogTitle: "# Change Log", + }, + ]) +}