Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
Loading