Skip to content

Update tests

Update tests #266

name: Build-Release-Publish
on:
push:
branches:
- master
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
NUGET_XMLDOC_MODE: skip
WORKFLOW_VERSION_PROJ: Directory.Build.props
WORKFLOW_BUILD_SLN: SourceExpander.sln
jobs:
get-version:
uses: kzrnm/dotnet-actions/.github/workflows/get-version.yml@v2
with:
project-path: Directory.Build.props
format:
uses: kzrnm/dotnet-actions/.github/workflows/format.yml@v2
with:
target: SourceExpander.sln
dotnet-version: |
8.0.x
6.0.x
build:
runs-on: windows-latest
needs: [get-version]
steps:
- uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
6.0.x
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Build.props') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Build
run: dotnet build ${{ env.WORKFLOW_BUILD_SLN }} -c Release
- name: Test
run: dotnet test ${{ env.WORKFLOW_BUILD_SLN }} --no-build --logger GitHubActions -c Release
- uses: actions/upload-artifact@v4
if: ${{ needs.get-version.outputs.is-new == 'true' }}
with:
name: dist
path: bin/Packages/Release
publish:
needs: [get-version, build, format]
if: ${{ needs.get-version.outputs.is-new == 'true' }}
uses: kzrnm/dotnet-actions/.github/workflows/publish.yml@v2
with:
artifact-name: dist
version: ${{ needs.get-version.outputs.version }}
is-prerelease: ${{ needs.get-version.outputs.is-prerelease == 'true' }}
secrets:
NUGET_KEY: ${{ secrets.NUGET_KEY }}