Skip to content

Commit

Permalink
Fix docs generation
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed Jul 19, 2024
1 parent 60f3708 commit 381fd80
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/pkl-workflows/helpers/Package.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,27 @@ local const function buildDocs(condition: String): Listing<gha.Step> = new {
}
run = "C:\\docfx\\docfx Docs/docfx.json"
}
new {
name = "Update Improve this doc links"
`if` = condition
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"
}
new {
name = "Archive docs"
`if` = condition
run = """
Compress-Archive -Path Docs/_site -DestinationPath "Realm/packages/Docs.zip"
"""
}
(Steps.uploadArtifacts("Docs.zip", "Realm/packages/Docs.zip")) {
`if` = condition
}
}
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,27 @@ jobs:
env:
DOCFX_SOURCE_BRANCH_NAME: ${{ github.head_ref }}
run: C:\docfx\docfx Docs/docfx.json
- name: Update Improve this doc links
if: contains(github.head_ref, 'release')
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: contains(github.head_ref, 'release')
run: Compress-Archive -Path Docs/_site -DestinationPath "Realm/packages/Docs.zip"
- name: Store artifacts for Docs.zip
if: contains(github.head_ref, 'release')
uses: actions/upload-artifact@v4
with:
name: Docs.zip
path: Realm/packages/Docs.zip
retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }}
if-no-files-found: error
build-unity:
name: Package Unity
needs:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,27 @@ jobs:
env:
DOCFX_SOURCE_BRANCH_NAME: ${{ github.head_ref }}
run: C:\docfx\docfx Docs/docfx.json
- name: Update Improve this doc links
if: contains(github.head_ref, 'release')
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: contains(github.head_ref, 'release')
run: Compress-Archive -Path Docs/_site -DestinationPath "Realm/packages/Docs.zip"
- name: Store artifacts for Docs.zip
if: contains(github.head_ref, 'release')
uses: actions/upload-artifact@v4
with:
name: Docs.zip
path: Realm/packages/Docs.zip
retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }}
if-no-files-found: error
build-unity:
name: Package Unity
needs:
Expand Down

0 comments on commit 381fd80

Please sign in to comment.