Skip to content

Commit

Permalink
test: attempt to bump latest github actions tag with script
Browse files Browse the repository at this point in the history
  • Loading branch information
0-vortex committed May 16, 2023
1 parent 4c7d975 commit b3c281a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 28 deletions.
11 changes: 10 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"conventional-changelog-conventionalcommits": "^5.0.0",
"eclass-docker-fork": "^1.3.1",
"npmlog": "^7.0.1",
"semantic-release": "^21.0.2"
"semantic-release": ">=21.0.0",
"semantic-release-major-tag": "^0.3.0"
},
"devDependencies": {
"@open-sauced/check-engines": "^1.2.0",
Expand Down
56 changes: 30 additions & 26 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,30 @@ const { existsSync } = require("node:fs");
const { execSync } = require('node:child_process');
const log = require("npmlog");

const plugins = [];
log.info(`Executing semantic-release config setup`);

const releaseConfig = {
"branches": [
// maintenance releases
"+([0-9])?(.{+([0-9]),x}).x",

// release channels
"main",
"next",
"next-major",

// pre-releases
{
name: "beta",
prerelease: true
},
{
name: "alpha",
prerelease: true
}
],
plugins: [],
}
const noteKeywords = [
"BREAKING CHANGE",
"BREAKING CHANGES",
Expand All @@ -20,11 +43,9 @@ const [owner, repo] = String(GITHUB_REPOSITORY).toLowerCase().split("/");
const addPlugin = (plugin, options) => {
log.info(`${plugin} enabled ${options && 'with options:'}`);
options && log.info(null, options);
return plugins.push([plugin, options]);
return releaseConfig.plugins.push([plugin, options]);
};

log.info(`Executing semantic-release config setup`);

!GIT_COMMITTER_NAME && (process.env.GIT_COMMITTER_NAME = "open-sauced[bot]");
!GIT_COMMITTER_EMAIL && (process.env.GIT_COMMITTER_EMAIL = "63161813+open-sauced[bot]@users.noreply.github.com");

Expand All @@ -38,6 +59,8 @@ try {
log.error(e);
}

log.info(`Adding semantic-release config plugins`);

addPlugin("@semantic-release/commit-analyzer", {
"preset": "conventionalcommits",
"releaseRules": [
Expand Down Expand Up @@ -158,6 +181,8 @@ if (dockerExists) {
});
}

addPlugin("semantic-release-major-tag");

if (process.env.GITHUB_ACTIONS !== undefined) {
addPlugin("@semantic-release/exec", {
successCmd: `echo 'RELEASE_TAG=v\${nextRelease.version}' >> $GITHUB_ENV
Expand All @@ -167,25 +192,4 @@ echo 'release-version=\${nextRelease.version}' >> $GITHUB_OUTPUT`,
});
}

module.exports = {
"branches": [
// maintenance releases
"+([0-9])?(.{+([0-9]),x}).x",

// release channels
"main",
"next",
"next-major",

// pre-releases
{
name: "beta",
prerelease: true
},
{
name: "alpha",
prerelease: true
}
],
plugins,
}
module.exports = releaseConfig;

0 comments on commit b3c281a

Please sign in to comment.