Updating a package version
sfdx force:package:version:list --packages 0Ho1n000000k9bcCAA
=== Package Versions [1]
Package Name Namespace Version Name Version Subscriber Package Version Id Alias Installation Key Released Branch
──────────── ───────── ──────────── ─────── ───────────────────────────── ──────────────── ──────────────── ──────── ──────
CSTQueue ver 0.1 0.1.0.1 04t1n0000021jxDAAQ cSTQueue@0.1.0-1 true false
sfdx-project.json
{
"packageDirectories": [
{
"path": "force-app",
"default": true,
"package": "CSTQueue",
"versionName": "ver 0.1",
"versionNumber": "0.1.0.NEXT"
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "46.0",
"packageAliases": {
"CSTQueue": "0Ho1n000000k9bcCAA",
"CSTQueue@0.1.0-1": "04t1n0000021jxDAAQ"
}
}
Assume some update and so a new version needs creating to allow deploy.
sfdx force:package:version:create -p CSTQueue -d force-app --installationkey <password> --wait 10
sfdx-project.json has been updated.
Successfully created the package version [08c1n000000k9bmAAA]. Subscriber Package Version Id: 04t1n0000021jxhAAA
Package Installation URL: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t1n0000021jxhAAA
As an alternative, you can use the "sfdx force:package:install" command.
sfdx-project.json
{
"packageDirectories": [
{
"path": "force-app",
"default": true,
"package": "CSTQueue",
"versionName": "ver 0.1",
"versionNumber": "0.1.0.NEXT"
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "46.0",
"packageAliases": {
"CSTQueue": "0Ho1n000000k9bcCAA",
"CSTQueue@0.1.0-1": "04t1n0000021jxDAAQ",
"CSTQueue@0.1.0-2": "04t1n0000021jxhAAA"
}
}
sfdx force:package:version:list --packages 0Ho1n000000k9bcCAA
=== Package Versions [2]
Package Name Namespace Version Name Version Subscriber Package Version Id Alias Installation Key Released Branch
──────────── ───────── ──────────── ─────── ───────────────────────────── ──────────────── ──────────────── ──────── ──────
CSTQueue ver 0.1 0.1.0.1 04t1n0000021jxDAAQ CSTQueue@0.1.0-1 true false
CSTQueue ver 0.1 0.1.0.2 04t1n0000021jxhAAA CSTQueue@0.1.0-2 true false
{
"status": 0,
"result": [
{
"Package2Id": "0Ho1n000000k9bcCAA",
"Branch": null,
"Tag": null,
"MajorVersion": 0,
"MinorVersion": 1,
"PatchVersion": 0,
"BuildNumber": 1,
"Id": "05i1n000000k9bcAAA",
"SubscriberPackageVersionId": "04t1n0000021jxDAAQ",
"Name": "ver 0.1",
"NamespacePrefix": null,
"Package2Name": "CSTQueue",
"Description": null,
"Version": "0.1.0.1",
"IsPasswordProtected": true,
"IsReleased": false,
"CreatedDate": "2019-07-29 20:31",
"LastModifiedDate": "2019-07-29 20:31",
"InstallUrl": "https://login.salesforce.com/packaging/installPackage.apexp?p0=04t1n0000021jxDAAQ",
"Alias": "CSTQueue@0.1.0-1"
},
{
"Package2Id": "0Ho1n000000k9bcCAA",
"Branch": null,
"Tag": null,
"MajorVersion": 0,
"MinorVersion": 1,
"PatchVersion": 0,
"BuildNumber": 2,
"Id": "05i1n000000k9bhAAA",
"SubscriberPackageVersionId": "04t1n0000021jxhAAA",
"Name": "ver 0.1",
"NamespacePrefix": null,
"Package2Name": "CSTQueue",
"Description": null,
"Version": "0.1.0.2",
"IsPasswordProtected": true,
"IsReleased": false,
"CreatedDate": "2019-07-30 23:52",
"LastModifiedDate": "2019-07-30 23:52",
"InstallUrl": "https://login.salesforce.com/packaging/installPackage.apexp?p0=04t1n0000021jxhAAA",
"Alias": "CSTQueue@0.1.0-2"
}
]
}
Promoting a package to be installed in production
sfdx force:package:version:create -p NameOfPackage -d force-app -x --wait 10 -n major.minor.patch.build
So the major.minor.patch.build might be 0.3.0.1 as an example. Note in code to promote 0.3.0.1 changes to 0.3.0-1
sfdx force:package:version:promote --package NameOfPackage@major.minor.patch-build
sfdx force:package:version:list --packages NameOfPackage
Check that you have the latest to install.