diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
deleted file mode 100644
index 95adf146..00000000
--- a/.config/dotnet-tools.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "version": 1,
- "isRoot": true,
- "tools": {
- "gitversion.tool": {
- "version": "5.12.0",
- "commands": [
- "dotnet-gitversion"
- ]
- }
- }
-}
\ No newline at end of file
diff --git a/.editorconfig b/.editorconfig
index a52eb655..8d9bfc8c 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -7,9 +7,7 @@ root = true
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
+indent_size = 2
-[*.cs]
+[*.{cs,sh,ps1}]
indent_size = 4
-
-[*.csproj]
-indent_size = 2
diff --git a/.gitattributes b/.gitattributes
index 1ff0c423..81543208 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,63 +1,107 @@
-###############################################################################
-# Set default behavior to automatically normalize line endings.
-###############################################################################
+## Set Git attributes for paths including line ending
+## normalization, diff behavior, etc.
+##
+## Get latest from `dotnet new gitattributes`
+
+# Auto detect text files and perform LF normalization
* text=auto
-###############################################################################
-# Set default behavior for command prompt diff.
-#
-# This is need for earlier builds of msysgit that does not have it on by
-# default for csharp files.
-# Note: This is only used by command line
-###############################################################################
-#*.cs diff=csharp
-
-###############################################################################
-# Set the merge driver for project and solution files
#
-# Merging from the command prompt will add diff markers to the files if there
-# are conflicts (Merging from VS is not affected by the settings below, in VS
-# the diff markers are never inserted). Diff markers may cause the following
-# file extensions to fail to load in VS. An alternative would be to treat
-# these files as binary and thus will always conflict and require user
-# intervention with every merge. To do so, just uncomment the entries below
-###############################################################################
-#*.sln merge=binary
-#*.csproj merge=binary
-#*.vbproj merge=binary
-#*.vcxproj merge=binary
-#*.vcproj merge=binary
-#*.dbproj merge=binary
-#*.fsproj merge=binary
-#*.lsproj merge=binary
-#*.wixproj merge=binary
-#*.modelproj merge=binary
-#*.sqlproj merge=binary
-#*.wwaproj merge=binary
-
-###############################################################################
-# behavior for image files
+# The above will handle all files NOT found below
#
-# image files are treated as binary by default.
-###############################################################################
-#*.jpg binary
-#*.png binary
-#*.gif binary
-
-###############################################################################
-# diff behavior for common document formats
-#
-# Convert binary document formats to text before diffing them. This feature
-# is only available from the command line. Turn it on by uncommenting the
-# entries below.
-###############################################################################
-#*.doc diff=astextplain
-#*.DOC diff=astextplain
-#*.docx diff=astextplain
-#*.DOCX diff=astextplain
-#*.dot diff=astextplain
-#*.DOT diff=astextplain
-#*.pdf diff=astextplain
-#*.PDF diff=astextplain
-#*.rtf diff=astextplain
-#*.RTF diff=astextplain
+
+*.cs text diff=csharp
+*.cshtml text diff=html
+*.csx text diff=csharp
+*.sln text eol=crlf
+
+# Content below from: https://github.com/gitattributes/gitattributes/blob/master/Common.gitattributes
+
+# Documents
+*.bibtex text diff=bibtex
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
+*.md text diff=markdown
+*.mdx text diff=markdown
+*.tex text diff=tex
+*.adoc text
+*.textile text
+*.mustache text
+# Per RFC 4180, .csv should be CRLF
+*.csv text eol=crlf
+*.tab text
+*.tsv text
+*.txt text
+*.sql text
+*.epub diff=astextplain
+
+# Graphics
+*.png binary
+*.jpg binary
+*.jpeg binary
+*.gif binary
+*.tif binary
+*.tiff binary
+*.ico binary
+# SVG treated as text by default.
+*.svg text
+# If you want to treat it as binary,
+# use the following line instead.
+# *.svg binary
+*.eps binary
+
+# Scripts
+# Force Unix scripts to always use lf line endings so that if a repo is accessed
+# in Unix via a file share from Windows, the scripts will work
+*.bash text eol=lf
+*.fish text eol=lf
+*.ksh text eol=lf
+*.sh text eol=lf
+*.zsh text eol=lf
+# Likewise, force cmd and batch scripts to always use crlf
+*.bat text eol=crlf
+*.cmd text eol=crlf
+
+# Serialization
+*.json text
+*.toml text
+*.xml text
+*.yaml text
+*.yml text
+
+# Archives
+*.7z binary
+*.bz binary
+*.bz2 binary
+*.bzip2 binary
+*.gz binary
+*.lz binary
+*.lzma binary
+*.rar binary
+*.tar binary
+*.taz binary
+*.tbz binary
+*.tbz2 binary
+*.tgz binary
+*.tlz binary
+*.txz binary
+*.xz binary
+*.Z binary
+*.zip binary
+*.zst binary
+
+# Text files where line endings should be preserved
+*.patch -text
+
+# Exclude files from exporting
+.gitattributes export-ignore
+.gitignore export-ignore
+.gitkeep export-ignore
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index a9e30a94..1936c3bb 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,16 +1,11 @@
version: 2
updates:
- - package-ecosystem: "nuget"
- directory: "/"
+ - package-ecosystem: github-actions
+ directory: /
schedule:
- interval: "daily"
+ interval: weekly
- - package-ecosystem: "nuget"
- directory: "/build"
+ - package-ecosystem: nuget
+ directory: /
schedule:
- interval: "weekly"
-
- - package-ecosystem: "nuget"
- directory: "/.config"
- schedule:
- interval: "weekly"
+ interval: weekly
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 31aa4108..5996f658 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,27 +1,40 @@
-name: build
+name: Build
on:
+ pull_request:
push:
branches:
- master
- pull_request:
+
+permissions:
+ contents: read
env:
DOTNET_NOLOGO: true
jobs:
build:
- name: build
+ name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
- uses: actions/checkout@v4
- - name: Fetch all tags and branches
- run: git fetch --prune --unshallow
+ uses: actions/checkout@v7
+ with:
+ fetch-depth: 0
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v5
+ with:
+ dotnet-version: 3.1.x
+
+ - name: Install GitVersion
+ uses: gittools/actions/gitversion/setup@v4
+ with:
+ versionSpec: 6.x
+
+ - name: Calculate version
+ uses: gittools/actions/gitversion/execute@v4
+
- name: Build
run: ./build.sh
- - name: Upload artifacts
- uses: actions/upload-artifact@v4
- with:
- path: artifacts/*.nupkg
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 08301029..c6412fb7 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -1,27 +1,48 @@
-name: publish
+name: Publish
on:
release:
- types: [published]
+ types:
+ - published
+
+permissions:
+ contents: read
+ id-token: write
env:
DOTNET_NOLOGO: true
jobs:
- publish:
- name: publish
+ build:
+ name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
- uses: actions/checkout@v4
- - name: Fetch all tags and branches
- run: git fetch --prune --unshallow
+ uses: actions/checkout@v7
+ with:
+ fetch-depth: 0
+
+ - name: NuGet login
+ uses: NuGet/login@v1
+ id: login
+ with:
+ user: ${{ secrets.NUGET_USER }}
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v5
+ with:
+ dotnet-version: 3.1.x
+
+ - name: Install GitVersion
+ uses: gittools/actions/gitversion/setup@v4
+ with:
+ versionSpec: 6.x
+
+ - name: Calculate version
+ uses: gittools/actions/gitversion/execute@v4
+
- name: Deploy
env:
- NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
+ NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}
run: ./build.sh publish
- - name: Upload artifacts
- uses: actions/upload-artifact@v4
- with:
- path: artifacts/*.nupkg
diff --git a/.gitignore b/.gitignore
index e57aa53b..0808c4ad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,10 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
-## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+## Get latest from `dotnet new gitignore`
+
+# dotenv files
+.env
# User-specific files
*.rsuser
@@ -13,6 +16,9 @@
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
+# Mono auto generated files
+mono_crash.*
+
# Build results
[Dd]ebug/
[Dd]ebugPublic/
@@ -20,12 +26,14 @@
[Rr]eleases/
x64/
x86/
+[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
+[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
@@ -39,9 +47,10 @@ Generated\ Files/
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
-# NUNIT
+# NUnit
*.VisualState.xml
TestResult.xml
+nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
@@ -51,11 +60,17 @@ dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
-# .NET Core
+# .NET
project.lock.json
project.fragment.lock.json
artifacts/
+# Tye
+.tye/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
# StyleCop
StyleCopReport.xml
@@ -73,6 +88,8 @@ StyleCopReport.xml
*.pgc
*.pgd
*.rsp
+# but not Directory.Build.rsp, as it configures directory-level build defaults
+!Directory.Build.rsp
*.sbr
*.tlb
*.tli
@@ -81,6 +98,7 @@ StyleCopReport.xml
*.tmp_proj
*_wpftmp.csproj
*.log
+*.tlog
*.vspscc
*.vssscc
.builds
@@ -122,9 +140,6 @@ _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
-# JustCode is a .NET coding add-in
-.JustCode
-
# TeamCity is a build add-in
_TeamCity*
@@ -135,6 +150,11 @@ _TeamCity*
.axoCover/*
!.axoCover/settings.json
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
# Visual Studio code coverage results
*.coverage
*.coveragexml
@@ -182,6 +202,8 @@ PublishScripts/
# NuGet Packages
*.nupkg
+# NuGet Symbol Packages
+*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
@@ -206,6 +228,8 @@ BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
+*.appxbundle
+*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
@@ -231,8 +255,6 @@ orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
-# ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true
-**/wwwroot/lib/
# RIA/Silverlight projects
Generated_Code/
@@ -257,6 +279,9 @@ ServiceFabricBackup/
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
@@ -277,6 +302,17 @@ node_modules/
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
+# Visual Studio 6 auto-generated project file (contains which files were open etc.)
+*.vbp
+
+# Visual Studio 6 workspace and project file (working project files containing files to include in project)
+*.dsw
+*.dsp
+
+# Visual Studio 6 technical files
+*.ncb
+*.aps
+
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
@@ -292,10 +328,6 @@ paket-files/
# FAKE - F# Make
.fake/
-# JetBrains Rider
-.idea/
-*.sln.iml
-
# CodeRush personal settings
.cr/personal
@@ -304,8 +336,8 @@ __pycache__/
*.pyc
# Cake - Uncomment if you are using it
-tools/**
-!tools/packages.config
+# tools/**
+# !tools/packages.config
# Tabs Studio
*.tss
@@ -337,5 +369,114 @@ ASALocalRun/
# Local History for Visual Studio
.localhistory/
-# BeatPulse healthcheck temp database
+# Visual Studio History (VSHistory) files
+.vshistory/
+
+# BeatPulse healthcheck temp database
healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
+
+# VS Code files for those working on multiple tools
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+*.code-workspace
+
+# Local History for Visual Studio Code
+.history/
+
+# Windows Installer files from build outputs
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# JetBrains Rider
+*.sln.iml
+.idea/
+
+##
+## Visual studio for Mac
+##
+
+
+# globs
+Makefile.in
+*.userprefs
+*.usertasks
+config.make
+config.status
+aclocal.m4
+install-sh
+autom4te.cache/
+*.tar.gz
+tarballs/
+test-results/
+
+# content below from: https://github.com/github/gitignore/blob/main/Global/macOS.gitignore
+# General
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon
+
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+# content below from: https://github.com/github/gitignore/blob/main/Global/Windows.gitignore
+# Windows thumbnail cache files
+Thumbs.db
+ehthumbs.db
+ehthumbs_vista.db
+
+# Dump file
+*.stackdump
+
+# Folder config file
+[Dd]esktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# Windows shortcuts
+*.lnk
+
+# Vim temporary swap files
+*.swp
diff --git a/GitVersion.yml b/GitVersion.yml
index 3bfcb7ae..25cd24ae 100644
--- a/GitVersion.yml
+++ b/GitVersion.yml
@@ -1,3 +1,5 @@
-mode: ContinuousDelivery
-commit-message-incrementing: Disabled
-legacy-semver-padding: 0
+workflow: GitHubFlow/v1
+label:
+branches:
+ main:
+ label:
diff --git a/Machine.snk b/Machine.snk
deleted file mode 100644
index 8782c6b0..00000000
Binary files a/Machine.snk and /dev/null differ
diff --git a/README.md b/README.md
index cfa64ef9..6446aaa3 100644
--- a/README.md
+++ b/README.md
@@ -2,10 +2,10 @@
[](https://github.com/machine/machine.specifications/wiki) [](https://www.nuget.org/packages/Machine.Specifications) [](https://github.com/machine/machine.specifications/discussions) [](https://github.com/machine/machine.specifications/blob/master/LICENSE)
-
+
MSpec is called a "context/specification" test framework because of the "grammar" that is used in describing and coding the
-tests or "specs". The grammar reads roughly like this
+tests or "specs". The grammar reads roughly like this:
> When the system is in such a state, and a certain action occurs, it should do such-and-such or be in some end state.
@@ -22,7 +22,7 @@ class When_authenticating_an_admin_user
static SecurityService subject;
static UserToken user_token;
- Establish context = () =>
+ Establish context = () =>
subject = new SecurityService();
Because of = () =>
@@ -67,20 +67,3 @@ A PluralSight course by [@kevinkuebler](https://github.com/kevinkuebler) is avai
## Get in touch
Discuss with us on [Discussions](https://github.com/machine/machine.specifications/discussions), or raise an [issue](https://github.com/machine/machine.specifications/issues).
-
-[](https://github.com/machine/machine.specifications/discussions)
-
-## Packages
-
-Project | Build | NuGet
--- | -- | --
-`Machine.Specifications` | [](https://github.com/machine/machine.specifications/actions?query=workflow:build) | [](https://www.nuget.org/packages/machine.specifications)
-`Machine.Specifications.Reporting` | [](https://github.com/machine/machine.specifications/actions?query=workflow:build) | [](https://www.nuget.org/packages/machine.specifications.reporting)
-`Machine.Specifications.Runner.Console` | [](https://github.com/machine/machine.specifications/actions?query=workflow:build) | [](https://www.nuget.org/packages/machine.specifications.runner.console)
-`Machine.Specifications.Runner.ReSharper` | [](https://github.com/machine/machine.specifications.runner.resharper/actions?query=workflow:build) | [](https://plugins.jetbrains.com/plugin/11639-machine-specifications-for-resharper)
-`Machine.Specifications.Runner.Rider` | [](https://github.com/machine/machine.specifications.runner.resharper/actions?query=workflow:build) | [](https://plugins.jetbrains.com/plugin/11528-machine-specifications-for-rider)
-`Machine.Specifications.Runner.TDNet` | [](https://github.com/machine/machine.specifications/actions?query=workflow:build) | [](https://www.nuget.org/packages/machine.specifications.runner.tdnet)
-`Machine.Specifications.Runner.Utility` | [](https://github.com/machine/machine.specifications/actions?query=workflow:build) | [](https://www.nuget.org/packages/machine.specifications.runner.utility)
-`Machine.Specifications.Runner.VisualStudio` | [](https://github.com/machine/machine.specifications.runner.visualstudio/actions?query=workflow:build) | [](https://www.nuget.org/packages/machine.specifications.runner.visualstudio)
-`Machine.Specifications.Should` | [](https://github.com/machine/machine.specifications/actions?query=workflow:build) | [](https://www.nuget.org/packages/machine.specifications.should)
-`Machine.Fakes` | [](https://github.com/machine/machine.specifications.fakes/actions?query=workflow:build) | [](https://www.nuget.org/packages/machine.fakes)
diff --git a/build.ps1 b/build.ps1
index 0c688fb6..603c8f43 100644
--- a/build.ps1
+++ b/build.ps1
@@ -10,7 +10,7 @@ if ($null -eq (Get-Command "dotnet" -ErrorAction Ignore)) {
Push-Location (Split-Path $MyInvocation.MyCommand.Definition)
try {
- & dotnet run --project build --no-launch-profile -- $args
+ & dotnet run ./build/build.cs -- $args
}
finally {
Pop-Location
diff --git a/build.sh b/build.sh
index 48dc1487..7e6904a8 100755
--- a/build.sh
+++ b/build.sh
@@ -3,7 +3,7 @@
set -euo pipefail
if which dotnet > /dev/null; then
- dotnet run --project build --no-launch-profile -- "$@"
+ dotnet run ./build/build.cs -- "$@"
else
echo "error(1): Could not find 'dotnet', please install .NET SDK"
exit 1
diff --git a/build/build.cs b/build/build.cs
index 7300797a..2c6b19f3 100644
--- a/build/build.cs
+++ b/build/build.cs
@@ -1,11 +1,10 @@
-using System;
-using System.IO;
-using System.Text.Json;
-using System.Threading.Tasks;
+#:package Bullseye@6.1.0
+#:package SimpleExec@13.0.0
+
using static Bullseye.Targets;
using static SimpleExec.Command;
-var version = await GetGitVersion();
+var version = new GitVersion();
Target("clean", () =>
{
@@ -17,12 +16,12 @@
}
});
-Target("restore", DependsOn("clean"), () =>
+Target("restore", dependsOn: ["clean"], () =>
{
Run("dotnet", "restore");
});
-Target("build", DependsOn("restore"), () =>
+Target("build", dependsOn: ["restore"], () =>
{
Run("dotnet", "build " +
"--no-restore " +
@@ -33,45 +32,34 @@
$"--property InformationalVersion={version.InformationalVersion}");
});
-Target("test", DependsOn("build"), () =>
+Target("test", dependsOn: ["build"], () =>
{
Run("dotnet", "test --configuration Release --no-restore --no-build");
});
-Target("package", DependsOn("build", "test"), () =>
+Target("package", dependsOn: ["build", "test"], () =>
{
Run("dotnet", $"pack --configuration Release --no-restore --no-build --output artifacts --property Version={version.SemVer}");
});
-Target("publish", DependsOn("package"), () =>
+Target("publish", dependsOn: ["package"], () =>
{
var apiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY");
- //Run("dotnet", $"nuget push {Path.Combine("artifacts", "*.nupkg")} --api-key {apiKey} --source https://api.nuget.org/v3/index.json");
+ Run("dotnet", $"nuget push {Path.Combine("artifacts", "*.nupkg")} --api-key {apiKey} --source https://api.nuget.org/v3/index.json");
});
-Target("default", DependsOn("package"));
+Target("default", dependsOn: ["package"]);
await RunTargetsAndExitAsync(args);
-async Task GetGitVersion()
-{
- Run("dotnet", "tool restore");
-
- var (value, _) = await ReadAsync("dotnet", "dotnet-gitversion");
-
- return JsonSerializer.Deserialize(value);
-}
-
public class GitVersion
{
- public string SemVer { get; set; }
-
- public string AssemblySemVer { get; set; }
+ public string SemVer { get; } = Environment.GetEnvironmentVariable("GitVersion_SemVer") ?? "0.1.0";
- public string AssemblySemFileVer { get; set; }
+ public string AssemblySemVer { get; } = Environment.GetEnvironmentVariable("GitVersion_AssemblySemVer") ?? "0.1.0";
- public string InformationalVersion { get; set; }
+ public string AssemblySemFileVer { get; } = Environment.GetEnvironmentVariable("GitVersion_AssemblySemFileVer") ?? "0.1.0";
- public string PreReleaseTag { get; set; }
+ public string InformationalVersion { get; } = Environment.GetEnvironmentVariable("GitVersion_InformationalVersion") ?? "0.1.0";
}
diff --git a/build/build.csproj b/build/build.csproj
deleted file mode 100644
index c513cdae..00000000
--- a/build/build.csproj
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- Exe
- net8.0
-
-
-
-
-
-
-
-
-