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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
*.docx filter=lfs diff=lfs merge=lfs -text
*.webp filter=lfs diff=lfs merge=lfs -text
*.vsdx filter=lfs diff=lfs merge=lfs -text
*.svg filter=lfs diff=lfs merge=lfs -text
163 changes: 163 additions & 0 deletions .github/actions/setup-stride/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: 'Setup Stride'
description: 'Sets up .NET, checkouts repos, and installs DocFX'

inputs:
github-token:
description: 'GitHub token used for repository checkout'
required: true
skip-pdf-building:
description: 'Skip PDF building when set to true'
required: false
default: 'false'
skip-api-building:
description: 'Skip API building when set to true'
required: false
default: 'false'
stride-branch:
description: 'Stride branch to checkout'
required: false
default: 'master'

runs:
using: "composite"

steps:
- name: .NET SDK Setup
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x

# - name: Configure MSBuild SDK resolver - Temporary
# run: |
# $dotnetRoot = Split-Path (Get-Command dotnet).Source -Parent
# $sdkVersion = & dotnet --version
# $msbuildSdksPath = Join-Path $dotnetRoot "sdk\$sdkVersion\Sdks"

# echo "DOTNET_ROOT=$dotnetRoot" >> $env:GITHUB_ENV
# echo "MSBuildSDKsPath=$msbuildSdksPath" >> $env:GITHUB_ENV
# echo "MSBuildEnableWorkloadResolver=false" >> $env:GITHUB_ENV

# Write-Host "DOTNET_ROOT=$dotnetRoot"
# Write-Host "MSBuildSDKsPath=$msbuildSdksPath"
# Write-Host "MSBuildEnableWorkloadResolver=false"

# if (-not (Test-Path $msbuildSdksPath)) {
# throw "MSBuildSDKsPath does not exist: $msbuildSdksPath"
# }
# shell: pwsh

- name: Set Version in docfx.json
run: |
$settingsContent = Get-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Raw
$updatedDocFxJsonContent = $settingsContent -replace '2.0.0.x', "${{ env.VERSION }}"
Set-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Value $updatedDocFxJsonContent
shell: pwsh

# Checkout the Stride repository from the default branch
- name: Checkout Stride (note the LFS)
uses: actions/checkout@v6
with:
repository: stride3d/stride
token: ${{ inputs.github-token }}
path: stride
lfs: true
ref: ${{ inputs.stride-branch }}

- name: Set up dependency caching for faster builds
uses: actions/cache@v5
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets', '**/packages.lock.json', '**/NuGet.config') }}
restore-keys: |
${{ runner.os }}-nuget-

# Temporary solution till the new docfx is available with Analyzers update
- name: Checkout DocFX
uses: actions/checkout@v6
with:
repository: VaclavElias/docfx
# Tested commit
# ref: 917cda864650279e0bbe50b852cb98601e5efa4d
# Use the temp-fix branch
ref: refs/heads/temp-fix
path: docfx-build
fetch-depth: 0

- name: Restore npm dependencies
run: npm install
working-directory: docfx-build/templates
shell: pwsh

- name: Build site templates
run: npm run build
working-directory: docfx-build/templates
shell: pwsh

- name: Add night build NuGet source
run: |
dotnet nuget add source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" --name dnceng-dotnet-tools --store-password-in-clear-text
shell: pwsh

- name: Build DocFX from PR
run: dotnet pack src/docfx -c Release /p:Version=2.9-stride -o drop/nuget
working-directory: docfx-build
shell: pwsh

# - name: Install MSVC ARM64/ARM64EC build tools - Temporary
# run: |
# $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
# $installer = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installer.exe"

# $installPath = & $vswhere -latest -products * -property installationPath

# if (-not $installPath) {
# throw "Visual Studio installation not found."
# }

# Write-Host "Visual Studio install path: $installPath"

# Start-Process -FilePath $installer -ArgumentList @(
# "modify",
# "--installPath", $installPath,
# "--add", "Microsoft.VisualStudio.Component.VC.Tools.ARM64",
# "--add", "Microsoft.VisualStudio.Component.VC.Tools.ARM64EC",
# "--quiet",
# "--norestart",
# "--nocache",
# "--wait"
# ) -Wait -NoNewWindow
# shell: pwsh

