At present, Salesforce unlocked package doesn't support packaging of all metadata types, also some metadata are not meant to be deployed using unlocked package (such as org specific entities). However to deploy such metadata across multiple org's, one has to resort to deploying metadata directly from a source repo using 'metadata api'. Source based packages is a 'sfpowerscripts' construct that allows one to have the primary advantage of packaging (mainly traceability, and cohesiveness) to non packaging supported metadata components.
This task generates a build artifact which include the source (metadata) which will be deployed using the Install Source Package Task.
Classic Designer Labels are in Bold, YAML Variables are in italics
Name of the package / package Provide the name of the package.
The version number of the package to be created” / version_number
The format is
major.minor.patch.buildnumber . This will override the build number mentioned in the
sfdx-project.json. Consider running the Increment Version Number task before this task and passing the
sfpowerscripts_incremented_project_version variable as an input to this field.
Only run task if package has changed / isDiffCheck Enable this option to conditionally build the source package only if there has been a change to the package. To determine whether a package has changed, also enable 'Tag latest commit ID with package name and version'.
Tag latest commit ID with package name and version / isGitTag Enable this option to tag the latest commit ID with an annotated Git tag that shows the package name and version. To push the tag to your repository, please refer to Execute Post Steps after Creating a Package.
Project Directory / project_directory
This parameter may be left blank if the
sfdx-project.json is in the root of the repository, else provide the folder directory containing the
The version number of the package that was created.
steps:- task: [email protected]<version>displayName: 'Creates a new version of Source Based Package for <mypackage>'inputs:package: <mypackage>version_number: <'$(sfpowerscripts_incremented_project_version)'>isDiffCheck: falseisGitTag: falseproject_directory: [dir]
10.0.6 Update Core dependency
Removed Telemetry Collection
Added Options to tag a package
Added Options only to create a package if there is only change
7.0.5 Refactored to use revamped folder structure
6.0.0 Support for creation of multiple packages in a single build such as in a MonoRepo
5.1.0 Minor changes in artifact that is getting stored
5.0.1 Updated with Telemetry
4.0.0 Initial Version