Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
categories:
- title: '🚀 Features'
labels:
- 'feature'
- title: '🐛 Bug Fixes'
labels:
- 'bug'
- title: '🧰 Maintenance'
label: 'maintenance'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
template: |
## Changes
$CHANGES
127 changes: 127 additions & 0 deletions .github/workflows/createrelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Release

on:
release:
types: [published]

jobs:
build:
name: "Release"
env:
ASPNETCORE_ENVIRONMENT: "Production"

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.102

- name: Restore Nuget Packages
run: dotnet restore MessagingService.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json

- name: Build Code
run: dotnet build MessagingService.sln --configuration Release

#- name: Run Unit Tests
# run: |
# echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
# dotnet test "MessagingService.BusinessLogic.Tests\MessagingService.BusinessLogic.Tests.csproj"
# dotnet test "MessagingService.EmailAggregate.Tests\MessagingService.EmailAggregate.Tests.csproj"
# dotnet test "MessagingService.Tests\MessagingService.Tests.csproj"

#- name: Build Docker Image
# run: docker build . --file MessagingService/Dockerfile --tag stuartferguson/messagingservice:latest --tag stuartferguson/messagingservice:${{ steps.get_version.outputs.VERSION }}

#- name: Publish Images to Docker Hub
# run: |
# docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
# docker push stuartferguson/messagingservice:latest
# docker push stuartferguson/messagingservice:${{ steps.get_version.outputs.VERSION }}

#- name: Publish API
# run: dotnet publish "MessagingService\MessagingService.csproj" --configuration Release --output publishOutput

- name: Setup .NET Core 2.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.0.0

- name: Extract Octopus Tools
run: |
mkdir /opt/octo
cd /opt/octo
wget -O /opt/octo/octopus.zip https://download.octopusdeploy.com/octopus-tools/6.12.0/OctopusTools.6.12.0.portable.zip
unzip /opt/octo/octopus.zip
chmod +x /opt/octo/Octo

- name: Pack Files for Octopus
run: >-
/opt/octo/Octo pack
--outFolder /home/runner/work/MessagingService/MessagingService
--basePath /home/runner/work/MessagingService/MessagingService/publishOutput
--id MessagingService
--version ${{ steps.get_version.outputs.VERSION }}
--format zip
--verbose
--logLevel=verbose

- name: Push Package to Octopus
run: >-
/opt/octo/Octo push
--server ${{ secrets.OCTOPUS_URL }}
--apiKey ${{ secrets.OCTOPUS_APIKEY }}
--package /home/runner/work/MessagingService/MessagingService/MessagingService.${{ steps.get_version.outputs.VERSION }}.zip
--overwrite-mode IgnoreIfExists

- name: Get Release
id: getrelease
uses: octokit/request-action@v1.x
with:
route: GET /repos/StuartFerguson/MessagingService/releases/tags/${{ steps.get_version.outputs.VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Release Notes
id: buildreleasenotes
uses: gr2m/get-json-paths-action@v1.x
with:
json: ${{ steps.getrelease.outputs.data }}
releasenote: "body"

- name: Create & Deploy Release in Octopus
run: >-
/opt/octo/Octo create-release
--server ${{ secrets.OCTOPUS_URL }}
--apiKey ${{ secrets.OCTOPUS_APIKEY }}
--project "Messaging Service"
--version ${{ steps.get_version.outputs.VERSION }}
--channel Default
--deployTo Development
--waitfordeployment
--deploymenttimeout 00:05:00
--releasenotes "${{ steps.buildreleasenotes.outputs.releasenote }}"

- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.102

- name: Build and Publish Nuget Packages
run: |
dotnet pack "MessagingService.EmailMessage.DomainEvents\MessagingService.EmailMessage.DomainEvents.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets -c Release
dotnet nuget push Nugets/MessagingService.EmailMessage.DomainEvents.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.MYGET_APIKEY }} --source https://www.myget.org/F/transactionprocessing/api/v2/package

#- name: Build and Publish Nuget Packages
# run: |
# dotnet pack "MessagingService.Client\MessagingService.Client.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets -c Release
# #dotnet nuget push Nugets/MessagingService.Client.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.MYGET_APIKEY }} --source https://www.myget.org/F/transactionprocessing/api/v2/package
# dotnet pack "MessagingService.EmailMessage.DomainEvents\MessagingService.EmailMessage.DomainEvents.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets -c Release
# dotnet nuget push Nugets/MessagingService.EmailMessage.DomainEvents.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.MYGET_APIKEY }} --source https://www.myget.org/F/transactionprocessing/api/v2/package
44 changes: 44 additions & 0 deletions .github/workflows/prereleasenuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish Pre-Release Nuget

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
build:
name: "Publish Pre-Release Nugets"
env:
ASPNETCORE_ENVIRONMENT: "Production"

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Restore Nuget Packages
run: dotnet restore MessagingService.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json

- name: Build Code
run: dotnet build MessagingService.sln --configuration Release

- name: Get the last version
id: get_version
run: echo ::set-output name=VERSION::$(git tag --sort=committerdate | tail -1)

- name: Print Version
id: next_version
run: echo ::set-output name=VERSION::${{ steps.get_version.outputs.VERSION }}.$GITHUB_RUN_NUMBER

- name: Build and Publish Nuget Packages
run: |
dotnet pack "MessagingService.EmailMessage.DomainEvents\MessagingService.EmailMessage.DomainEvents.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets -c Release
dotnet nuget push Nugets/MessagingService.EmailMessage.DomainEvents.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.MYGET_APIKEY }} --source https://www.myget.org/F/transactionprocessing/api/v2/package

#- name: Build and Publish Nuget Packages
# run: |
# dotnet pack "MessagingService.Client\MessagingService.Client.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets -c Release
# #dotnet nuget push Nugets/MessagingService.Client.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.MYGET_APIKEY }} --source https://www.myget.org/F/transactionprocessing/api/v2/package
# dotnet pack "MessagingService.EmailMessage.DomainEvents\MessagingService.EmailMessage.DomainEvents.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets -c Release
# dotnet nuget push Nugets/MessagingService.EmailMessage.DomainEvents.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.MYGET_APIKEY }} --source https://www.myget.org/F/transactionprocessing/api/v2/package
41 changes: 41 additions & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Test Pull Requests

on:
pull_request:
branches:
- master

jobs:
build:
name: "Build and Test Pull Requests"
env:
ASPNETCORE_ENVIRONMENT: "Production"

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.102

- name: Restore Nuget Packages
run: dotnet restore MessagingService.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json

- name: Build Code
run: dotnet build MessagingService.sln --configuration Release

#- name: Run Unit Tests
# run: |
# echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
# dotnet test "MessagingService.BusinessLogic.Tests\MessagingService.BusinessLogic.Tests.csproj"
# dotnet test "MessagingService.EmailAggregate.Tests\MessagingService.EmailAggregate.Tests.csproj"
# dotnet test "MessagingService.Tests\MessagingService.Tests.csproj"

#- name: Build Docker Image
# run: docker build . --file MessagingService/Dockerfile --tag messagingservice:latest

#- name: Run Integration Tests
# run: dotnet test "MessagingService.IntegrationTests\MessagingService.IntegrationTests.csproj" --filter Category=PRTest
16 changes: 16 additions & 0 deletions .github/workflows/release-management.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Management

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
update_draft_release:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: toolmantim/release-drafter@v5.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions act/actions-setup-dotnet@v1
Submodule actions-setup-dotnet@v1 added at b78211