Skip to content

Commit

Permalink
Add nbgv tool to automate versioning (#35)
Browse files Browse the repository at this point in the history
* Add nbgv tool to automate versioning

* Update CodeQL pipeline to disable shallow clone so nbgv works

* Merge CodeQL into main build

* Merge CodeQL into main build

* Merge CodeQL into main build
  • Loading branch information
MattKotsenas authored May 31, 2024
1 parent 1b968bc commit 5533c6f
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 124 deletions.
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"nbgv": {
"version": "3.6.133",
"commands": [
"nbgv"
],
"rollForward": false
}
}
}
78 changes: 0 additions & 78 deletions .github/workflows/codeql.yml

This file was deleted.

26 changes: 25 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@ name: Main build

on:
workflow_dispatch: # Allow running the workflow manually from the GitHub UI
pull_request:
branches:
- master
push:
branches:
- master
workflow_call: # Allow to be called from the release workflow
schedule:
- cron: '31 15 * * 0' # Run periodically to keep CodeQL database updated

permissions:
security-events: write # required for CodeQL
packages: read
contents: read
actions: read
checks: write

jobs:
build:
Expand All @@ -25,6 +31,19 @@ jobs:
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: csharp
build-mode: manual
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
queries: security-extended

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand Down Expand Up @@ -70,3 +89,8 @@ jobs:
# path: |
# ./artifacts/package
# if-no-files-found: error

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:csharp"
15 changes: 0 additions & 15 deletions .github/workflows/pr.yml

This file was deleted.

1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@

<Import Project="build/targets/artifacts/Artifacts.props" />
<Import Project="build/targets/compiler/Compiler.props" />
<Import Project="build/targets/versioning/Versioning.props" />
<Import Project="build/targets/tests/Tests.props" />
</Project>
1 change: 1 addition & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project>
<Import Project="build/targets/artifacts/Artifacts.targets" />
<Import Project="build/targets/compiler/Compiler.targets" />
<Import Project="build/targets/versioning/Versioning.targets" />
<Import Project="build/targets/tests/Tests.targets" />
</Project>
26 changes: 0 additions & 26 deletions Source/Moq.Analyzers/Diagnostic.nuspec

This file was deleted.

4 changes: 0 additions & 4 deletions Source/Moq.Analyzers/Moq.Analyzers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

<PropertyGroup>
<PackageId>Moq.Analyzers</PackageId>
<PackageVersion>0.0.6</PackageVersion>
<Authors>Andrey "Litee" Lipatkin</Authors>
<PackageLicenseUrl>https://github.com/Litee/moq.analyzers/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/Litee/moq.analyzers</PackageProjectUrl>
Expand All @@ -49,9 +48,6 @@
<PackageTags>moq, mock, test, analyzers</PackageTags>
<NoPackageAnalysis>true</NoPackageAnalysis>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.5</Version>
<AssemblyVersion>0.0.6.0</AssemblyVersion>
<FileVersion>0.0.6.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions build/targets/versioning/Versioning.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<PrivateAssets>all</PrivateAssets>
<Version>3.6.133</Version>
</PackageReference>
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions build/targets/versioning/Versioning.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<Project>
</Project>
13 changes: 13 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.1.0-beta",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
],
"cloudBuild": {
"buildNumber": {
"enabled": true
}
}
}

0 comments on commit 5533c6f

Please sign in to comment.