Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docfx source files #3453

Merged
merged 6 commits into from
Oct 2, 2023
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
24 changes: 22 additions & 2 deletions .github/templates/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,40 @@
uses: #@ actionCache
with:
path: 'C:\docfx'
key: docfx-2.62.1
key: docfx-2.70.4
- name: Download docfx
if: inputs.build-docs && steps.check-docfx-cache.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri https://github.com/dotnet/docfx/releases/download/v2.62.1/docfx-win-x64-v2.62.1.zip -OutFile C:\docfx.zip
Invoke-WebRequest -Uri https://github.com/dotnet/docfx/releases/download/v2.70.4/docfx-win-x64-v2.70.4.zip -OutFile C:\docfx.zip
Expand-Archive -Path C:\docfx.zip -DestinationPath C:\docfx
shell: powershell
- _: #@ template.replace(setupDotnet("6.0.402", ifCondition = "inputs.build-docs"))
- name: Build docs
if: inputs.build-docs
env:
DOCFX_SOURCE_BRANCH_NAME: ${{ github.head_ref }}
run: |
New-Item global.json
Set-Content global.json '{ "sdk": { "version": "6.0.402" } }'
C:\docfx\docfx Docs/docfx.json

#! the link generated by docfx is incorrect - it points to
#! https://github.com/realm/realm-dotnet/new/main/Docs/apispec/new?filename=...
#! instead of
#! https://github.com/realm/realm-dotnet/new/main/Docs/apispec?filename=...
- name: Update Improve this doc links
run: |
Get-ChildItem Docs/_site -Filter *.html -Recurse -File |
ForEach-Object {
$content = ($_ | Get-Content -Raw)
$content = $content -replace "/Docs/apispec/new\?filename", "/Docs/apispec?filename"
Set-Content $_.FullName $content
}
shell: pwsh

- name: Archive docs
if: inputs.build-docs
run: |
Compress-Archive -Path Docs/_site -DestinationPath "Realm/packages/Docs.zip"
- _: #@ template.replace(uploadArtifacts("Docs.zip", "Realm/packages/Docs.zip"))
if: inputs.build-docs
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,24 @@ jobs:
dotnet-version: 6.0.402
- name: Build docs
if: inputs.build-docs
env:
DOCFX_SOURCE_BRANCH_NAME: ${{ github.head_ref }}
run: |
New-Item global.json
Set-Content global.json '{ "sdk": { "version": "6.0.402" } }'
C:\docfx\docfx Docs/docfx.json
- name: Update Improve this doc links
run: |
Get-ChildItem Docs/_site -Filter *.html -Recurse -File |
ForEach-Object {
$content = ($_ | Get-Content -Raw)
$content = $content -replace "/Docs/apispec/new\?filename", "/Docs/apispec?filename"
Set-Content $_.FullName $content
}
shell: pwsh
- name: Archive docs
if: inputs.build-docs
run: |
Compress-Archive -Path Docs/_site -DestinationPath "Realm/packages/Docs.zip"
- name: Store artifacts for Docs.zip
uses: actions/upload-artifact@v3
Expand Down
5 changes: 3 additions & 2 deletions Docs/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"filter": "filterConfig.yml",
"properties": {
"TargetFramework": "netstandard2.0"
}
},
"EnumSortOrder": "declaringOrder"
}
],
"build": {
Expand Down Expand Up @@ -82,7 +83,7 @@
"_gitContribute": {
"repo": "https://github.com/realm/realm-dotnet.git",
"branch": "main",
"path": "Docs/apispec"
"apiSpecFolder": "Docs/apispec"
}
},
"fileMetadataFiles": [],
Expand Down
1 change: 1 addition & 0 deletions Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<LangVersion>9.0</LangVersion>
<nullable>enable</nullable>
<AndroidResgenNamespace>Realms.PlatformHelpers</AndroidResgenNamespace>
<NoWarn>NETSDK1202</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down