diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 34a667b..55497ce 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -37,6 +37,12 @@ "commands": [ "buildmark" ] + }, + "demaconsulting.versionmark": { + "version": "0.1.0", + "commands": [ + "versionmark" + ] } } } \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f2c75f9..99741e6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,6 +23,27 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 + - name: Setup dotnet + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 10.x + + - name: Restore dotnet 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: Markdown Lint uses: DavidAnson/markdownlint-cli2-action@v22 with: @@ -117,6 +138,22 @@ jobs: --configuration Release --property:Version=${{ 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 package uses: actions/upload-artifact@v6 with: @@ -138,6 +175,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: @@ -149,6 +193,9 @@ jobs: with: dotnet-version: ${{ matrix.dotnet-version }} + - name: Restore dotnet tools + run: dotnet tool restore + - name: Install tool from package shell: bash run: | @@ -191,6 +238,23 @@ jobs: [ -f "$TRX_FILE" ] || { echo "✗ Results file not created"; exit 1; } echo "✓ Self-validation with results 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 @@ -283,6 +347,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 Node.js uses: actions/setup-node@v6 with: @@ -424,6 +495,31 @@ jobs: --report docs/buildnotes.md --report-depth 1 + - 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 sonarmark reqstream buildmark versionmark + echo "✓ Tool versions captured" + + - 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: Display Build Notes Report shell: bash run: | @@ -448,7 +544,7 @@ jobs: - name: Upload documentation uses: actions/upload-artifact@v6 with: - name: documentation + name: documents path: | docs/*.pdf docs/buildnotes.md diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bc23c0c..01d2afd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -56,7 +56,7 @@ jobs: - name: Download documentation artifacts uses: actions/download-artifact@v7 with: - name: documentation + name: documents path: artifacts - name: Move buildnotes.md to root diff --git a/.versionmark.yaml b/.versionmark.yaml new file mode 100644 index 0000000..bb4d955 --- /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 (DemaConsulting.SonarMark from dotnet tool list) + sonarmark: + command: dotnet tool list + regex: '(?i)demaconsulting\.sonarmark\s+(?\d+\.\d+\.\d+)' + + # ReqStream (DemaConsulting.ReqStream from dotnet tool list --global) + # Note: ReqStream is installed globally in integration-test and build-docs jobs + reqstream: + command: dotnet tool list --global + 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