diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 14fb00f..f89d5e4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,20 +1,35 @@ name: Deploy on: - workflow_dispatch: + release: + types: [published] jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-dotnet@v1 + - name: Setup .NET + uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: | + 3.1.x + 6.0.x + 7.0.x + - name: Restore dependencies + run: dotnet restore + - name: Set Assembly Version + run: ./build.sh --task=GitVersion --configuration=Release + - name: Build Library + run: dotnet build --configuration Release --no-restore + - name: Update Version + run: sed -i "s/<\/Version>/${{ github.event.release.name }}<\/Version>/" ./Float.TinCan.LocalLRSServer/Float.TinCan.LocalLRSServer.csproj + - name: Pack and Upload + run: dotnet pack --configuration Release --no-restore - name: Deploy to NuGet env: FLOAT_NUGET_TOKEN: ${{ secrets.FLOAT_NUGET_TOKEN }} - run: ./build.sh --task=Deploy --configuration=Release --nugetUrl="https://api.nuget.org/v3/index.json" --nugetToken="${FLOAT_NUGET_TOKEN}" + run: dotnet nuget push ./Float.TinCan.LocalLRSServer/bin/Release/Float.TinCan.LocalLRSServer.${{ github.event.release.name }}.nupkg --api-key "${FLOAT_NUGET_TOKEN}" --source https://api.nuget.org/v3/index.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1559cfa..2405f87 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,14 +12,23 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup .NET - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: | + 3.1.x + 6.0.x + 7.0.x - name: Restore dependencies run: dotnet restore - name: Build - run: dotnet build --no-restore + run: dotnet build --configuration Release --no-restore - name: Test - run: dotnet test --no-build --verbosity normal + run: dotnet test --configuration Release --no-build --verbosity normal --logger:"trx;" + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() + with: + files: | + **/TestResults/*.trx \ No newline at end of file diff --git a/Float.TinCan.LocalLRSServer.Tests/AgentProfile.Tests.cs b/Float.TinCan.LocalLRSServer.Tests/AgentProfile.Tests.cs index d68e813..184d009 100644 --- a/Float.TinCan.LocalLRSServer.Tests/AgentProfile.Tests.cs +++ b/Float.TinCan.LocalLRSServer.Tests/AgentProfile.Tests.cs @@ -7,7 +7,7 @@ namespace Float.TinCan.LocalLRSServer.Tests { - public class TestAgentProfile + public sealed class TestAgentProfile: IDisposable { class StubServerDelegate : ILRSServerDelegate { @@ -136,5 +136,7 @@ public async Task TestCanGetAgentProfile() { localLRS.Close(); } + + public void Dispose() => localLRS.Dispose(); } } diff --git a/Float.TinCan.LocalLRSServer.Tests/Float.TinCan.LocalLRSServer.Tests.csproj b/Float.TinCan.LocalLRSServer.Tests/Float.TinCan.LocalLRSServer.Tests.csproj index fa1535c..a57d69c 100644 --- a/Float.TinCan.LocalLRSServer.Tests/Float.TinCan.LocalLRSServer.Tests.csproj +++ b/Float.TinCan.LocalLRSServer.Tests/Float.TinCan.LocalLRSServer.Tests.csproj @@ -1,7 +1,8 @@ - net6.0 + netcoreapp3.1;net6.0;net7.0 false + 9.0 @@ -9,19 +10,33 @@ ../stylecop.ruleset - - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + - runtime; build; native; contentfiles; analyzers; buildtransitive -all - + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + runtime; build; native; contentfiles; analyzers; buildtransitive all - + + + + + + diff --git a/Float.TinCan.LocalLRSServer/Float.TinCan.LocalLRSServer.csproj b/Float.TinCan.LocalLRSServer/Float.TinCan.LocalLRSServer.csproj index c215373..c38ac08 100644 --- a/Float.TinCan.LocalLRSServer/Float.TinCan.LocalLRSServer.csproj +++ b/Float.TinCan.LocalLRSServer/Float.TinCan.LocalLRSServer.csproj @@ -1,6 +1,6 @@ - netstandard2.0 + netstandard2;net6.0;net7.0 Float.TinCan.LocalLRSServer Float A local LRS server for xAPI. @@ -11,6 +11,8 @@ $(AssemblyName) false 9.0 + 1.0.0 + @@ -29,13 +31,13 @@ readme.md - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + diff --git a/build.cake b/build.cake index bf9664a..eb675f0 100644 --- a/build.cake +++ b/build.cake @@ -92,7 +92,6 @@ Task("GitVersion") }); Task("Build") - .IsDependentOn("RestorePackages") .IsDependentOn("GitVersion") .Does(() => { diff --git a/global.json b/global.json deleted file mode 100644 index 676135e..0000000 --- a/global.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "sdk": { - "version": "6" - } - } - \ No newline at end of file diff --git a/readme.md b/readme.md index a3e7dfb..c68fc19 100644 --- a/readme.md +++ b/readme.md @@ -4,6 +4,10 @@ A local LRS server for xAPI. ## Building +First you must restore the nuget libraries + + dotnet restore + This project can be built using [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/) or [Cake](https://cakebuild.net/). It is recommended that you build this project by invoking the bootstrap script: ./build.sh