I am looking for a solution to automatically increment a package version (not to be confused with an assembly version) after each build on CI server (particularly Atlassian Bamboo). Every appx package has a version defined in its manifest file (appxmanifest). Thus in order to increase the version a manifest must be edited before commit. I am considering different approaches to implement this. The first one makes changes in manifest and pushes it back to the repo.
- Starts building a plan (in order to lock a build number)
- Modifies manifest so that a revision is set to the current build number
- Pushes changes to SCM (particularly Atlassian Stash). This step shouldn't trigger the next build.
- Continues building the package (invoke MSBuild, UT and other tasks)
Cons
- Leads to incorrect workflow on Bamboo: checkout -> push -> build
- Each build makes a new commit
Another approach is to setup post receive Stash hook which would modify appxmanifest.
Cons Hard to keep a build number in sync with Bamboo.
Is there any other (cleaner and proper) way to achieve this?