@@ -30,9 +30,11 @@ Looking for information on how to use this module? Head on over to [README.md](
30
30
* [ Automated Tests] ( #automated-tests )
31
31
* [ New Test Guidelines] ( #new-test-guidelines )
32
32
* [ Releasing] ( #releasing )
33
+ * [ Updating the Version Number] ( #updating-the-version-number )
34
+ * [ Semantic Versioning] ( #semantic-versioning )
33
35
* [ Updating the CHANGELOG] ( #updating-the-changelog )
34
36
* [ 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 )
36
38
* [ Contributors] ( #contributors )
37
39
* [ Legal and Licensing] ( #legal-and-licensing )
38
40
@@ -375,10 +377,31 @@ any possible name collisions with existing objects on the executing user's accou
375
377
376
378
### Releasing
377
379
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 ) .
379
383
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
382
405
383
406
This project follows [ semantic versioning] ( http://semver.org/ ) in the following way:
384
407
@@ -389,49 +412,53 @@ Where:
389
412
* ` <minor> ` - If this is a feature update, increment by one and be sure to reset ` <patch> ` to 0.
390
413
* ` <patch> ` - If this is a bug fix, leave ` <minor> ` alone and increment this by one.
391
414
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
-
402
415
#### Updating the CHANGELOG
403
416
To update [ CHANGELOG.md] ( ./CHANGELOG.md ) , just duplicate the previous section and update it to be
404
417
relevant for the new release. Be sure to update all of the sections:
405
418
* 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 ) )
407
420
* The release date
408
421
* A brief list of all the changes (use a ` - ` for the bullet point if it's fixing a bug, or a ` + ` for a feature)
409
422
* The link to the pull request (pr) (so that the discussion on the change can be easily reviewed) and the changelist (cl)
410
423
* The author (and a link to their profile)
411
424
* If it's a new contributor, also add them to the [ Contributors] ( #contributors ) list below.
412
425
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 ) .
414
428
415
429
#### Adding a New Tag
416
430
To add a new tag:
417
431
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
423
440
424
441
If you want to make sure you get these tags on any other forks/clients, you can run
425
442
` git fetch origin --tags ` or ` git fetch upstream --tags ` , or whatever you've named the source to be.
426
443
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.
431
455
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 ) .
435
462
436
463
----------
437
464
0 commit comments