Update to anvil 8193.37.2. #208
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: Continuous Integration | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**.md' | |
| pull_request: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**.md' | |
| jobs: | |
| compile: | |
| runs-on: ubuntu-latest | |
| if: "!contains(github.event.head_commit.message, 'skip ci')" | |
| permissions: | |
| security-events: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| global-json-file: global.json | |
| - name: Build | |
| run: dotnet build --configuration Debug | |
| - name: Code Analysis | |
| uses: JetBrains/ReSharper-InspectCode@v0.8 | |
| with: | |
| solution: ./NWN.Toolbox.sln | |
| tool-version: 2024.3.0 | |
| test: | |
| runs-on: ubuntu-latest | |
| if: "!contains(github.event.head_commit.message, 'skip ci')" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Create Output Directories | |
| run: | | |
| mkdir -p test_results | |
| - name: Build and Run Tests | |
| uses: devcontainers/ci@v0.3 | |
| with: | |
| push: never | |
| env: | | |
| ANVIL_ADD_PLUGIN_PATHS=/workspaces/NWN.Toolbox/NWN.Toolbox/bin/Release:/workspaces/NWN.Toolbox/NWN.Toolbox.Tests/bin/Release | |
| runCmd: | | |
| dotnet build --configuration Release | |
| cd /nwn/data/bin/linux-amd64 | |
| /nwn/run-server.sh | |
| - name: Upload Event File | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: Event File | |
| path: ${{ github.event_path }} | |
| - name: Upload Results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: Test Results | |
| path: test_results/NWN.Toolbox.Tests/*.xml | |
| build: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| needs: [compile, test] | |
| outputs: | |
| version: ${{ steps.vars.outputs.VERSION }} | |
| tag: ${{ steps.vars.outputs.TAG }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| global-json-file: global.json | |
| - name: Version and Tag | |
| id: bump_version | |
| uses: anothrNick/github-tag-action@1.71.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| DEFAULT_BUMP: patch | |
| RELEASE_BRANCHES: main | |
| WITH_V: true | |
| PRERELEASE_SUFFIX: alpha | |
| PRERELEASE: ${{ github.ref != 'main' }} | |
| TAG_CONTEXT: branch | |
| - name: Prepare Outputs | |
| id: vars | |
| run: | | |
| echo "VERSION=$(echo ${{ steps.bump_version.outputs.tag }} | sed 's/[v]//g')" >> "$GITHUB_OUTPUT" | |
| echo "TAG=$(echo ${{ steps.bump_version.outputs.tag }})" >> "$GITHUB_OUTPUT" | |
| - name: Build Release Binaries | |
| id: build | |
| run: dotnet build NWN.Toolbox/NWN.Toolbox.csproj --configuration Release -p:Version=${{ steps.vars.outputs.VERSION }} | |
| - name: Upload Build Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Binaries | |
| path: NWN.Toolbox/bin/Release | |
| if-no-files-found: error | |
| release: | |
| runs-on: ubuntu-latest | |
| if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' | |
| needs: build | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download Release Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Binaries | |
| path: binaries | |
| - name: Zip Binaries | |
| run: zip -r ../NWN.Toolbox.zip ./* | |
| working-directory: binaries | |
| - name: Upload Release Binaries | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create ${{ needs.build.outputs.tag }} --title "Release ${{ needs.build.outputs.version }}" --generate-notes | |
| gh release upload ${{ needs.build.outputs.tag }} NWN.Toolbox.zip | |
| nuget: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| needs: build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| global-json-file: global.json | |
| - name: Download Release Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Binaries | |
| path: bin/Release | |
| - name: NuGet Publish | |
| run: dotnet nuget push bin/Release/NWN.Toolbox/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json | |
| - name: GitHub Publish | |
| run: dotnet nuget push bin/Release/NWN.Toolbox/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/jhett12321/index.json |