diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 936ea2f..d52e751 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,30 +14,42 @@ jobs: - uses: actions/checkout@v2 with: submodules: true + + - name: Install .NET 8 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + - uses: actions/setup-dotnet@v3 with: - dotnet-version: '9.0.x' + dotnet-version: '9.x' + - uses: actions/setup-node@v3 with: node-version: 22.14 + - uses: pnpm/action-setup@v4 with: version: 10.8.0 + - name: workloads 1 - run: dotnet workload restore ext/Avalonia/src/iOS/Avalonia.iOS/Avalonia.iOS.csproj + working-directory: ./ext/Avalonia/src/ + run: dotnet workload restore ./iOS/Avalonia.iOS/Avalonia.iOS.csproj + - name: workloads 2 - run: dotnet workload restore ext/Avalonia/src/Android/Avalonia.Android/Avalonia.Android.csproj + working-directory: ./ext/Avalonia/src/ + run: dotnet workload restore ./Android/Avalonia.Android/Avalonia.Android.csproj + - name: Run build script run: ./build.ps1 -pack - - name: find - shell: bash - run: find ./artifacts.zip + - name: Upload SFHB result temporarily as atifact uses: actions/upload-artifact@v4 with: name: website-artifact path: ./artifacts.zip retention-days: 1 + docusaurus_deploy_job: runs-on: ubuntu-latest name: Build website @@ -48,20 +60,26 @@ jobs: with: name: website-artifact path: ./website/ + - uses: actions/setup-node@v3 with: node-version: 22.14 + - uses: pnpm/action-setup@v4 with: version: 10.8.0 + - name: Run build script working-directory: ./website/ run: bash ./build.sh --build + - name: Install dependencies run: sudo apt-get update; sudo apt-get install -y rsync + - name: Setup key working-directory: ./website/ run: echo '${{ secrets.DEPLOY_KEY }}' > ./upload.key && chmod 700 ./upload.key + - name: Build And Deploy working-directory: ./website/ run: ./deploy.sh ${{ vars.DEPLOY_HOST }} ${{ vars.DEPLOY_PORT }} ${{ vars.DEPLOY_USER }} diff --git a/README.md b/README.md index 49285b3..6e5dece 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,20 @@ It is important to mind the build order. > .\build.ps1 -preview > ``` +## Updating the Sandcastle tools + +> [WARNING] if you update the SHFB-nuget packages you also need to update the tools path in `build.ps1` +> ```ps1 +> # set SHFBRoot +> $env:SHFBRoot = ".\src\packages\ewsoftware.shfb\2025.9.30\tools\" +> ``` + + ## Generate the API docs for newer Avalonia version -Use the `set-version.ps1` script to update the version. +Use the `update-submodule.ps1` script to update the version to the latest stable. if you need any other branch version, you need to link the branch name for the submodule by hand. -```ps1 -# -version: specify the Avalonia version to document. If this parameter is not set, `AvaloniaVersion.txt` will be used instead. -.\set-version.ps1 11.2.0 -``` +> [!NOTE] +> The file `./ext/Avalonia/build/SharedVersion.props` stores the current version info. > [!WARNING] > Remember to commit all updates made to the submodule. diff --git a/build.ps1 b/build.ps1 index edb0b0f..0687681 100644 --- a/build.ps1 +++ b/build.ps1 @@ -20,7 +20,7 @@ New-item ./website/AvaloniaVersion.txt -ItemType File -Value $version -Force Write-Host "Avalonia version is $version" # set SHFBRoot -$env:SHFBRoot = ".\src\packages\ewsoftware.shfb\2025.3.22\tools\" +$env:SHFBRoot = ".\src\packages\ewsoftware.shfb\2025.9.30\tools\" # Define a list of dotNET projects to build $projectsToBuild = @( @@ -69,24 +69,49 @@ $projectsToBuild = @( "src/ApiDocumentation/ApiDocumentation.shfbproj" ) -foreach ($proj in $projectsToBuild){ - dotnet build $proj -c Release - Write-Host "`n built $proj" -ForegroundColor DarkGreen -BackgroundColor Gray - Write-Host "`n" +foreach ($proj in $projectsToBuild) +{ + # Ensure dotnet resolves global.json relative to the project by changing into the project's directory + $projDir = Split-Path $proj -Parent + $projFile = Split-Path $proj -Leaf + + if (-not [string]::IsNullOrEmpty($projDir)) + { + Push-Location $projDir + try + { + Write-Host "Building $projFile in directory $( Get-Location )..." + dotnet build ".\$projFile" -c Release + } + finally + { + Pop-Location + } + } + else + { + # project is in repository root + Write-Information "Building $projFile in repository root..." + dotnet build ".\$projFile" -c Release + } + + Write-Information "`n built $projFile" + Write-Information "`n" } + # preview the website if preview switch is on if($preview.IsPresent){ - pushd ./website + Push-Location ./website ./build.ps1 -preview - popd + Pop-Location } # build the website if build switch is on if($build.IsPresent){ - pushd ./website + Push-Location ./website ./build.ps1 -build - popd + Pop-Location } # pack the md-files and version settings if pack switch is on diff --git a/global.json b/global.json new file mode 100644 index 0000000..e79939b --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "9.*" + } +} \ No newline at end of file diff --git a/src/ApiDocumentation/ApiDocumentation.shfbproj b/src/ApiDocumentation/ApiDocumentation.shfbproj index 0e75d8a..d5574e6 100644 --- a/src/ApiDocumentation/ApiDocumentation.shfbproj +++ b/src/ApiDocumentation/ApiDocumentation.shfbproj @@ -135,8 +135,8 @@ - - + + diff --git a/src/AvaloniaAttributesPlugin/AvaloniaAttributesPlugIn.cs b/src/AvaloniaAttributesPlugin/AvaloniaAttributesPlugIn.cs index 27c55a0..b3236bf 100644 --- a/src/AvaloniaAttributesPlugin/AvaloniaAttributesPlugIn.cs +++ b/src/AvaloniaAttributesPlugin/AvaloniaAttributesPlugIn.cs @@ -1,5 +1,3 @@ -using SandcastleBuilder.Utils.BuildComponent; -using SandcastleBuilder.Utils.BuildEngine; using System; using System.Collections.Generic; using System.IO; @@ -7,6 +5,8 @@ using System.Text.RegularExpressions; using System.Xml.Linq; using System.Xml.XPath; +using Sandcastle.Core.BuildEngine; +using Sandcastle.Core.PlugIn; namespace AvaloniaAttributes { @@ -36,7 +36,7 @@ public sealed class AvaloniaAttributesPlugIn : IPlugIn private List? _executionPoints; - private BuildProcess? _builder; + private IBuildProcess? _builder; //===================================================================== @@ -61,7 +61,7 @@ public IEnumerable ExecutionPoints /// /// A reference to the current build process /// The configuration data that the plug-in should use to initialize itself - public void Initialize(BuildProcess buildProcess, XElement configuration) + public void Initialize(IBuildProcess buildProcess, XElement configuration) { _builder = buildProcess; diff --git a/src/AvaloniaAttributesPlugin/AvaloniaAttributesPlugIn.csproj b/src/AvaloniaAttributesPlugin/AvaloniaAttributesPlugIn.csproj index df0d3d2..3b34970 100644 --- a/src/AvaloniaAttributesPlugin/AvaloniaAttributesPlugIn.csproj +++ b/src/AvaloniaAttributesPlugin/AvaloniaAttributesPlugIn.csproj @@ -62,9 +62,8 @@ - - - + +