Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build (Windows)

on:
push:
branches: [ "master", "main" ]
branches: [ "master", "main", "sow/2026-Q2" ]
pull_request:
branches: [ "master", "main" ]
branches: [ "master", "main", "sow/2026-Q2" ]
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -55,10 +55,27 @@ jobs:
$deps = $buildOrder[0..($buildOrder.Count-2)]
foreach ($r in $deps) {
if (Test-Path $r) { continue }
Write-Host "Cloning https://github.com/$org/$r.git"
git clone --depth 1 "https://github.com/$org/$r.git" $r
$headRef = '${{ github.head_ref }}'
$candidates = @()
if ($headRef) { $candidates += $headRef }
$candidates += 'sow/2026-Q2'
$cloned = $false
foreach ($cand in $candidates) {
$has = (git ls-remote --heads "https://github.com/$org/$r.git" $cand 2>$null | Out-String).Trim()
if ($has) {
Write-Host "Cloning $org/$r @ $cand"
git clone --depth 1 --branch $cand "https://github.com/$org/$r.git" $r
$cloned = $true
break
}
}
if (-not $cloned) {
Write-Host "Cloning $org/$r @ default branch"
git clone --depth 1 "https://github.com/$org/$r.git" $r
}
}


# Ensure ReferencePath exists even before SAM_Windows builds
New-Item -ItemType Directory -Force -Path "SAM_Windows\build" | Out-Null

Expand Down
81 changes: 63 additions & 18 deletions .github/workflows/spdx-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,89 @@ name: SPDX + Copyright header check

on:
pull_request:
workflow_dispatch:

jobs:
spdx:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read

steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Check header in changed .cs files
shell: bash
run: |
set -e
BASE="${{ github.event.pull_request.base.sha }}"
HEAD="${{ github.event.pull_request.head.sha }}"
set -euo pipefail

if [ "${{ github.event_name }}" = "pull_request" ]; then
BASE="${{ github.event.pull_request.base.sha }}"
HEAD="${{ github.event.pull_request.head.sha }}"
else
HEAD="${{ github.sha }}"
BASE="$(git rev-parse "${HEAD}^" 2>/dev/null || true)"
fi

FILES=$(git diff --name-only "$BASE" "$HEAD" -- '*.cs' || true)
echo "Base SHA: ${BASE:-<none>}"
echo "Head SHA: $HEAD"
echo

if [ -z "$FILES" ]; then
if [ -z "${BASE:-}" ]; then
mapfile -t files < <(git ls-files '*.cs')
else
mapfile -t files < <(git diff --diff-filter=ACMR --name-only "$BASE" "$HEAD" -- '*.cs' || true)
fi

if [ "${#files[@]}" -eq 0 ]; then
echo "No C# files changed."
exit 0
fi

MISSING=""
for f in $FILES; do
HEADBLOCK=$(head -n 6 "$f")
echo "Changed C# files:"
printf ' - %s\n' "${files[@]}"
echo

missing=()

for f in "${files[@]}"; do
if [ ! -f "$f" ]; then
echo "Skipping missing file: $f"
continue
fi

headblock="$(head -n 20 "$f" | sed '1s/^\xEF\xBB\xBF//' | tr -d '\r')"

echo "Checking: $f"

if ! grep -q "SPDX-License-Identifier: LGPL-3.0-or-later" <<< "$headblock"; then
echo " Missing SPDX line"
missing+=("$f")
continue
fi

if ! grep -qE "Copyright \(c\) 2020[-–]2026 Michal Dengusiak & Jakub Ziolkowski and contributors" <<< "$headblock"; then
echo " Missing copyright line"
missing+=("$f")
continue
fi

echo "$HEADBLOCK" | grep -q "// SPDX-License-Identifier: LGPL-3.0-or-later" || MISSING="$MISSING $f"
echo "$HEADBLOCK" | grep -q "// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors" || MISSING="$MISSING $f"
echo " OK"
done

if [ -n "$MISSING" ]; then
echo "❌ Missing required header in:"
for f in $MISSING; do echo " - $f"; done
echo ""
echo "Each changed .cs file must start with:"
echo
if [ "${#missing[@]}" -gt 0 ]; then
echo "Missing required header in:"
printf ' - %s\n' "${missing[@]}"
echo
echo "Each checked .cs file must contain within the first 20 lines:"
echo "// SPDX-License-Identifier: LGPL-3.0-or-later"
echo "// Copyright (c) 20202026 Michal Dengusiak & Jakub Ziolkowski and contributors"
echo "// Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors"
exit 1
fi

echo "SPDX + copyright headers OK."
echo "SPDX + copyright headers OK."
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Newtonsoft.Json">
<Version>13.0.3</Version>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="10.0.8" />
</ItemGroup>
<PropertyGroup />
<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion SAM_SQL/SAM.Core.SQL/SAM.Core.SQL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Text.Json" Version="10.0.8" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient">
Expand Down
Loading