Skip to content

Commit

Permalink
i#2260 web: Finalize new automated web generation (#2408)
Browse files Browse the repository at this point in the history
Fixes issues with the initial commit of the Action to generate
the new web content:
- Wrong path to runsuite_wrapper.pl
- Add missing submodules
- Add package.cmake copy of embedded docs
- Add error checking for an empty glob
- Fix install path for embedded docs

Removes the old drmemory_docs generation step from the ci-package
action.

Issue: #2260
  • Loading branch information
derekbruening authored Jun 27, 2021
1 parent ddda8a1 commit 0b9f5e7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 15 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Fetch Sources
run: |
Expand Down Expand Up @@ -85,7 +87,7 @@ jobs:
- name: Build Docs
working-directory: ${{ github.workspace }}
run: ./suite/runsuite_wrapper.pl travis 64_only
run: ./tests/runsuite_wrapper.pl travis 64_only
env:
CI_TARGET: package
VERSION_NUMBER: ${{ steps.version.outputs.version_number }}
Expand All @@ -100,7 +102,7 @@ jobs:

- name: Deploy Embedded Docs
run: |
rsync -av --delete embed/html/ drmemory.github.io/docs/
rsync -av --delete html_embed/ drmemory.github.io/docs/
cd drmemory.github.io
git config --local user.name "cronbuild"
git config --local user.email "[email protected]"
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/ci-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,15 @@ jobs:
env:
CI_TARGET: package
VERSION_NUMBER: ${{ steps.version.outputs.version_number }}
DEPLOY_DOCS: yes
# Docs are deployed separately in ci-docs.yml.
DEPLOY_DOCS: no

- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: linux-tarball
path: DrMemory-Linux-${{ steps.version.outputs.version_number }}.tar.gz

- name: Deploy Docs
uses: crazy-max/ghaction-github-pages@v2
with:
build_dir: html
repo: DynamoRIO/drmemory_docs
target_branch: master
env:
# We need a personal access token for write access to another repo.
GH_PAT: ${{ secrets.DOCS_TOKEN }}

###########################################################################
# Mac tarball with x86-64 build:
osx:
Expand Down
28 changes: 26 additions & 2 deletions package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,12 @@ if (NOT arg_sub_package)
if (arg_copy_docs)
# Prepare for copying the documentation to our Github Pages site by placing it
# in a single fixed-name location with a .nojekyll file.
message("Copying documentation into ${arg_outdir}/html")
message("Copying standalone documentation into ${arg_outdir}/html")
message("Looking for ${last_package_build_dir}/_CPack_Packages/*/*/DrMemory-*/drmemory/docs/html")
file(GLOB allhtml "${last_package_build_dir}/_CPack_Packages/*/*/DrMemory-*/drmemory/docs/html")
if (NOT allhtml)
message(FATAL_ERROR "failed to find html docs dir")
endif ()
# If there's a source package we'll have multiple. Just take the first one.
list(GET allhtml 0 html)
if (EXISTS "${html}")
Expand All @@ -233,9 +236,30 @@ if (NOT arg_sub_package)
${CMAKE_COMMAND} -E copy_directory ${html} "${arg_outdir}/html")
# Create a .nojekyll file so Github Pages will display this as raw html.
execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${arg_outdir}/html/.nojekyll")
message("Successully copied docs")
message("Successully copied standalone docs")
else ()
message(FATAL_ERROR "failed to find html docs")
endif ()

message("Copying embedded documentation into ${arg_outdir}/html_embed")
message("Looking for ${last_package_build_dir}/_CPack_Packages/*/*/DrMemory-*/drmemory/docs_embed/html")
file(GLOB allhtml "${last_package_build_dir}/_CPack_Packages/*/*/DrMemory-*/drmemory/docs_embed/html")
if (NOT allhtml)
message(FATAL_ERROR "failed to find embedded html docs dir")
endif ()
# If there's a source package we'll have multiple. Just take the first one.
list(GET allhtml 0 html)
if (EXISTS "${html}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
"${arg_outdir}/html_embed")
execute_process(COMMAND
${CMAKE_COMMAND} -E copy_directory ${html} "${arg_outdir}/html_embed")
# Create a .nojekyll file so Github Pages will display this as raw html.
execute_process(COMMAND ${CMAKE_COMMAND} -E touch
"${arg_outdir}/html_embed/.nojekyll")
message("Successully copied embedded docs")
else ()
message(FATAL_ERROR "failed to find embedded html docs")
endif ()
endif ()
endif ()

0 comments on commit 0b9f5e7

Please sign in to comment.