Skip to content

Merge pull request #9 from ahanoff/feat/net8 #46

Merge pull request #9 from ahanoff/feat/net8

Merge pull request #9 from ahanoff/feat/net8 #46

Workflow file for this run

name: ci/cd
on:
push:
paths:
- 'src/**'
- '*.sln'
- '*.props'
- '**/*.yml'
- '!**/*.md'
pull_request: {}
env:
VERSION_FILE_PATH: src/Directory.Build.props
NUGET_KEY: ${{ secrets.NUGET_KEY }}
TAG_COMMIT: false
jobs:
test_and_publish_if_allowed:
name: test and publish if allowed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.x"
- name: Run tests
run: dotnet test src/ --collect:"XPlat Code Coverage"
- name: Publish code coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: integration
files: src/AutoGuru.HotChocolate.PolymorphicIds.Tests/TestResults/*/coverage.cobertura.xml
- name: Publish to NuGet on version change
if: ${{ endsWith(github.ref, 'main') }}
id: publish_nuget
uses: rohith/[email protected]
with:
PROJECT_FILE_PATH: src/AutoGuru.HotChocolate.PolymorphicIds/AutoGuru.HotChocolate.PolymorphicIds.csproj
TAG_COMMIT: true
- name: Create Release
if: ${{ success() && steps.publish_nuget.outputs.VERSION }}
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.publish_nuget.outputs.VERSION }}
release_name: ${{ steps.publish_nuget.outputs.VERSION }}
draft: false
prerelease: ${{ contains(steps.publish_nuget.outputs.VERSION, 'preview') || contains(steps.publish_nuget.outputs.VERSION, 'rc') }}