Just a quick enhancement to this post where we exported a solution from Power Platforms in order to commit to a source repo.
If you manually exported the solution in Power Platform, it would normally offer to automatically increment the version by one. This post will demonstrate how to do it with DevOps Pipeline as well.
This sets the format of the Pipeline's Build.BuildNumber property. What
1.0.1.$(rev:rr) means is that we want the version to be 1.0.1.x with x being appended by one each time.
Add the Set Solution Version task before the export solution task. This step will actually go into your Dev environment's solution and update the version number to be the same as the BuildNumber.
When you do a PR, you'll be able see that the version in the solution has also changed.