Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "nuget" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
203 changes: 101 additions & 102 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
@@ -1,102 +1,101 @@
name: Continuous

on:
# PRs will be built, and a package posted to GH Packages
pull_request:

push:
paths-ignore:
- 'README.md'
- 'docs/**'

# We'll build, pack, and push a pre-release to NuGet on master
branches: [ master ]

# Tagging with v* will build that version number and push a release to Nuget
# e.g. v1.2, v3.4.5, etc.
tags:
- 'v*'

defaults:
run:
shell: pwsh

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.202

# Run unit tests
- name: Test
run: dotnet test --configuration Release --verbosity normal

# Package Release
- name: Pack
run: |
<# If we're a tag, force VersionPrefix to the tag value #>
if ('${{ github.ref }}' -match '^refs/tags/v') {
$match = [regex]::Match('${{ github.ref }}', '^refs/tags/v([0-9]+(\.[0-9]+){1,2})')
if ($match.Success) {
$env:VersionPrefix = $match.Groups[1].Value
} else {
throw 'Invalid tag version: ${{ github.ref }}'
}
}
else {
<# All other pushes get a CI suffix #>
$env:VersionSuffix = 'ci{0:0000}' -f ${{ github.run_number }}
}

dotnet pack --configuration Release --verbosity normal --output .

- name: Upload NuGet
uses: actions/upload-artifact@v3
with:
name: NuGet
if-no-files-found: error
path: |
**/*.nupkg
**/*.snupkg

# Update the docs
- name: Update Docs
if: github.event_name == 'push'
run: |
dotnet tool install xmldocmd
dotnet tool run xmldocmd .\Moq.AutoMock\bin\Release\net461\Moq.AutoMock.dll .\docs

$modified = $(git status -u --porcelain)
if ($modified.Where({$_.Contains(" docs/")}, 'First').Count -lt 1) {
return 0
}

# Create docs pull request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
if: github.event_name == 'push'
with:
commit-message: |
[Docs update detected by Github Action].
Auto generated pull request.
branch: docs/automated-update
delete-branch: true
base: master
title: Update Docs [GitHub Action]
body: |
[Docs update detected by Github Action].
Auto generated pull request.

# Publish to NuGet and GitHub Packages
- name: Publish
if: github.event_name == 'push'
run: |
dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }} --skip-duplicate
dotnet nuget push *.nupkg `
--source 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' `
--api-key '${{ github.token }}' `
--skip-duplicate
name: Continuous

on:
# PRs will be built, and a package posted to GH Packages
pull_request:

push:
paths-ignore:
- 'README.md'
- 'docs/**'

# We'll build, pack, and push a pre-release to NuGet on master
branches: [ master ]

# Tagging with v* will build that version number and push a release to Nuget
# e.g. v1.2, v3.4.5, etc.
tags:
- 'v*'

defaults:
run:
shell: pwsh

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v1

# Run unit tests
- name: Test
run: dotnet test --configuration Release --verbosity normal

# Package Release
- name: Pack
run: |
<# If we're a tag, force VersionPrefix to the tag value #>
if ('${{ github.ref }}' -match '^refs/tags/v') {
$match = [regex]::Match('${{ github.ref }}', '^refs/tags/v([0-9]+(\.[0-9]+){1,2})')
if ($match.Success) {
$env:VersionPrefix = $match.Groups[1].Value
} else {
throw 'Invalid tag version: ${{ github.ref }}'
}
}
else {
<# All other pushes get a CI suffix #>
$env:VersionSuffix = 'ci{0:0000}' -f ${{ github.run_number }}
}

dotnet pack --configuration Release --verbosity normal --output .

- name: Upload NuGet
uses: actions/upload-artifact@v3
with:
name: NuGet
if-no-files-found: error
path: |
**/*.nupkg
**/*.snupkg

# Update the docs
- name: Update Docs
if: github.event_name == 'push'
run: |
dotnet tool install xmldocmd
dotnet tool run xmldocmd .\Moq.AutoMock\bin\Release\net461\Moq.AutoMock.dll .\docs

$modified = $(git status -u --porcelain)
if ($modified.Where({$_.Contains(" docs/")}, 'First').Count -lt 1) {
return 0
}

# Create docs pull request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
if: github.event_name == 'push'
with:
commit-message: |
[Docs update detected by Github Action].
Auto generated pull request.
branch: docs/automated-update
delete-branch: true
base: master
title: Update Docs [GitHub Action]
body: |
[Docs update detected by Github Action].
Auto generated pull request.

# Publish to NuGet and GitHub Packages
- name: Publish
if: github.event_name == 'push'
run: |
dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }} --skip-duplicate
dotnet nuget push *.nupkg `
--source 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' `
--api-key '${{ github.token }}' `
--skip-duplicate
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.9" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.9" />
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Moq.AutoMocker.TestGenerator\Moq.AutoMocker.TestGenerator.csproj">
<OutputItemType>Analyzer</OutputItemType>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>

<ProjectReference Include="..\Moq.AutoMocker.Generator.Example\Moq.AutoMock.Generator.Example.csproj" />
<ProjectReference Include="..\..\Moq.AutoMock\Moq.AutoMock.csproj" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Moq.AutoMocker.TestGenerator\Moq.AutoMocker.TestGenerator.csproj">
<OutputItemType>Analyzer</OutputItemType>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\Moq.AutoMocker.Generator.Example\Moq.AutoMock.Generator.Example.csproj" />
<ProjectReference Include="..\..\Moq.AutoMock\Moq.AutoMock.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Moq.AutoMocker.TestGenerator\Moq.AutoMocker.TestGenerator.csproj">
<OutputItemType>Analyzer</OutputItemType>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\Moq.AutoMocker.Generator.Example\Moq.AutoMock.Generator.Example.csproj" />
<ProjectReference Include="..\..\Moq.AutoMock\Moq.AutoMock.csproj" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Moq.AutoMocker.TestGenerator\Moq.AutoMocker.TestGenerator.csproj">
<OutputItemType>Analyzer</OutputItemType>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\Moq.AutoMocker.Generator.Example\Moq.AutoMock.Generator.Example.csproj" />
<ProjectReference Include="..\..\Moq.AutoMock\Moq.AutoMock.csproj" />
</ItemGroup>
</Project>
Loading