- name: Build Install DocFX
run: dotnet tool install -g docfx --version 2.9-stride --add-source drop/nuget
working-directory: docfx-build
shell: pwsh
# End of Temporary solution

# - name: Install DocFX
# # This installs the latest version of DocFX and may introduce breaking changes
# # run: dotnet tool update -g docfx
# # This installs a specific, tested version of DocFX.
# run: dotnet tool update -g docfx --version 2.78.5
# shell: pwsh

# - name: Prebuild Stride
# run: dotnet build build\Stride.sln -c Release
# working-directory: stride
# shell: pwsh

- name: Build documentation
run: |
$arguments = @()

if ('${{ inputs.skip-pdf-building }}' -eq 'true') {
$arguments += '-SkipPdfBuilding'
}

if ('${{ inputs.skip-api-building }}' -eq 'true') {
$arguments += '-SkipApiBuilding'
}

./build-all.bat @arguments
working-directory: ${{ env.DOCS_PATH }}
shell: pwsh
49 changes: 0 additions & 49 deletions .github/workflows/common-setup.yml

This file was deleted.

118 changes: 49 additions & 69 deletions .github/workflows/stride-docs-github.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build Stride Docs for GitHub Staging

env:
Expand All @@ -9,83 +7,65 @@ env:

on:
workflow_dispatch:
inputs:
skipPdfBuilding:
description: Skip PDF building
required: true
default: true
type: boolean
skipApiBuilding:
description: Skip API building
required: true
default: true
type: boolean
stride-branch:
description: 'Stride branch to checkout'
required: false
default: 'master'

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
publish-docs:
runs-on: windows-latest
build:
name: Build documentation
runs-on: windows-2025-vs2026

steps:
- name: .NET SDK Setup
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x

# Checkout the Stride Docs repository from the branch that triggered the workflow
- name: Checkout Stride Docs
uses: actions/checkout@v6
with:
path: ${{ env.DOCS_PATH }}
lfs: true

- name: Set Version in docfx.json
run: |
$settingsContent = Get-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Raw
$updatedDocFxJsonContent = $settingsContent -replace '2.0.0.x', "${{ env.VERSION }}"
Set-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Value $updatedDocFxJsonContent
shell: pwsh

# Checkout the Stride repository from the default branch
- name: Checkout Stride (note the LFS)
uses: actions/checkout@v6
- name: Run Global Setup
id: setup
uses: ./stride-docs/.github/actions/setup-stride
with:
repository: stride3d/stride
token: ${{ secrets.GITHUB_TOKEN }}
path: stride
lfs: true
ref: master

# Temporary solution till the new docfx is available
# - name: Checkout DocFX
# uses: actions/checkout@v6
# with:
# repository: dotnet/docfx
# # Tested commit
# ref: 917cda864650279e0bbe50b852cb98601e5efa4d
# path: docfx-build
# fetch-depth: 0
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-pdf-building: ${{ inputs.skipPdfBuilding }}
skip-api-building: ${{ inputs.skipApiBuilding }}
stride-branch: ${{ inputs.strideBranch }}

# - name: Restore npm dependencies
# run: npm install
# working-directory: docfx-build/templates

# - name: Build site templates
# run: npm run build
# working-directory: docfx-build/templates

# - name: Build DocFX from PR
# run: dotnet pack src/docfx -c Release /p:Version=2.9-stride -o drop/nuget
# working-directory: docfx-build
# shell: pwsh

# - name: Build Install DocFX
# run: dotnet tool install -g docfx --version 2.9-stride --add-source drop/nuget
# working-directory: docfx-build
# shell: pwsh
# End of Temporary solution

- name: Install DocFX
# This installs the latest version of DocFX and may introduce breaking changes
# run: dotnet tool update -g docfx
# This installs a specific, tested version of DocFX.
run: dotnet tool update -g docfx --version 2.78.5

- name: Build documentation
run: ./build-all-skip-pdf.bat
working-directory: ${{ env.DOCS_PATH }}

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.DOCS_PATH }}/_site
publish_branch: gh-pages
path: ${{ env.DOCS_PATH }}/_site

deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v5
Loading
Loading