diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..b15d368
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,40 @@
+# If this file is renamed, the incrementing run attempt number will be reset.
+
+name: CI
+
+on:
+ push:
+ branches: [ "dev", "main" ]
+ pull_request:
+ branches: [ "dev", "main" ]
+
+env:
+ CI_BUILD_NUMBER_BASE: ${{ github.run_number }}
+ CI_TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: write
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Setup
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: 9.0.x
+ - name: Compute build number
+ shell: bash
+ run: |
+ echo "CI_BUILD_NUMBER=$(($CI_BUILD_NUMBER_BASE+2300))" >> $GITHUB_ENV
+ - name: Build and Publish
+ env:
+ DOTNET_CLI_TELEMETRY_OPTOUT: true
+ NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ shell: pwsh
+ run: |
+ ./Build.ps1
diff --git a/Build.ps1 b/Build.ps1
index dc24499..5439920 100644
--- a/Build.ps1
+++ b/Build.ps1
@@ -1,49 +1,81 @@
-# This script originally (c) 2016 Serilog Contributors - license Apache 2.0
+Write-Output "build: Tool versions follow"
-echo "build: Build started"
+dotnet --version
+dotnet --list-sdks
+
+Write-Output "build: Build started"
Push-Location $PSScriptRoot
+try {
+ if(Test-Path .\artifacts) {
+ Write-Output "build: Cleaning ./artifacts"
+ Remove-Item ./artifacts -Force -Recurse
+ }
-if(Test-Path .\artifacts) {
- echo "build: Cleaning .\artifacts"
- Remove-Item .\artifacts -Force -Recurse
-}
+ & dotnet restore --no-cache
+
+ $dbp = [Xml] (Get-Content .\Directory.Version.props)
+ $versionPrefix = $dbp.Project.PropertyGroup.VersionPrefix
-& dotnet restore --no-cache
-if($LASTEXITCODE -ne 0) { exit 1 }
+ Write-Output "build: Package version prefix is $versionPrefix"
-$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
-$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
-$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "main" -and $revision -ne "local"]
+ $branch = @{ $true = $env:CI_TARGET_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$NULL -ne $env:CI_TARGET_BRANCH];
+ $revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:CI_BUILD_NUMBER, 10); $false = "local" }[$NULL -ne $env:CI_BUILD_NUMBER];
+ $suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)) -replace '([^a-zA-Z0-9\-]*)', '')-$revision"}[$branch -eq "main" -and $revision -ne "local"]
+ $commitHash = $(git rev-parse --short HEAD)
+ $buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
-echo "build: Version suffix is $suffix"
+ Write-Output "build: Package version suffix is $suffix"
+ Write-Output "build: Build version suffix is $buildSuffix"
-foreach ($src in ls src/*) {
- Push-Location $src
+ & dotnet build -c Release --version-suffix=$buildSuffix /p:ContinuousIntegrationBuild=true
+ if($LASTEXITCODE -ne 0) { throw "Build failed" }
- echo "build: Packaging project in $src"
+ foreach ($src in Get-ChildItem src/*) {
+ Push-Location $src
- if ($suffix) {
- & dotnet publish -c Release -o ./obj/publish --version-suffix=$suffix
- & dotnet pack -c Release -o ..\..\artifacts --no-build --version-suffix=$suffix
- } else {
- & dotnet publish -c Release -o ./obj/publish
- & dotnet pack -c Release -o ..\..\artifacts --no-build
+ Write-Output "build: Packaging project in $src"
+
+ if ($suffix) {
+ & dotnet pack -c Release --no-build --no-restore -o ../../artifacts --version-suffix=$suffix
+ } else {
+ & dotnet pack -c Release --no-build --no-restore -o ../../artifacts
+ }
+ if($LASTEXITCODE -ne 0) { throw "Packaging failed" }
+
+ Pop-Location
}
- if($LASTEXITCODE -ne 0) { exit 1 }
- Pop-Location
-}
+ if(Test-Path .\test) {
+ foreach ($test in Get-ChildItem test/*.Tests) {
+ Push-Location $test
-foreach ($test in ls test/*.Tests) {
- Push-Location $test
+ Write-Output "build: Testing project in $test"
- echo "build: Testing project in $test"
+ & dotnet test -c Release --no-build --no-restore
+ if($LASTEXITCODE -ne 0) { throw "Testing failed" }
- & dotnet test -c Release
- if($LASTEXITCODE -ne 0) { exit 3 }
+ Pop-Location
+ }
+ }
+
+ if ($env:NUGET_API_KEY) {
+ # GitHub Actions will only supply this to branch builds and not PRs. We publish
+ # builds from any branch this action targets (i.e. main and dev).
+
+ Write-Output "build: Publishing NuGet packages"
+
+ foreach ($nupkg in Get-ChildItem artifacts/*.nupkg) {
+ & dotnet nuget push -k $env:NUGET_API_KEY -s https://api.nuget.org/v3/index.json "$nupkg"
+ if($LASTEXITCODE -ne 0) { throw "Publishing failed" }
+ }
+ if (!($suffix)) {
+ Write-Output "build: Creating release for version $versionPrefix"
+
+ iex "gh release create v$versionPrefix --title v$versionPrefix --generate-notes $(get-item ./artifacts/*.nupkg) $(get-item ./artifacts/*.snupkg)"
+ }
+ }
+} finally {
Pop-Location
}
-
-Pop-Location
diff --git a/Directory.Version.props b/Directory.Version.props
new file mode 100644
index 0000000..e7bbeca
--- /dev/null
+++ b/Directory.Version.props
@@ -0,0 +1,5 @@
+
+
+ 1.0.0
+
+
diff --git a/README.md b/README.md
index 34a1eb3..dab0623 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Seq.Input.RabbitMQ [](https://ci.appveyor.com/project/datalust/seq-input-rabbitmq)
+# Seq.Input.RabbitMQ [](https://github.com/datalust/seq-input-rabbitmq/actions/workflows/ci.yml)
A Seq custom input that pulls events from RabbitMQ. **Requires Seq 5.1+.**
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index 4db264c..0000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-version: '{build}'
-skip_tags: true
-image: Visual Studio 2022
-install:
-build_script:
-- ps: ./Build.ps1
-test: off
-artifacts:
-- path: artifacts/Seq.Input.RabbitMQ.*.nupkg
-deploy:
-- provider: NuGet
- api_key:
- secure: HDcRadKRDne9Gd1vEQwZknRQz63ZbZMJh6e4sFmiXCpjkxC5WCoQ0ZecWBHtVulX
- skip_symbols: true
- on:
- branch: /^(main|dev)$/
-- provider: GitHub
- auth_token:
- secure: hX+cZmW+9BCXy7vyH8myWsYdtQHyzzil9K5yvjJv7dK9XmyrGYYDj/DPzMqsXSjo
- artifact: /Seq.Input.RabbitMQ.*\.nupkg/
- tag: v$(appveyor_build_version)
- on:
- branch: main
diff --git a/example/Demo/Demo.csproj b/example/Demo/Demo.csproj
index 4686712..6f5ce49 100644
--- a/example/Demo/Demo.csproj
+++ b/example/Demo/Demo.csproj
@@ -1,7 +1,7 @@
- netcoreapp2.1
+ net9.0
Exe
diff --git a/seq-input-rabbitmq.sln b/seq-input-rabbitmq.sln
index 18c6811..089c208 100644
--- a/seq-input-rabbitmq.sln
+++ b/seq-input-rabbitmq.sln
@@ -12,12 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sln", "sln", "{7D1D14F7-D40
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{704915B0-6D95-4CF8-ACC2-5ED939A2913C}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{BE42997A-5927-46E1-AFB5-C1D7A255212E}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seq.Input.RabbitMQ", "src\Seq.Input.RabbitMQ\Seq.Input.RabbitMQ.csproj", "{E80E7949-A3AE-4C7C-9083-9FE9EE1F78E0}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seq.Input.RabbitMQ.Tests", "test\Seq.Input.RabbitMQ.Tests\Seq.Input.RabbitMQ.Tests.csproj", "{9FF2C707-DD8D-4B9C-97A7-4E9F0D9D0008}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "example", "example", "{584683E5-0578-42F0-A958-3AAB3661AA9E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo", "example\Demo\Demo.csproj", "{99D4AAE3-35B3-4BE1-AA5F-7CC8E6B49A07}"
@@ -32,10 +28,6 @@ Global
{E80E7949-A3AE-4C7C-9083-9FE9EE1F78E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E80E7949-A3AE-4C7C-9083-9FE9EE1F78E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E80E7949-A3AE-4C7C-9083-9FE9EE1F78E0}.Release|Any CPU.Build.0 = Release|Any CPU
- {9FF2C707-DD8D-4B9C-97A7-4E9F0D9D0008}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9FF2C707-DD8D-4B9C-97A7-4E9F0D9D0008}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9FF2C707-DD8D-4B9C-97A7-4E9F0D9D0008}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9FF2C707-DD8D-4B9C-97A7-4E9F0D9D0008}.Release|Any CPU.Build.0 = Release|Any CPU
{99D4AAE3-35B3-4BE1-AA5F-7CC8E6B49A07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{99D4AAE3-35B3-4BE1-AA5F-7CC8E6B49A07}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99D4AAE3-35B3-4BE1-AA5F-7CC8E6B49A07}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -46,7 +38,6 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{E80E7949-A3AE-4C7C-9083-9FE9EE1F78E0} = {704915B0-6D95-4CF8-ACC2-5ED939A2913C}
- {9FF2C707-DD8D-4B9C-97A7-4E9F0D9D0008} = {BE42997A-5927-46E1-AFB5-C1D7A255212E}
{99D4AAE3-35B3-4BE1-AA5F-7CC8E6B49A07} = {584683E5-0578-42F0-A958-3AAB3661AA9E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
diff --git a/src/Seq.Input.RabbitMQ/Seq.Input.RabbitMQ.csproj b/src/Seq.Input.RabbitMQ/Seq.Input.RabbitMQ.csproj
index 133247d..136eb18 100644
--- a/src/Seq.Input.RabbitMQ/Seq.Input.RabbitMQ.csproj
+++ b/src/Seq.Input.RabbitMQ/Seq.Input.RabbitMQ.csproj
@@ -1,7 +1,6 @@
netstandard2.0
- 1.0.0
Ingest events into Seq directly from RabbitMQ
Datalust and Contributors
seq-app
diff --git a/test/Seq.Input.RabbitMQ.Tests/Seq.Input.RabbitMQ.Tests.csproj b/test/Seq.Input.RabbitMQ.Tests/Seq.Input.RabbitMQ.Tests.csproj
deleted file mode 100644
index 4ec64e7..0000000
--- a/test/Seq.Input.RabbitMQ.Tests/Seq.Input.RabbitMQ.Tests.csproj
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
- netcoreapp2.1
-
- false
-
-
-
-
-
-
-
-
-
diff --git a/test/Seq.Input.RabbitMQ.Tests/UnitTest1.cs b/test/Seq.Input.RabbitMQ.Tests/UnitTest1.cs
deleted file mode 100644
index 1cac84f..0000000
--- a/test/Seq.Input.RabbitMQ.Tests/UnitTest1.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using Xunit;
-
-namespace Seq.Input.RabbitMQ.Tests
-{
- public class UnitTest1
- {
- [Fact]
- public void Test1()
- {
-
- }
- }
-}