semantic-release-sfdx2
v1.6.0
Published
Set of semantic-release plugins to publish SFDX Package
Downloads
78
Maintainers
Readme
semantic-release-sfdx
semantic-release plugin for publishing an SFDX package
Aside
This is a fork of https://github.com/leboff/semantic-release-sfdx with the following changes:
- Updated to use the latest version of sfdx-node
- ESM module support
- Add more options for configuration
Prerequisites
You must have SFDX installed and connected to your DevHub (see Authorization in the Salesforce DX Developer Guide).
Installation
npm install -D semantic-release-sfdx2
or using yarn:
yarn add -D semantic-release-sfdx2
Configuration
To enable this plugin, simply add the following to your package.json
or release configuration file.
{
"release": {
"plugins": ["semantic-release-sfdx2"]
}
}
DevHub
By default this plugin uses the DevHub which is set in your defaultdevhubusername
sfdx config.
To use another DevHub, set the environment variable SFDX_DEFAULTDEVHUBUSERNAME
(see Salesforce CLI Setup Guide).
Advanced Configuration
You can configure the plugin by providing an object instead of a string in the plugins
array, available options are:
codecoverage
- boolean - whether to run tests with code coveragepromote
- boolean - whether to promote the package versioninstallationkey
- string - the installation key for the packageversionCreateWait
- number - the wait time for package version creation. Defaults to 15 minutes.definitionfile
- string - the path to the definition filedevhubusername
- string - the dev hub username, if you wish to override the defaultskipvalidation
- boolean - whether to skip validationskipancestorcheck
- boolean - whether to skip ancestor check
static config via package.json
{
"release": {
"plugins": [
[
"semantic-release-sfdx2",
{
"codecoverage": true,
"promote": true,
"installationkey": "mysecretkey"
}
]
]
}
}
dynamic config via release.config.js
module.exports = {
plugins: [
[
'semantic-release-sfdx',
{
codecoverage: process.env.PROMOTE_PACKAGE_VERSION === 'true',
promote: process.env.PROMOTE_PACKAGE_VERSION === 'true',
installationkey: process.env.INSTALLATIONKEY,
},
],
],
}
verifyConditions
To disable the verification of your SFDX project, DevHub and installationkey:
{
"release": {
"plugins": [
"semantic-release-sfdx",
{
"verifyConditions": false
}
]
}
}
Credits
Thanks to https://github.com/carlos-cubas/semantic-release-gcp.git for kicking off point
Thanks to https://github.com/leboff/semantic-release-sfdx for creating the original package