-
Notifications
You must be signed in to change notification settings - Fork 23
/
release.config.cjs
52 lines (50 loc) · 2.01 KB
/
release.config.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* eslint-disable no-template-curly-in-string */
const path = require('path');
const {spawnSync} = require('child_process');
const {
addCommitAnalyzerPlugin,
addGitHubActionsOutputPlugin,
addReleaseNotesGeneratorPlugin,
addChangelogPlugin,
} = require('@myparcel/semantic-release-config/src/plugins/index.js');
const {gitPluginDefaults} = require('@myparcel/semantic-release-config/src/plugins/addGitPlugin');
const {addExecPlugin, addGitHubPlugin, addGitPlugin} = require('@myparcel/semantic-release-config/src/plugins');
const mainConfig = require('@myparcel/semantic-release-config');
const branch = spawnSync('git', ['rev-parse', '--abbrev-ref', 'HEAD']).stdout.toString().trim();
module.exports = {
...mainConfig,
extends: '@myparcel/semantic-release-config',
branches: [
{name: 'main'},
{name: 'develop', prerelease: 'rc', channel: 'rc'},
{name: 'alpha', prerelease: 'alpha', channel: 'alpha'},
{name: 'beta', prerelease: 'beta', channel: 'beta'},
],
plugins: [
addCommitAnalyzerPlugin(),
addGitHubActionsOutputPlugin(),
addReleaseNotesGeneratorPlugin({header: path.resolve(__dirname, `private/semantic-release/header-${branch}.md`)}),
addChangelogPlugin(),
// TODO: Uncomment when we're releasing to the WordPress svn repository.
// '@myparcel/semantic-release-wordpress-readme-generator',
addExecPlugin({
prepareCmd: `yarn pdk-builder release --root-command "${process.env.PDK_ROOT_COMMAND}" --version $\{nextRelease.version} -v`,
}),
addGitHubPlugin({
assets: [
{
path: './dist/myparcelnl-*.zip',
label: 'Download MyParcelNL WooCommerce v${nextRelease.version} (for myparcel.nl customers)',
},
{
path: './dist/myparcelbe-*.zip',
label: 'Download MyParcelBE WooCommerce v${nextRelease.version} (for sendmyparcel.be customers)',
},
],
}),
addGitPlugin({
...gitPluginDefaults,
assets: [...gitPluginDefaults.assets, 'woocommerce-myparcel.php', 'readme.txt'],
}),
],
};