diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index f7e1e9e..982cbc9 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -27,7 +27,7 @@ ] }, "demaconsulting.reqstream": { - "version": "1.1.0", + "version": "1.2.0", "commands": [ "reqstream" ] @@ -43,6 +43,12 @@ "commands": [ "buildmark" ] + }, + "demaconsulting.versionmark": { + "version": "0.1.0", + "commands": [ + "versionmark" + ] } } } \ No newline at end of file diff --git a/.cspell.json b/.cspell.json index b78a23a..b0415f7 100644 --- a/.cspell.json +++ b/.cspell.json @@ -4,6 +4,8 @@ "words": [ "Anson", "Blockquotes", + "buildmark", + "BuildMark", "buildnotes", "camelcase", "CodeQL", @@ -66,6 +68,8 @@ "trx", "vbproj", "vcxproj", + "versionmark", + "VersionMark", "Weasyprint", "weasyprinttool", "yamllint" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index eccc2f2..52b26ff 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,6 +20,27 @@ jobs: - name: Checkout uses: actions/checkout@v6 + - name: Setup dotnet + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 10.x + + - name: Restore Tools + run: dotnet tool restore + + - name: Capture tool versions + shell: bash + run: | + echo "Capturing tool versions..." + dotnet versionmark --capture --job-id "quality" -- dotnet git versionmark + echo "✓ Tool versions captured" + + - name: Upload version capture + uses: actions/upload-artifact@v6 + with: + name: version-capture-quality + path: versionmark-quality.json + - name: Run markdown linter uses: DavidAnson/markdownlint-cli2-action@v22 with: @@ -118,6 +139,23 @@ jobs: --no-restore --property:PackageVersion=${{ inputs.version }} + - name: Capture tool versions + shell: bash + run: | + echo "Capturing tool versions..." + # Create short job ID: build-win, build-ubuntu + OS_SHORT=$(echo "${{ matrix.os }}" | sed 's/windows-latest/win/;s/ubuntu-latest/ubuntu/') + JOB_ID="build-${OS_SHORT}" + dotnet versionmark --capture --job-id "${JOB_ID}" -- \ + dotnet git dotnet-sonarscanner versionmark + echo "✓ Tool versions captured" + + - name: Upload version capture + uses: actions/upload-artifact@v6 + with: + name: version-capture-${{ matrix.os }} + path: versionmark-build-*.json + - name: Upload Test Results uses: actions/upload-artifact@v6 with: @@ -201,6 +239,13 @@ jobs: dotnet-version: ['8.x', '9.x', '10.x'] steps: + - name: Checkout + uses: actions/checkout@v6 + with: + sparse-checkout: | + .versionmark.yaml + .config/dotnet-tools.json + - name: Download package uses: actions/download-artifact@v7 with: @@ -212,6 +257,10 @@ jobs: with: dotnet-version: ${{ matrix.dotnet-version }} + - name: Restore Tools + run: > + dotnet tool restore + - name: Install tool from package shell: bash run: | @@ -269,6 +318,23 @@ jobs: || { echo "✗ Self-validation failed"; exit 1; } echo "✓ Self-validation succeeded" + - name: Capture tool versions + shell: bash + run: | + echo "Capturing tool versions..." + # Create short job ID: int-win-8, int-win-9, int-ubuntu-8, etc. + OS_SHORT=$(echo "${{ matrix.os }}" | sed 's/windows-latest/win/;s/ubuntu-latest/ubuntu/') + DOTNET_SHORT=$(echo "${{ matrix.dotnet-version }}" | sed 's/\.x$//') + JOB_ID="int-${OS_SHORT}-${DOTNET_SHORT}" + dotnet versionmark --capture --job-id "${JOB_ID}" -- dotnet git versionmark + echo "✓ Tool versions captured" + + - name: Upload version capture + uses: actions/upload-artifact@v6 + with: + name: version-capture-${{ matrix.os }}-dotnet${{ matrix.dotnet-version }} + path: versionmark-int-*.json + - name: Upload integration test results if: always() uses: actions/upload-artifact@v6 @@ -312,6 +378,13 @@ jobs: name: codeql-sarif path: codeql-results + - name: Download all version captures + uses: actions/download-artifact@v7 + with: + path: version-captures + pattern: 'version-capture-*' + continue-on-error: true + - name: Setup dotnet uses: actions/setup-dotnet@v5 with: @@ -332,6 +405,14 @@ jobs: - name: Restore Tools run: dotnet tool restore + - name: Capture tool versions for build-docs + shell: bash + run: | + echo "Capturing tool versions..." + dotnet versionmark --capture --job-id "build-docs" -- \ + dotnet git node npm pandoc weasyprint sarifmark reqstream buildmark versionmark + echo "✓ Tool versions captured" + - name: Generate Requirements Report and Trace Matrix run: > dotnet reqstream @@ -461,6 +542,20 @@ jobs: exit 1 fi + - name: Publish Tool Versions + shell: bash + run: | + echo "Publishing tool versions..." + dotnet versionmark --publish --report docs/buildnotes/versions.md --report-depth 1 \ + -- "versionmark-*.json" "version-captures/**/versionmark-*.json" + echo "✓ Tool versions published" + + - name: Display Tool Versions Report + shell: bash + run: | + echo "=== Tool Versions Report ===" + cat docs/buildnotes/versions.md + - name: Generate Build Notes HTML with Pandoc shell: bash run: > diff --git a/.gitignore b/.gitignore index d9aee83..8858df2 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,4 @@ docs/justifications/*.html docs/quality/sonar-quality.md docs/quality/codeql-quality.md docs/quality/*.html +docs/buildnotes/versions.md diff --git a/.versionmark.yaml b/.versionmark.yaml new file mode 100644 index 0000000..1616a4c --- /dev/null +++ b/.versionmark.yaml @@ -0,0 +1,66 @@ +--- +# VersionMark Configuration File +# This file defines which tools to capture and how to extract their version information. + +tools: + # .NET SDK + # Note: .NET SDK versions include up to 4 components (e.g., 10.0.102, 8.0.404) + dotnet: + command: dotnet --version + regex: '(?\d+\.\d+\.\d+(?:\.\d+)?)' + + # Git + git: + command: git --version + regex: '(?i)git version (?\d+\.\d+\.\d+)' + + # Node.js + node: + command: node --version + regex: '(?i)v(?\d+\.\d+\.\d+)' + + # npm + npm: + command: npm --version + regex: '(?\d+\.\d+\.\d+)' + + # SonarScanner for .NET (from dotnet tool list) + dotnet-sonarscanner: + command: dotnet tool list + regex: '(?i)dotnet-sonarscanner\s+(?\d+\.\d+\.\d+)' + + # Pandoc (DemaConsulting.PandocTool from dotnet tool list) + pandoc: + command: dotnet tool list + regex: '(?i)demaconsulting\.pandoctool\s+(?\d+\.\d+\.\d+)' + + # WeasyPrint (DemaConsulting.WeasyPrintTool from dotnet tool list) + weasyprint: + command: dotnet tool list + regex: '(?i)demaconsulting\.weasyprinttool\s+(?\d+\.\d+\.\d+)' + + # SarifMark (DemaConsulting.SarifMark from dotnet tool list) + sarifmark: + command: dotnet tool list + regex: '(?i)demaconsulting\.sarifmark\s+(?\d+\.\d+\.\d+)' + + # SonarMark - checks global installation since it installs itself globally + # Note: Different from template - uses --global flag like BuildMark + sonarmark: + command: dotnet tool list --global + regex: '(?i)demaconsulting\.sonarmark\s+(?\d+\.\d+\.\d+)' + + # ReqStream (DemaConsulting.ReqStream from dotnet tool list) + reqstream: + command: dotnet tool list + regex: '(?i)demaconsulting\.reqstream\s+(?\d+\.\d+\.\d+)' + + # BuildMark (DemaConsulting.BuildMark from dotnet tool list) + buildmark: + command: dotnet tool list + regex: '(?i)demaconsulting\.buildmark\s+(?\d+\.\d+\.\d+)' + + # VersionMark (DemaConsulting.VersionMark from dotnet tool list) + versionmark: + command: dotnet tool list + regex: '(?i)demaconsulting\.versionmark\s+(?\d+\.\d+\.\d+)' diff --git a/docs/buildnotes/definition.yaml b/docs/buildnotes/definition.yaml index d93a4ba..7eb0c4c 100644 --- a/docs/buildnotes/definition.yaml +++ b/docs/buildnotes/definition.yaml @@ -7,6 +7,7 @@ input-files: - docs/buildnotes/title.txt - docs/buildnotes/introduction.md - docs/buildnotes.md + - docs/buildnotes/versions.md template: template.html