diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..cd4457b --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,53 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: .NET + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal + + - name: Publish NuGet + uses: brandedoutcast/publish-nuget@v2.5.5 + with: + # Filepath of the project to be packaged, relative to root of repository + PROJECT_FILE_PATH: Unfurl.Net/Unfurl.Net.csproj + # NuGet package id, used for version detection & defaults to project name + #PACKAGE_NAME: # optiona + # Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH + #VERSION_FILE_PATH: # optional + # Regex pattern to extract version info in a capturing group + #VERSION_REGEX: # optional, default is ^\s*(.*)<\/Version>\s*$ + # Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX + #VERSION_STATIC: # optional + # Flag to toggle git tagging, enabled by default + #TAG_COMMIT: # optional, default is true + # Format of the git tag, [*] gets replaced with actual version + #TAG_FORMAT: # optional, default is v* + # API key to authenticate with NuGet server + NUGET_KEY: ${{ secrets.NUGETAPIKEY }} + # NuGet server uri hosting the packages, defaults to https://api.nuget.org + #NUGET_SOURCE: # optional, default is https://api.nuget.org + # Flag to toggle pushing symbols along with nuget package to the server, disabled by default + #INCLUDE_SYMBOLS: # optional +