diff --git a/.github/pkl-workflows/helpers/Package.pkl b/.github/pkl-workflows/helpers/Package.pkl index 076ec341bd..782e104448 100644 --- a/.github/pkl-workflows/helpers/Package.pkl +++ b/.github/pkl-workflows/helpers/Package.pkl @@ -116,4 +116,27 @@ local const function buildDocs(condition: String): Listing = 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 + } } \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 75accee0d5..92b2880a4c 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 103f093b65..755fcbe25f 100755 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -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: