Skip to content

CommandQueryNotification2 #175

CommandQueryNotification2

CommandQueryNotification2 #175

Workflow file for this run

name: Publish to Nuget
on:
pull_request:
branches:
- master
types: [closed]
workflow_dispatch:
env:
SOLUTION: './Odin.sln'
BUILD_CONFIGURATION: Release
PACKAGE_DIR: Packaging
NUGET_SOURCE: https://api.nuget.org/v3/index.json
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure git
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.x.x
- name: Run Unit Tests on .Net 10
run: dotnet test TestsOnly.sln -f net10.0 --verbosity quiet --filter "TestCategory!=IntegrationTest"
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
- name: Update Project Versions
uses: gittools/actions/gitversion/execute@v0
id: gitversion
with:
useConfigFile: true
additionalArguments: '/updateprojectfiles'
- name: Package for Nuget
run: |
dotnet pack ./BackgroundProcessing/Abstractions/Odin.BackgroundProcessing.Abstractions.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./BackgroundProcessing/Hangfire/Odin.BackgroundProcessing.Hangfire.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./BackgroundProcessing/Core/Odin.BackgroundProcessing.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Configuration/AzureBlobJson/Odin.Configuration.AzureBlobJson.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Data/SqlScriptsRunner/Odin.Data.SqlScriptsRunner.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./DesignContracts/Core/Odin.DesignContracts.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Domain/Core/Odin.Domain.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Domain/EntityFramework/Odin.Domain.EntityFramework.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Email/Mailgun/Odin.Email.Mailgun.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Email/Office365/Odin.Email.Office365.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Email/Core/Odin.Email.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Logging/Core/Odin.Logging.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Messaging/RabbitMq/Odin.Messaging.RabbitMq.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Patterns/Commands.Abstractions/Odin.Patterns.Commands.Abstractions.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Patterns/Commands/Odin.Patterns.Commands.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Patterns/Queries/Odin.Patterns.Queries.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Patterns/Notifications/Odin.Patterns.Notifications.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./RemoteFiles/Abstractions/Odin.RemoteFiles.Abstractions.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./RemoteFiles/SFTP/Odin.RemoteFiles.SFTP.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./RemoteFiles/Core/Odin.RemoteFiles.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./System/StringEnum/Odin.System.StringEnum.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./System/Result/Odin.System.Result.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Templating/Razor.Abstractions/Odin.Templating.Razor.Abstractions.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Templating/Razor/Odin.Templating.Razor.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Utility/VaryingValues/Odin.Utility.VaryingValues.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Utility/Tax/Odin.Utility.Tax.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./System/Activator2/Odin.System.Activator2.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
env:
CONFIGURATION: ${{env.BUILD_CONFIGURATION}}
PACKAGE_DIR: ${{env.PACKAGE_DIR}}
VERSION: ${{env.GitVersion_SemVer}}
- name: Publish to Nuget
run: |
dotnet nuget push $PACKAGE_DIR/Odin.**.nupkg --api-key $API_KEY --source $NUGET_SOURCE
env:
API_KEY: ${{ secrets.NUGET_API_KEY }}
NUGET_SOURCE: ${{ env.NUGET_SOURCE }}
PACKAGE_DIR: ${{ env.PACKAGE_DIR }}
- name: Tag Repository
id: tag-repository
run: |
git tag -a $RELEASE_TAG -m "Version $RELEASE_TAG"
git push origin $RELEASE_TAG
echo "releaseTag=$RELEASE_TAG" >> "$GITHUB_OUTPUT"
env:
RELEASE_TAG: v${{ steps.gitversion.outputs.fullSemVer }}
- name: Create GitHub Release
run: |
echo "Release tag: $RELEASE_TAG"
echo "Branch: $BRANCH_NAME"
if [[ "$BRANCH_NAME" == "master" ]]; then
echo "Generating latest release from master"
gh release create $RELEASE_TAG ./$PACKAGE_DIR/*.nupkg --title "$RELEASE_TAG" --generate-notes --verify-tag --latest
else
echo "Generating prerelease version"
gh release create $RELEASE_TAG ./$PACKAGE_DIR/*.nupkg --title "$RELEASE_TAG" --generate-notes --verify-tag --prerelease
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ steps.tag-repository.outputs.releaseTag }}
BRANCH_NAME: ${{ steps.gitversion.outputs.branchName }}
PACKAGE_DIR: ${{ env.PACKAGE_DIR }}