From 1a768263fd9b91f777971bd05691c2b0b4b0fc78 Mon Sep 17 00:00:00 2001 From: Robert Coltheart Date: Wed, 1 Jul 2026 20:28:42 +1000 Subject: [PATCH 01/11] Add trusted publishing to workflows --- .github/workflows/build.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e515667..ac6ea6a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,31 +1,35 @@ -name: build +name: Build on: + pull_request: push: branches: - master - pull_request: env: DOTNET_NOLOGO: true jobs: build: - name: build + name: Build runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v3 - - 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@v4 + uses: actions/setup-dotnet@v5 with: dotnet-version: '3.1.x' + + - name: NuGet login + uses: NuGet/login@v1 + id: login + with: + user: ${{ secrets.NUGET_USER }} + - name: Build run: ./build.ps1 - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - path: artifacts/*.nupkg From 35b6cbb964ef534cbda3981d33ff867e426664d8 Mon Sep 17 00:00:00 2001 From: Robert Coltheart Date: Wed, 1 Jul 2026 20:30:01 +1000 Subject: [PATCH 02/11] fix build --- .github/workflows/merge.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index e06415a..adbc14b 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -4,6 +4,7 @@ on: pull_request permissions: contents: write pull-requests: write + id-token: write jobs: merge: From 15ebc9eafbbcf7e147d5e27f43b408e330602159 Mon Sep 17 00:00:00 2001 From: Robert Coltheart Date: Wed, 1 Jul 2026 20:31:22 +1000 Subject: [PATCH 03/11] fix build --- .github/workflows/build.yml | 5 +++++ .github/workflows/merge.yml | 28 ---------------------------- .github/workflows/publish.yml | 4 ++-- 3 files changed, 7 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/merge.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac6ea6a..160d298 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,11 @@ on: branches: - master +permissions: + contents: write + pull-requests: write + id-token: write + env: DOTNET_NOLOGO: true diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml deleted file mode 100644 index adbc14b..0000000 --- a/.github/workflows/merge.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: merge -on: pull_request - -permissions: - contents: write - pull-requests: write - id-token: write - -jobs: - merge: - runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' }} - steps: - - name: Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@v1 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Enable auto-merge for Dependabot PRs - run: gh pr merge --auto --squash "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Approve a PR - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f024ce7..bc20852 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: publish +name: Publish on: release: @@ -9,7 +9,7 @@ env: jobs: publish: - name: publish + name: Publish runs-on: windows-latest steps: From e12011d958fbd66a6372986313a6d4e1242621b3 Mon Sep 17 00:00:00 2001 From: Robert Coltheart Date: Wed, 1 Jul 2026 20:31:42 +1000 Subject: [PATCH 04/11] test --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 160d298..de3152b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,5 +36,5 @@ jobs: with: user: ${{ secrets.NUGET_USER }} - - name: Build - run: ./build.ps1 + # - name: Build + # run: ./build.ps1 From 8941695a6d1aabc78255cde3a8863182e65aa4f9 Mon Sep 17 00:00:00 2001 From: Robert Coltheart Date: Wed, 1 Jul 2026 20:45:32 +1000 Subject: [PATCH 05/11] Update build and docs --- .config/dotnet-tools.json | 12 --- .editorconfig | Bin 580 -> 271 bytes .gitattributes | 162 +++++++++++++++++++++------------- .github/dependabot.yml | 5 -- .github/workflows/build.yml | 5 ++ .gitignore | 171 ++++++++++++++++++++++++++++++++---- README.md | 7 +- build.ps1 | 4 +- build.sh | 4 +- build/build.cs | 42 ++++----- build/build.csproj | 14 --- 11 files changed, 286 insertions(+), 140 deletions(-) delete mode 100644 .config/dotnet-tools.json delete mode 100644 build/build.csproj diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json deleted file mode 100644 index 95adf14..0000000 --- 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 991f0376f6d8d4a6d3378898d4bdcab301bfc6b5..8d9bfc8c64ec904e5a23ac581f8ca239eee7bce6 100644 GIT binary patch literal 271 zcmYk0v1$WB3`G0=3e~}!NpKb8DskZ=UAhpKb^X$*ZUj(B3x)1M5ho`#9;@nCk)}^;WH2$s>ec{=E!)SiSZY3rDJqW)Wj*CD>>Sd n#y_7pw^8vvbO$%D1>QxvcJ8US3}2(ItgaS&{O*naflc@U{ls4X literal 580 zcma)&y-veG5QL{j;vJ|df`q6*RFHy#jt(Kq!ap%0c9gp)3J(u_vxdYV3Usn>cXnrP zc0b;)bfO0>)F}})+^?#MzVktAvWMmzq!T96FKea{+H?a>6j`%-AAnCoi8smW^C z8LSR8M~B}n!7J`N-D-}LnT~ZNd%KUG(NT|zHJ9{fR0mk*T5-WYYo$w_apn{Ko9Odo zExP8nq3##f)$C@3Ei%>6# z$KDoX8+*_263$C@`Imx~D=OYxLFZw^e(S)Tx}KqxCf=v~PH+2nE`H29vR1K`mw&L& GgZ&A}{$e!% diff --git a/.gitattributes b/.gitattributes index 1ff0c42..8154320 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 a9e30a9..800166b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,11 +5,6 @@ updates: schedule: interval: "daily" - - package-ecosystem: "nuget" - directory: "/build" - schedule: - interval: "weekly" - - package-ecosystem: "nuget" directory: "/.config" schedule: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de3152b..61f42b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,11 @@ jobs: with: dotnet-version: '3.1.x' + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v4 + with: + versionSpec: '6.x' + - name: NuGet login uses: NuGet/login@v1 id: login diff --git a/.gitignore b/.gitignore index e57aa53..0808c4a 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/README.md b/README.md index dc5c118..1e52f4e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ -Machine.Specifications.Runner.VisualStudio -===================== +# Machine.Specifications.Runner.VisualStudio Test Adapter for Machine.Specifications (MSpec) compatible with the .NET Framework and .NET Core: dotnet test, Visual Studio IDE, TFS, Visual Studio Team Services To open an issue, please visit the [core issue tracker](https://github.com/machine/machine.specifications/issues). -# Documentation +## Documentation Simply install the NuGet package and you will automatically be able to use the below to run tests: @@ -14,6 +13,6 @@ Simply install the NuGet package and you will automatically be able to use the b * vstest.console * Visual Studio Online -# Release Notes +## Release Notes Release notes are available here: https://github.com/machine/machine.specifications.runner.visualstudio/releases diff --git a/build.ps1 b/build.ps1 index 0c688fb..74d6aaa 100644 --- a/build.ps1 +++ b/build.ps1 @@ -10,8 +10,8 @@ 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 -} +} \ No newline at end of file diff --git a/build.sh b/build.sh index 48dc148..619074c 100644 --- a/build.sh +++ b/build.sh @@ -3,8 +3,8 @@ 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 -fi +fi \ No newline at end of file diff --git a/build/build.cs b/build/build.cs index cbbadae..bc86d85 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"); }); -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"; +} \ No newline at end of file diff --git a/build/build.csproj b/build/build.csproj deleted file mode 100644 index ddaa255..0000000 --- a/build/build.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - Exe - net8.0 - - - - - - - - - From 1740ea90c582f2a1030b99386d69cf7a86a90449 Mon Sep 17 00:00:00 2001 From: Robert Coltheart Date: Wed, 1 Jul 2026 20:48:21 +1000 Subject: [PATCH 06/11] fix build --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61f42b9..a61cea1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v5 with: - dotnet-version: '3.1.x' + dotnet-version: 3.1.x - name: Install GitVersion uses: gittools/actions/gitversion/setup@v4 From 8765564aaaec416a16d8e831e9932fce2d2d4226 Mon Sep 17 00:00:00 2001 From: Robert Coltheart Date: Wed, 1 Jul 2026 20:58:08 +1000 Subject: [PATCH 07/11] Use gitversion --- .github/workflows/build.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a61cea1..91f1699 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,12 @@ jobs: 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: @@ -33,13 +39,10 @@ jobs: - name: Install GitVersion uses: gittools/actions/gitversion/setup@v4 with: - versionSpec: '6.x' + versionSpec: 6.x - - name: NuGet login - uses: NuGet/login@v1 - id: login - with: - user: ${{ secrets.NUGET_USER }} + - name: Calculate version + uses: gittools/actions/gitversion/execute@v4 # - name: Build # run: ./build.ps1 From 50a1a06919b6e9b2a4775d3e2689c4f59155cd79 Mon Sep 17 00:00:00 2001 From: Robert Coltheart Date: Wed, 1 Jul 2026 21:01:50 +1000 Subject: [PATCH 08/11] final test --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91f1699..54494fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,5 +44,7 @@ jobs: - name: Calculate version uses: gittools/actions/gitversion/execute@v4 - # - name: Build - # run: ./build.ps1 + - name: Build + env: + NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }} + run: ./build.ps1 From f0aec2c3d7f2abe2fa240e7919d8630fe681ded8 Mon Sep 17 00:00:00 2001 From: Robert Coltheart Date: Wed, 1 Jul 2026 21:12:11 +1000 Subject: [PATCH 09/11] update config --- .github/dependabot.yml | 12 +++++------ .github/workflows/build.yml | 12 +---------- .github/workflows/publish.yml | 38 +++++++++++++++++++++++++---------- GitVersion.yml | 4 +--- 4 files changed, 35 insertions(+), 31 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 800166b..1936c3b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,11 @@ version: 2 updates: - - package-ecosystem: "nuget" - directory: "/" + - package-ecosystem: github-actions + directory: / schedule: - interval: "daily" + interval: weekly - - package-ecosystem: "nuget" - directory: "/.config" + - package-ecosystem: nuget + directory: / schedule: - interval: "weekly" + interval: weekly diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54494fb..bce258a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,9 +7,7 @@ on: - master permissions: - contents: write - pull-requests: write - id-token: write + contents: read env: DOTNET_NOLOGO: true @@ -25,12 +23,6 @@ jobs: 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: @@ -45,6 +37,4 @@ jobs: uses: gittools/actions/gitversion/execute@v4 - name: Build - env: - NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }} run: ./build.ps1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bc20852..58ec182 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,28 +4,44 @@ on: release: types: [published] +permissions: + contents: read + id-token: write + env: DOTNET_NOLOGO: true jobs: - publish: + build: name: Publish runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v3 - - 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@v4 + uses: actions/setup-dotnet@v5 with: - dotnet-version: '3.1.x' + 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.ps1 publish - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - path: artifacts/*.nupkg diff --git a/GitVersion.yml b/GitVersion.yml index 3bfcb7a..85a7762 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,3 +1 @@ -mode: ContinuousDelivery -commit-message-incrementing: Disabled -legacy-semver-padding: 0 +workflow: GitHubFlow/v1 From 5c9cf7ae61c0cce783a6724b199edd9cfdf6cdf8 Mon Sep 17 00:00:00 2001 From: Robert Coltheart Date: Wed, 1 Jul 2026 21:25:34 +1000 Subject: [PATCH 10/11] final --- CONTRIBUTING.md | 2 +- build.ps1 | 2 +- build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 43211c0..cfe54e9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,4 +4,4 @@ First of all, thank you for wanting to contribute to Machine.Specifications! We ## Preparation -Before starting work on a new bug, feature, etc. ensure that an [issue](https://github.com/machine/machine.specifications/issues) has been raised. Indicate your intention to work on the issue by writing a comment against it. This will prevent duplication of effort. If the issue is a new feature, it's usually best to propose a design in the issue comments. \ No newline at end of file +Before starting work on a new bug, feature, etc. ensure that an [issue](https://github.com/machine/machine.specifications/issues) has been raised. Indicate your intention to work on the issue by writing a comment against it. This will prevent duplication of effort. If the issue is a new feature, it's usually best to propose a design in the issue comments. diff --git a/build.ps1 b/build.ps1 index 74d6aaa..603c8f4 100644 --- a/build.ps1 +++ b/build.ps1 @@ -14,4 +14,4 @@ try { } finally { Pop-Location -} \ No newline at end of file +} diff --git a/build.sh b/build.sh index 619074c..7e6904a 100644 --- a/build.sh +++ b/build.sh @@ -7,4 +7,4 @@ if which dotnet > /dev/null; then else echo "error(1): Could not find 'dotnet', please install .NET SDK" exit 1 -fi \ No newline at end of file +fi From 3188fa928a91f46b76b62e6b5a6967a0ca3ada4a Mon Sep 17 00:00:00 2001 From: Robert Coltheart Date: Wed, 1 Jul 2026 21:29:20 +1000 Subject: [PATCH 11/11] bump --- build/build.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.cs b/build/build.cs index bc86d85..68016ef 100644 --- a/build/build.cs +++ b/build/build.cs @@ -62,4 +62,4 @@ public class GitVersion public string AssemblySemFileVer { get; } = Environment.GetEnvironmentVariable("GitVersion_AssemblySemFileVer") ?? "0.1.0"; public string InformationalVersion { get; } = Environment.GetEnvironmentVariable("GitVersion_InformationalVersion") ?? "0.1.0"; -} \ No newline at end of file +}