mirror of
https://github.com/chenasraf/simple-scaffold.git
synced 2026-05-17 17:28:09 +00:00
build: fix versioning
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user