-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.config.mjs
29 lines (27 loc) · 1.27 KB
/
release.config.mjs
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
import { readFileSync } from 'node:fs';
const packageName = JSON.parse(readFileSync('sfdx-project.json', 'utf8')).packageDirectories.find(
(packageDirectory) => packageDirectory.default
).package;
/**
* @type {import('semantic-release').GlobalConfig}
*/
export default {
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
[
'@semantic-release/exec',
{
shell: '/bin/bash',
// create package version for default package directory
publishCmd: `sf package version create --package "${packageName}" --version-number "\${nextRelease.version}.NEXT" --installation-key-bypass --code-coverage --wait 30 --json`,
// output package version id for GitHub Actions
// promote package version
successCmd: `echo "packageVersionId=\${releases[0].result.SubscriberPackageVersionId}" >> "\${process.env.GITHUB_OUTPUT}";
echo "version=\${releases[0].result.VersionNumber}" >> "\${process.env.GITHUB_OUTPUT}";
sf package version promote --package "\${releases[0].result.SubscriberPackageVersionId}" --no-prompt --json`
}
],
'@semantic-release/github'
]
};