Skip to content

Commit

Permalink
Updated to .NET 6 and created a multi-platform Docker image as the only
Browse files Browse the repository at this point in the history
deployment. Removed DotNet tool and Chocolatey package deployments.
Removed AppVeyor CI, now using GitHub Actions.
  • Loading branch information
jasminsehic committed Jun 19, 2022
1 parent aca8965 commit e9848da
Show file tree
Hide file tree
Showing 21 changed files with 244 additions and 206 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This is a basic workflow to help you get started with Actions

name: Deploy

# Controls when the workflow will run
on:
push:
tags:
- '*' # Push events to every tag

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build and push
uses: docker/build-push-action@v2
with:
file: ./src/PullRequestReleaseNotes/Dockerfile
context: ./src/PullRequestReleaseNotes
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/pullrequestreleasenotes:latest
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/pullrequestreleasenotes:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/pullrequestreleasenotes:buildcache,mode=max
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This is a basic workflow to help you get started with Actions

name: Test

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'

- name: Test
run: dotnet test src/PullRequestReleaseNotes.Tests/PullRequestReleaseNotes.Tests.csproj --verbosity normal

2 changes: 0 additions & 2 deletions GitVersion.yml

This file was deleted.

56 changes: 26 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,51 @@
Pull Request Release Notes
==========================

