diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4cc4691 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI +on: + push: + paths: + - 'src/**' + - '.github/workflows/**' + pull_request: +jobs: + build: + if: ${{ false }} # disable for now + runs-on: ubuntu-latest + env: + SLN_FILE_NAME: Digitalroot.Valheim.BetterClubs.sln + NUGET_AUTH_TOKEN: ${{secrets.NUGET_PAT}} + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install dotnet + uses: actions/setup-dotnet@v1 + with: + source-url: https://nuget.pkg.github.com/Digitalroot-Valheim/index.json + - name: Restore packages + run: dotnet restore src/${{ env.SLN_FILE_NAME }} --nologo + - name: Build + run: dotnet build src/${{ env.SLN_FILE_NAME }} -c Release --no-restore --nologo + - name: Test + run: dotnet test src/${{ env.SLN_FILE_NAME }} -c Release --no-build -l "trx;LogFileName=test-results.trx" --nologo + - uses: actions/upload-artifact@v2 + if: always() + with: + path: ./src/UnitTests/TestResults/test-results.trx + name: test-results + retention-days: 1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d375928 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,42 @@ +name: NuGet Package +on: + push: + branches: + - main # Default release branch + paths: + - 'src/**' + - '.github/workflows/**' +jobs: + deploy: + if: ${{ false }} # disable for now + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + env: + SLN_FILE_NAME: Digitalroot.Valheim.BetterClubs.sln + PROJ: Digitalroot.Valheim.BetterClubs + NUGET_AUTH_TOKEN: ${{secrets.NUGET_PAT}} + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-dotnet@v1.8.1 + with: + #dotnet-version: '3.1.x' # SDK Version to use. + source-url: https://nuget.pkg.github.com/Digitalroot-Valheim/index.json + - name: Check out repository code + uses: actions/checkout@v2 + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - name: Restore packages + run: dotnet restore src/${{ env.SLN_FILE_NAME }} --nologo + - name: Build + run: dotnet build src/${{ env.SLN_FILE_NAME }} -c Release --no-restore --nologo + - name: Test + run: dotnet test src/${{ env.SLN_FILE_NAME }} -c Release --no-build --nologo + - name: Create the package + run: dotnet pack src/${{ env.PROJ }}/${{ env.PROJ }}.csproj -c Release --no-restore --no-build --nologo + - name: Publish package to Digitalroot-Valheim nuget repository + run: dotnet nuget push src/${{ env.PROJ }}/bin/Release/*.nupkg --skip-duplicate diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml new file mode 100644 index 0000000..1fb7c26 --- /dev/null +++ b/.github/workflows/test-report.yml @@ -0,0 +1,21 @@ +name: 'Test Report' +on: + workflow_run: + workflows: ['CI'] # runs after CI workflow + types: + - completed +jobs: + report: + if: ${{ false }} # disable for now + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: test-results # artifact name + name: NUnit Tests # Name of the check run which will be created + path: '*.trx' # Path to test results (inside artifact .zip) + reporter: dotnet-trx # Format of test results + path-replace-backslashes: 'true' + list-suites: 'all' + list-tests: 'failed' + max-annotations: '50' diff --git a/src/Digitalroot.Valheim.BetterClubs.sln b/src/Digitalroot.Valheim.BetterClubs.sln index 4e504ac..759dfab 100644 --- a/src/Digitalroot.Valheim.BetterClubs.sln +++ b/src/Digitalroot.Valheim.BetterClubs.sln @@ -19,7 +19,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{4DB4 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{B5463D38-F4E4-44BB-877A-0465C4B96D87}" ProjectSection(SolutionItems) = preProject + ..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml ..\.github\workflows\drafter.yml = ..\.github\workflows\drafter.yml + ..\.github\workflows\publish.yml = ..\.github\workflows\publish.yml + ..\.github\workflows\test-report.yml = ..\.github\workflows\test-report.yml EndProjectSection EndProject Global diff --git a/src/Digitalroot.Valheim.BetterClubs/Digitalroot.Valheim.BetterClubs.csproj b/src/Digitalroot.Valheim.BetterClubs/Digitalroot.Valheim.BetterClubs.csproj index c104ef2..53cf268 100644 --- a/src/Digitalroot.Valheim.BetterClubs/Digitalroot.Valheim.BetterClubs.csproj +++ b/src/Digitalroot.Valheim.BetterClubs/Digitalroot.Valheim.BetterClubs.csproj @@ -1,6 +1,6 @@  - + @@ -38,8 +38,8 @@ true - - ..\packages\HarmonyX.2.5.2\lib\net45\0Harmony.dll + + ..\packages\HarmonyX.2.5.3\lib\net45\0Harmony.dll False @@ -90,8 +90,8 @@ ..\packages\ILMerge.Fody.1.16.0\lib\net45\ILMerge.dll False - - ..\packages\JotunnLib.2.2.0\lib\net462\Jotunn.dll + + ..\packages\JotunnLib.2.2.1\lib\net462\Jotunn.dll False @@ -404,7 +404,7 @@ - + diff --git a/src/Digitalroot.Valheim.BetterClubs/packages.config b/src/Digitalroot.Valheim.BetterClubs/packages.config index e1368f6..227aa22 100644 --- a/src/Digitalroot.Valheim.BetterClubs/packages.config +++ b/src/Digitalroot.Valheim.BetterClubs/packages.config @@ -3,9 +3,9 @@ - + - +