Add README.md to package and update project properties #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Publish | |
| on: | |
| push: | |
| branches: [ master ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| env: | |
| DOTNET_VERSION: '8.0.x' | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install MSMQ | |
| run: | | |
| Write-Host "Installing MSMQ feature..." | |
| Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-Server -All -NoRestart | |
| Write-Host "MSMQ installation completed." | |
| Write-Host "Starting MSMQ service..." | |
| Start-Service -Name MSMQ | |
| Get-Service -Name MSMQ | |
| Write-Host "Creating test queue..." | |
| [System.Reflection.Assembly]::LoadWithPartialName("System.Messaging") | Out-Null | |
| $queuePath = ".\Private$\myQueue" | |
| if (-not [System.Messaging.MessageQueue]::Exists($queuePath)) { | |
| [System.Messaging.MessageQueue]::Create($queuePath) | |
| Write-Host "Queue created: $queuePath" | |
| } else { | |
| Write-Host "Queue already exists: $queuePath" | |
| } | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Test | |
| run: dotnet test --configuration Release --no-build --verbosity normal | |
| - name: Pack | |
| run: dotnet pack --configuration Release --no-build --output ./artifacts | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-package | |
| path: ./artifacts/*.nupkg | |
| publish: | |
| runs-on: windows-latest | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nuget-package | |
| path: ./artifacts | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Publish to NuGet | |
| run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |