Skip to content

Commit

Permalink
Update release docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mryanmurphy committed Oct 15, 2022
1 parent f124fb4 commit d390b6b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ To retrieve all releases for a repository:
var releases = await client.Repository.Release.GetAll("octokit", "octokit.net");
var latest = releases[0];
Console.WriteLine(
"The latest release is tagged at {0} and is named {1}",
latest.TagName,
"The latest release is tagged at {0} and is named {1}",
latest.TagName,
latest.Name);
```

Expand All @@ -35,6 +35,14 @@ Note that the `Draft` flag is used to indicate when a release should be publishe
GitHub can generate a name and body for a new release [automatically](https://github.blog/2021-10-04-beta-github-releases-improving-release-experience/#introducing-auto-generated-release-notes), based upon merged pull requests.
[This is an example](https://github.com/MylesBorins/release-notes-test/releases/tag/v2.0.0) of automatically generated text.

```csharp
var newTag = "v1.5.7";
var newRelease = new NewRelease(newTag);
newRelease.GenerateReleaseNotes = true; // Set for Name and Body to be generated.
newRelease.TargetCommitish = "main"; // Optional, can be a branch, tag, or SHA; defaults to the main branch.
```

#### Customizing generated notes
```csharp
var newTag = "v1.5.7";
var generationRequest = new GenerateReleaseNotesRequest(newTag);
Expand Down Expand Up @@ -68,7 +76,7 @@ If you have any assets to include with the release, you can upload them after cr

```csharp
using(var archiveContents = File.OpenRead("output.zip")) { // TODO: better sample
var assetUpload = new ReleaseAssetUpload()
var assetUpload = new ReleaseAssetUpload()
{
FileName = "my-cool-project-1.0.zip",
ContentType = "application/zip",
Expand Down

0 comments on commit d390b6b

Please sign in to comment.