Skip to content

Use Nerdbank.GitVersioning #301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

sharwell
Copy link
Contributor

@sharwell sharwell commented Jan 16, 2019

⚠️ This pull request depends on #299, and will be substantially simplified once that PR is merged. ⚠️

Overview

This change uses Nerdbank.GitVersioning to automatically version the assemblies and packages as work progresses in the repository.

Deployment

Deploying a release to NuGet is much simpler after this change is applied. After setting up an environment (see next part), here are the steps to release a build:

  1. After merging a pull request to master, locate the AppVeyor build you want to release
  2. Open the Image: Visual Studio 2017; Configuration: Release job for the build (this is the only job containing the full set of correct artifacts for release)
  3. At the top of the AppVeyor page, click Deploy
  4. Select the NuGet (coverlet) environment and deploy
  5. After deployment succeeds, create and push a tag in the repository

Creating the environment

💡 This is a one-time setup process, after which you can use the environment any time you want to make a new coverlet release.

  1. Log in to AppVeyor and go to the Environments tab (at the top, next to Projects)
  2. Create a new environment
  3. Select NuGet as the deployment provider
  4. In your NuGet profile, create a new API key, and scope the key to coverlet.*
  5. Back in AppVeyor environment setup apply the following:
    • Environment name: NuGet (coverlet)
    • API key: Copied from step (4)
  6. Click Add environment to create the environment

@codecov
Copy link

codecov bot commented Jan 16, 2019

Codecov Report

Merging #301 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #301   +/-   ##
=======================================
  Coverage   87.02%   87.02%           
=======================================
  Files          31       31           
  Lines        3107     3107           
=======================================
  Hits         2704     2704           
  Misses        403      403

@sharwell sharwell mentioned this pull request Jan 16, 2019
4 tasks
@sharwell sharwell changed the title Use Nerdbank.GitVersioning [WIP] Use Nerdbank.GitVersioning Jan 16, 2019
@sharwell
Copy link
Contributor Author

Marked as WIP while I rebase to account for recent merges.

@sharwell
Copy link
Contributor Author

@tonerdo I left this marked as a WIP, but only because I want to rebase it after #299 is merged so the code review is simplified to only show the changes in what is currently commit 948be42.

@sharwell
Copy link
Contributor Author

sharwell commented Mar 1, 2019

@tonerdo This is now rebased. As you can see, the builds produced by each AppVeyor build now have a unique version number, making it tremendously easier to prepare/manage releases. You will only rarely need to update version numbers in the project, and when you do, it will be limited to changes in version.json.

version.json Outdated
"publicReleaseRefSpec": [
"^refs/heads/master$"
],
"buildNumberOffset": 3,
Copy link
Contributor Author

@sharwell sharwell Mar 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 This accounts for the fact that you were already making releases with version numbers 2.5.x, and we don't want to reuse a version number already taken by a previous build. The property can be permanently removed starting with your first 2.6+ build.

@sharwell sharwell changed the title [WIP] Use Nerdbank.GitVersioning Use Nerdbank.GitVersioning Mar 1, 2019
@sharwell
Copy link
Contributor Author

sharwell commented Mar 1, 2019

/cc @AArnott in case he wants to put a copy of the instructions above somewhere for future users. 😄

@AArnott
Copy link
Contributor

AArnott commented Mar 1, 2019

I'm torn. The doc looks well written, but it doesn't really have anything to do with NB.GV itself. But maybe as a new AppVeyor-specific suggestions doc linked from https://github.com/AArnott/Nerdbank.GitVersioning/blob/master/doc/cloudbuild.md ?

@sharwell would you be willing to send such a PR?

@sharwell
Copy link
Contributor Author

sharwell commented Mar 3, 2019

@tonerdo Conflicts are resolved again

@tonerdo
Copy link
Collaborator

tonerdo commented Mar 3, 2019

Thank you @sharwell, will take a look in a couple

@tonerdo
Copy link
Collaborator

tonerdo commented May 26, 2019

Superseded by #425

@tonerdo tonerdo closed this May 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants