From 80e746487df98c769b63145f12d5c13ebe5bbc4c Mon Sep 17 00:00:00 2001 From: logosghservice Date: Sat, 16 May 2026 22:42:57 +0000 Subject: [PATCH] Apply convention faithlife-dotnet-library-workflow --- .github/workflows/ci.yml | 87 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c28c02c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,87 @@ +# DO NOT EDIT: generated by Faithlife/CodingGuidelines/conventions/faithlife-dotnet-library-workflow +name: Continuous Integration + +on: + push: + branches: [master] + tags-ignore: ['**'] + pull_request: + workflow_dispatch: + +env: + DOTNET_NOLOGO: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + +defaults: + run: + shell: pwsh + +permissions: + contents: write + id-token: write + +jobs: + build-matrix: + name: Build ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Install .NET + uses: actions/setup-dotnet@v4 + - name: Restore + run: .\build.ps1 restore + - name: Build + run: .\build.ps1 build --skip restore + - name: Test + run: .\build.ps1 test --skip build + - name: Package + run: .\build.ps1 package --skip test + - name: Upload packages + if: matrix.os == 'windows-latest' + uses: actions/upload-artifact@v4 + with: + name: nuget-packages + path: release/*.nupkg + if-no-files-found: error + + build: + name: Build + runs-on: ubuntu-latest + needs: build-matrix + if: ${{ always() }} + steps: + - name: Build failed + if: ${{ needs.build-matrix.result != 'success' }} + run: Write-Host "Build failed."; exit 1 + - name: Build succeeded + if: ${{ needs.build-matrix.result == 'success' }} + run: Write-Host "Build succeeded." + + publish: + name: Publish + runs-on: windows-latest + needs: build + if: github.repository_owner == 'Faithlife' && github.ref == 'refs/heads/master' + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Install .NET + uses: actions/setup-dotnet@v4 + - name: Download packages + uses: actions/download-artifact@v4 + with: + name: nuget-packages + path: release + - name: Log in to NuGet + uses: NuGet/login@v1 + id: nuget-login + with: + user: bgrainger + - name: Publish + env: + NUGET_API_KEY: ${{ steps.nuget-login.outputs.NUGET_API_KEY }} + run: .\build.ps1 publish --skip package --trigger publish-nuget-output