@@ -30,9 +30,11 @@ Looking for information on how to use this module? Head on over to [README.md](
3030 * [ Automated Tests] ( #automated-tests )
3131 * [ New Test Guidelines] ( #new-test-guidelines )
3232* [ Releasing] ( #releasing )
33+ * [ Updating the Version Number] ( #updating-the-version-number )
34+ * [ Semantic Versioning] ( #semantic-versioning )
3335 * [ Updating the CHANGELOG] ( #updating-the-changelog )
3436 * [ Adding a New Tag] ( #adding-a-new-tag )
35- * [ Publish a Signed Update to PowerShell Gallery ] ( #publish-a-signed-update-to-PowerShellGallery )
37+ * [ Running the Release Build ] ( #running-the-release-build )
3638* [ Contributors] ( #contributors )
3739* [ Legal and Licensing] ( #legal-and-licensing )
3840
@@ -375,10 +377,31 @@ any possible name collisions with existing objects on the executing user's accou
375377
376378### Releasing
377379
378- If you are a maintainer:
380+ When new code changes are checked in to the repo, most users of the module will not see those changes
381+ unless an updated module gets published by Microsoft to
382+ [ PowerShell Gallery] ( https://www.powershellgallery.com/packages/PowerShellForGitHub ) .
379383
380- Ensure that the version number of the module is updated with every pull request that is being
381- accepted.
384+ The general guidance on publishing an update is that changes should not be in ` master ` more than
385+ one week without having been published through PowerShell Gallery as well.
386+
387+ When you are ready to publish a new update, the following steps are necessary:
388+ * Create (and complete) a changelist that:
389+ * Updates the [ version number] ( #updating-the-version-number )
390+ * Updates the [ CHANGELOG.md] ( ./CHANGELOG.md ) (and [ contributors] ( #contributors ) list if necessary)
391+ * [ Add a tag] ( #adding-a-new-tag ) for the new version to the repo
392+ * [ Queue a new release build] ( #running-the-release-build )
393+
394+ #### Updating the Version Number
395+
396+ Whenever new changes to the module are to be released to PowerShellGallery, it is important to
397+ properly update the version of the module. The version number is stored in the module manifest
398+ ([ PowerShellForGitHub.psd1] ( https://github.com/microsoft/PowerShellForGitHub/blob/master/PowerShellForGitHub.psd1 ) ),
399+ and it should be updated following the [ Semantic Versioning] ( #semantic-versioning ) standard.
400+
401+ > The update to the module manifest should happen in the same changelist where the
402+ > [ CHANGELOG is updated] ( #updating-the-changelog ) .
403+
404+ ##### Semantic Versioning
382405
383406This project follows [ semantic versioning] ( http://semver.org/ ) in the following way:
384407
@@ -389,49 +412,53 @@ Where:
389412* ` <minor> ` - If this is a feature update, increment by one and be sure to reset ` <patch> ` to 0.
390413* ` <patch> ` - If this is a bug fix, leave ` <minor> ` alone and increment this by one.
391414
392- When new code changes are checked in to the repo, the module must be signed and published by
393- Microsoft to [ PowerShell Gallery] ( https://www.powershellgallery.com/packages/PowerShellForGitHub ) .
394-
395- Once the new version has been pulled into master, there are additional tasks to perform:
396-
397- * Ensure that [ all tests pass] ( #testing ) and that the module is still [ static analysis clean] ( #static-analysis )
398- * Update [ CHANGELOG.md] ( ./CHANGELOG.md )
399- * Add a tag for that version to the repo
400- * Publish a _ signed_ update to [ PowerShellGallery] ( https://www.powershellgallery.com/packages/PowerShellForGitHub/ ) .
401-
402415#### Updating the CHANGELOG
403416To update [ CHANGELOG.md] ( ./CHANGELOG.md ) , just duplicate the previous section and update it to be
404417relevant for the new release. Be sure to update all of the sections:
405418 * The version number
406- * The hard path to the change (we'll get that path working in a moment)
419+ * The hard path to the change (we'll get that path working [ in a moment] ( #adding-a-new-tag ) )
407420 * The release date
408421 * A brief list of all the changes (use a ` - ` for the bullet point if it's fixing a bug, or a ` + ` for a feature)
409422 * The link to the pull request (pr) (so that the discussion on the change can be easily reviewed) and the changelist (cl)
410423 * The author (and a link to their profile)
411424 * If it's a new contributor, also add them to the [ Contributors] ( #contributors ) list below.
412425
413- Then get a new pull request out for that change to CHANGELOG.
426+ Then get a new pull request out for that change and for the change to the
427+ [ module manifest's version number] ( #updating-the-version-number ) .
414428
415429#### Adding a New Tag
416430To add a new tag:
417431 1 . Make sure that you're in a clone of the actual repo and not your own private fork.
418- 2 . Make sure that you have checked out ` master ` and that it's fully up-to-date
419- 3 . Run ` git tag -a '<version number>' `
420- 4 . In the pop-up editor, give a one-line summary of the change (that you possibly already wrote for the CHANGELOG)
421- 5 . Save and close the editor
422- 6 . Run ` git push --tags ` to upload the new tag you just created
432+ 2 . Make sure that you've already merged in the change that updates the module version.
433+ 3 . Make sure that you have checked out ` master ` and that it's fully up-to-date
434+ 4 . Run ` git tag -a '<version number>' `
435+ 5 . In the pop-up editor, just copy the content from the CHANGELOG that you just wrote, but remove
436+ any of the ` ### ` heading blocks since those will be dropped from git as comments instead of
437+ headings.
438+ 6 . Save and close the editor
439+ 7 . Run ` git push --tags ` to upload the new tag you just created
423440
424441If you want to make sure you get these tags on any other forks/clients, you can run
425442` git fetch origin --tags ` or ` git fetch upstream --tags ` , or whatever you've named the source to be.
426443
427- #### Publish a Signed Update to PowerShellGallery
428- The final steps is getting the module updated on
429- [ PowerShellGallery] ( https://www.powershellgallery.com/packages/PowerShellForGitHub/ )
430- so that it is easy for users to adopt the changes.
444+ > Doing this makes it possible for users to simply run ` git checkout <version number> ` to quickly
445+ > set their clone to the state of any previous version.
446+ > It also has the added benefit that GitHub will automatically create a new "Release" in the
447+ > Releases tab of the project for this new version.
448+
449+ #### Running the Release Build
450+
451+ A [ YAML definition exists] ( https://github.com/microsoft/PowerShellForGitHub/blob/master/build/pipelines/azire-pipelines.release.yaml )
452+ that will run the equivalent of the CI build, followed by the necessary steps to sign the module
453+ files and publish the update to PowerShell Gallery. This YAML file can only be run by a Microsoft
454+ maintainer because it accesses internal services to sign the module files with Microsoft's certificate.
431455
432- The module files should be signed by Microsoft prior to publishing.
433- Instructions for signing the files and for then publishing the update to PowerShellGallery
434- can be found in the [ internal Microsoft repo for this project] ( https://microsoft.visualstudio.com/Apps/_git/eng.powershellforgithub ) .
456+ > ** Microsoft Maintainers** : You can access the internal pipeline which can execute the release build
457+ > [ here] ( https://microsoft.visualstudio.com/Apps/_build?definitionId=43898 ) . Simply hit ` Queue ` to
458+ > get a new module released.
459+ >
460+ > Instructions for updating the ` PowerShellGalleryApiKey ` secret in the pipeline can be found in the
461+ > [ internal Microsoft repo for this project] ( https://microsoft.visualstudio.com/Apps/_git/eng.powershellforgithub ) .
435462
436463----------
437464
0 commit comments