[![Build status](https://ci.appveyor.com/api/projects/status/github/jasminsehic/pullrequestreleasenotes?svg=true)](https://ci.appveyor.com/project/jasminsehic/unreleasedgithubhistory)
[![Nuget](https://img.shields.io/nuget/v/PullRequestReleaseNotes.DotNetCore.svg)](https://www.nuget.org/packages/PullRequestReleaseNotes.DotNetCore)
[![Chocolatey](https://img.shields.io/chocolatey/vpre/PullRequestReleaseNotes.svg)](https://chocolatey.org/packages/PullRequestReleaseNotes)
[![Test](https://github.com/jasminsehic/PullRequestReleaseNotes/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/jasminsehic/PullRequestReleaseNotes/actions/workflows/test.yml)
[![Deploy](https://github.com/jasminsehic/PullRequestReleaseNotes/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/jasminsehic/PullRequestReleaseNotes/actions/workflows/main.yml)
[![Release](https://img.shields.io/github/release/jasminsehic/PullRequestReleaseNotes.svg)](https://github.com/jasminsehic/PullRequestReleaseNotes/releases)
[![License](https://img.shields.io/github/license/jasminsehic/PullRequestReleaseNotes.svg)](https://github.com/jasminsehic/PullRequestReleaseNotes/blob/master/LICENSE)
[![Gitter](https://badges.gitter.im/jasminsehic/PullRequestReleaseNotes.svg)](https://gitter.im/jasminsehic/PullRequestReleaseNotes)

Pull Request Release Notes utility generates release notes for all merged pull requests, on a specific branch, that have not yet been released relying solely on pull request titles and labels to generate the release notes and publish them in markdown format.
Pull Request Release Notes utility generates release notes for all merged pull requests that have not been released relying on pull request titles and labels to generate and publish release notes.

Supported Pull Request providers are [GitHub](https://github.com/), [GitLab](https://gitlab.com/), [Azure DevOps Services / Server](https://azure.microsoft.com/en-au/services/devops/), [BitBucket Cloud](https://bitbucket.org/) and [Bitbucket Server](https://www.atlassian.com/software/bitbucket/download).

Intention is to run this utility as part of a continuous integration process and generate notes automatically as part of every release branch build. Optionally the utility can also publish the notes to a markdown file, [Atlassian Confluence](https://www.atlassian.com/software/confluence) page or a [Slack](https://slack.com/) post.
You can run this as part of CI process and generate notes automatically as part of every release. You can also publish notes to a markdown file, [Atlassian Confluence](https://www.atlassian.com/software/confluence) page or a [Slack](https://slack.com/) post.

## Command line, YAML file parameters and Environment variables
See [HELP.md](https://github.com/jasminsehic/PullRequestReleaseNotes/blob/master/docs/HELP.md) for details on parameters.

## Release Notes Format

Utility outputs release notes following the [Semantic Release Notes](https://web.archive.org/web/20161013175123/http://www.semanticreleasenotes.org/) format and extracts semantic release note sections, categories and summaries from the pull request title and labels. For example all pull requests with `Bug` label can be grouped under `Fixes` section and pull requests with `Enhancement` label can be grouped under `Enhancements` section. Category grouping is possible through use of the `#Label` where `#` character is used to denote a category label as opposed to a section label. BitBucket Cloud / Server pull request providers do not have a label concept yet so for those providers you can type `[#section]` and `[##category]` either in the title or the description of the pull request as a pseudo-label.

Release note formatting can be further customised where you can turn off grouping by section and category, order the release notes based on merged or created time of pull request and the format of the release note itself. Version number can be supplied via [GitVersion](https://github.com/GitTools/GitVersion) tool.

You can also define a label to exclude pull request from release notes. Also you can define a label that when not added to a pull request will add a release note highlighted as code. This can be useful for scenarios such as QA team adding a QC label to a pull request so then it is easy to spot which items haven't gone through QC.

See [HELP.md](https://github.com/jasminsehic/PullRequestReleaseNotes/blob/master/docs/HELP.md) for all the details on how perform these customisations.

## .NET Core Global Tool Install

dotnet tool install -g PullRequestReleaseNotes.DotNetCore

## .NET Core Global Tool Usage
## Docker Image

While inside a git working directory run the application
You can run `jasminsehic/pullrequestreleasenotes` Linux Docker image on Windows WSL2, Linux or MacOS.
While inside the root of a working git directory run the Docker image using below command examples.
GitHubToken used in the example is just an example.

$ dotnet-pullrequestreleasenotes -GitHubToken c03b77a4982d48f0af328312a9b99455
To run on Windows run this from Command Prompt:
```
docker run --rm -it -v "%cd%:/repo" jasminsehic/pullrequestreleasenotes:latest -grp /repo -GitHubToken c03b77a4982d48f0af328312a9b99455
```
or run this from PowerShell:
```
docker run --rm -it -v "${pwd}:/repo" jasminsehic/pullrequestreleasenotes:latest -grp /repo -GitHubToken c03b77a4982d48f0af328312a9b99455
```
To run on Linux or MacOS:
```
docker run --rm -it -v "$(pwd):/repo" jasminsehic/pullrequestreleasenotes:latest -grp /repo -GitHubToken c03b77a4982d48f0af328312a9b99455
```

### Linux note
## Release Notes Format

Only tested on Ubuntu 18.04 (Bionic) and 20.04 (Focal Fossa). You will need to run `sudo apt-get install libgit2-dev` and `sudo ln -s /usr/lib/x86_64-linux-gnu/libgit2.so /usr/lib/x86_64-linux-gnu/libgit2-572e4d8.so` to ensure libgit2 library can be found by the app. This is expected to be resolved in a future version of LibGit2Sharp.
Utility outputs release notes following the [Semantic Release Notes](https://web.archive.org/web/20161013175123/http://www.semanticreleasenotes.org/) format hiararchy and extracts semantic release note sections, categories and summaries from the pull request title and labels.

## Chocolatey Install
For example all pull requests with `Bug` label can be grouped under `Fixes` section and pull requests with `Enhancement` label can be grouped under `Enhancements` section. Category grouping is possible through use of the `#Label` where `#` character is used to denote a category label as opposed to a section label. BitBucket Cloud / Server pull request providers do not have a label concept yet so for those providers you can type `[#section]` and `[##category]` either in the title or the description of the pull request as a pseudo-label.

choco install PullRequestReleaseNotes

## Chocolatey Usage
Release note formatting can be further customised where you can turn off grouping by section and category, order the release notes based on merged or created time of pull request and the format of the release note itself. Version number can be supplied via [GitVersion](https://github.com/GitTools/GitVersion) tool.

While inside a git working directory run the application
You can also define a label to exclude pull request from release notes. Also you can define a label that when not added to a pull request will add a release note highlighted as code. This can be useful for scenarios such as QA team adding a QC label to a pull request so then it is easy to spot which items haven't gone through QC.

$ PullRequestReleaseNotes -GitHubToken c03b77a4982d48f0af328312a9b99455
See [HELP.md](https://github.com/jasminsehic/PullRequestReleaseNotes/blob/master/docs/HELP.md) for all the details on how perform these customisations.

## PullRequestReleaseNotes in action

Expand Down
28 changes: 0 additions & 28 deletions appveyor.yml

This file was deleted.

2 changes: 2 additions & 0 deletions docs/HELP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
### Command Line Parameters
Utility can have command line parameters passed to it or have the parameters supplied via a YAML based config or a mixture of both. Command line parameter will win if the same parameter is also supplied via YAML. You can generate a sample YAML file by passing -init parameter to the utility.

You can use `--version` as a command line parameter to print the version of the PullRequestReleaseNotes application.

- `-PullRequestProviderName` (`-prpn`) : Default is `github`. Other providers supported are `gitlab`, `tfs`, `bitbucket` and `bitbucketserver`.
- `-GitHubToken` (`-ghpt`) : Required parameter if PullRequestProviderName is `github`. Can be supplied as parameter or `PRRN_GITHUB_TOKEN` environment variable.
- `-GitHubOwner` (`-gho`) : Default is extracted from remote url.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<TargetFramework>net6.0</TargetFramework>
<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Shouldly" Version="3.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Shouldly" Version="4.0.3" />
<PackageReference Include="TestStack.BDDfy" Version="4.3.2" />
</ItemGroup>

Expand Down
12 changes: 12 additions & 0 deletions src/PullRequestReleaseNotes/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# directories
**/bin/
**/obj/
**/out/

# files
Dockerfile*
**/*.trx
**/*.md
**/*.ps1
**/*.cmd
**/*.sh
Loading

0 comments on commit e9848da

Please sign in to comment.