Skip to content

Commit

Permalink
feat: skip changelog gen
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 authored Sep 2, 2023
1 parent 21cbedd commit c7b6e33
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ const {
GIT_COMMITTER_EMAIL,
GIT_AUTHOR_NAME,
GIT_AUTHOR_EMAIL,
NPM_PACKAGE_ROOT
NPM_PACKAGE_ROOT,
SKIP_CHANGELOG = false,
SKIP_DOCKER_PUBLISH = false,
SKIP_NPM_PUBLISH = false
} = process.env;
const [owner, repo] = String(GITHUB_REPOSITORY).toLowerCase().split("/");
const addPlugin = (plugin, options) => {
Expand Down Expand Up @@ -109,16 +112,18 @@ addPlugin("@semantic-release/release-notes-generator", {
}
});

addPlugin("@semantic-release/changelog", {
"changelogTitle": `# 📦 ${owner}/${repo} changelog
if (!SKIP_CHANGELOG) {
addPlugin("@semantic-release/changelog", {
"changelogTitle": `# 📦 ${owner}/${repo} changelog
[![conventional commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![semantic versioning](https://img.shields.io/badge/semantic%20versioning-2.0.0-green.svg)](https://semver.org)
> All notable changes to this project will be documented in this file`
});
});
}

if (process.env.SKIP_NPM_PUBLISH === undefined) {
if (!SKIP_NPM_PUBLISH) {
const pkgRoot = NPM_PACKAGE_ROOT || ".";
addPlugin("@semantic-release/npm", {
tarballDir: "pack",
Expand Down Expand Up @@ -166,25 +171,23 @@ if (manifestExists && GITHUB_REF === "refs/heads/main") {
});
}

if (process.env.SKIP_NPM_PUBLISH === undefined) {
const packageFilesPrefix = process.env.NPM_PACKAGE_ROOT ? `${process.env.NPM_PACKAGE_ROOT}/` : "";
addPlugin("@semantic-release/git", {
const packageFilesPrefix = process.env.NPM_PACKAGE_ROOT ? `${process.env.NPM_PACKAGE_ROOT}/` : "";
addPlugin("@semantic-release/git", {
"assets": [
"LICENSE*",
"CHANGELOG.md",
`${packageFilesPrefix}package.json`,
`${packageFilesPrefix}package-lock.json`,
`${packageFilesPrefix}npm-shrinkwrap.json`,
`${packageFilesPrefix}yarn.lock`,
`${packageFilesPrefix}pnpm-lock.yaml`,
"public/**/*",
"supabase/**/*",
"action.yml",
"manifest.json"
"LICENSE*",
"CHANGELOG.md",
`${packageFilesPrefix}package.json`,
`${packageFilesPrefix}package-lock.json`,
`${packageFilesPrefix}npm-shrinkwrap.json`,
`${packageFilesPrefix}yarn.lock`,
`${packageFilesPrefix}pnpm-lock.yaml`,
"public/**/*",
"supabase/**/*",
"action.yml",
"manifest.json"
],
"message": `chore(<%= nextRelease.type %>): release <%= nextRelease.version %> <%= nextRelease.channel !== null ? \`on \${nextRelease.channel} channel \` : '' %>[skip ci]\n\n<%= nextRelease.notes %>`
});
}
});

addPlugin("@semantic-release/github", {
"addReleases": "bottom",
Expand All @@ -197,7 +200,7 @@ addPlugin("@semantic-release/github", {
});

const dockerExists = existsSync("./Dockerfile");
if (dockerExists && process.env.SKIP_DOCKER_PUBLISH === undefined) {
if (dockerExists && !SKIP_DOCKER_PUBLISH) {
addPlugin("eclass-docker-fork", {
"baseImageName": `${owner}/${repo}`,
"registries": [
Expand Down

0 comments on commit c7b6e33

Please sign in to comment.