diff --git a/windows/src/Target.mak b/windows/src/Target.mak index f8a1e6c9ac..d5816a93f1 100644 --- a/windows/src/Target.mak +++ b/windows/src/Target.mak @@ -50,9 +50,8 @@ dirs: @-mkdir $(ROOT)\bin\help 2>nul @-mkdir $(ROOT)\bin\help\desktop 2>nul @-mkdir $(ROOT)\bin\help\developer 2>nul - @-mkdir $(ROOT)\bin\help\php 2>nul - @-mkdir $(ROOT)\bin\help\php\desktop 2>nul - @-mkdir $(ROOT)\bin\help\php\developer 2>nul + @-mkdir $(ROOT)\bin\help\md 2>nul + @-mkdir $(ROOT)\bin\help\md\desktop 2>nul @-mkdir $(ROOT)\lib 2>nul @-mkdir $(ROOT)\release 2>nul diff --git a/windows/src/buildtools/help-keyman-com.sh b/windows/src/buildtools/help-keyman-com.sh index a3e3f85aaf..43dc759f7a 100644 --- a/windows/src/buildtools/help-keyman-com.sh +++ b/windows/src/buildtools/help-keyman-com.sh @@ -37,7 +37,7 @@ if [ -z ${HELP_KEYMAN_COM+x} ]; then exit 1 fi -if [ ! -d "$HELP_KEYMAN_COM/products/desktop/" ]; then +if [ ! -d "$HELP_KEYMAN_COM/products/" ]; then >&2 echo "HELP_KEYMAN_COM path ($HELP_KEYMAN_COM) does not appear to be valid." exit 1 fi @@ -62,19 +62,7 @@ echo "Uploading Keyman for Windows documentation to help.keyman.com" ## function upload_keyman_for_windows_help { - # - # Note: release/packages which contain multiple keyboards should also have the keyboards - # as separate entries in the release/ folder. This means we may have a combined package - # help file as well as a per-keyboard help file. It is acceptable in this situation to - # make the combined help file link to the per-keyboard help files. - # - - # - # Copy all files in that folder, according to the current - # version of the keyboard, to help.keyman.com/keyboard/// - # - - local helppath=$KEYMANROOT/../bin/help/php/desktop + local helppath=$KEYMANROOT/../bin/help/md/desktop # # Look for help source folder. @@ -85,7 +73,7 @@ function upload_keyman_for_windows_help { return 0 fi - local dstpath="$HELP_KEYMAN_COM/products/desktop/$VERSION_RELEASE/docs" + local dstpath="$HELP_KEYMAN_COM/products/windows/$VERSION_RELEASE" mkdir -p "$dstpath" @@ -95,7 +83,9 @@ function upload_keyman_for_windows_help { # # Commit and push to the help.keyman.com repo -# TODO: turn this into a pull request +# Creates a pull request with the 'auto' label +# Which a GitHub action will watch for in order +# to automatically process and merge it # function commit_and_push { @@ -104,7 +94,8 @@ function commit_and_push { pushd $HELP_KEYMAN_COM git config user.name "Keyman Build Server" git config user.email "keyman-server@users.noreply.github.com" - git add products/desktop/$VERSION_RELEASE/docs || return 1 + git checkout -b auto/windows-help-$VERSION_WITH_TAG master + git add products/windows/$VERSION_RELEASE || return 1 git diff --cached --no-ext-diff --quiet --exit-code && { # if no changes then don't do anything. echo "No changes to commit" @@ -113,9 +104,9 @@ function commit_and_push { } echo "changes added to cache...>>>" - git commit -m "Keyman for Windows help deployment (automatic)" || return 1 - git pull origin master || return 1 - git push origin master || return 1 + git commit -m "auto: Keyman for Windows help deployment" || return 1 + git push origin auto/windows-help-$VERSION_WITH_TAG || return 1 + hub pull-request -l auto -m "auto: Keyman for Windows help deployment" || return 1 popd echo "Push to help.keyman.com complete" diff --git a/windows/src/desktop/help/build.sh b/windows/src/desktop/help/build.sh index 6d1d386b1c..f4f6031942 100644 --- a/windows/src/desktop/help/build.sh +++ b/windows/src/desktop/help/build.sh @@ -19,10 +19,8 @@ display_usage() { echo "build.sh [--no-clean] target [...target]" echo "Builds help documentation for Keyman for Windows" echo "Targets:" - echo " * web: copy documentation to help.keyman.com repository" - echo " If environment variable KEYMAN_SITE_ROOT is set, uses that as" - echo " base, otherwise, this repository's peer folder 'sites' is used" - echo " and the subfolder {base}/help.keyman.com/products/windows/.../" + echo " * web: copy documentation to bin/help/php folder. This can then be" + echo " deployed with help-keyman-com.sh" echo " * chm: convert documentation to html using pandoc and then build .chm" echo echo " --no-clean: don't clean target folder before building" @@ -197,33 +195,21 @@ fi # if $DO_WEB; then - if [ -v KEYMAN_SITE_ROOT ]; then - DESTWEB="$KEYMAN_SITE_ROOT" - else - DESTWEB="$KEYMAN_ROOT/../sites" + DESTWEB="$THIS_DIR/../../../bin/help/md/desktop" + + if $DO_CLEAN; then + rm -rf "$DESTWEB" || true fi - DESTWEB="$DESTWEB/help.keyman.com/products/windows" - echo "$DESTWEB" + mkdir -p "$DESTWEB" - # Make sure we have a website here with the basic /products/windows/ path - if [ -d "$DESTWEB" ]; then - DESTWEB="$DESTWEB/$VERSION_RELEASE" + for INFILE in $MD; do + OUTFILE="$DESTWEB/$INFILE" + mkdir -p "$(dirname "$OUTFILE")" + cp "$INFILE" "$OUTFILE" + done - if $DO_CLEAN; then - rm -rf "$DESTWEB" || true - fi - - mkdir -p "$DESTWEB" - - for INFILE in $MD; do - OUTFILE="$DESTWEB/$INFILE" - mkdir -p "$(dirname "$OUTFILE")" - cp "$INFILE" "$OUTFILE" - done - - mkdir -p "$DESTWEB/desktop_images" - cp "$THIS_DIR"/desktop_images/* "$DESTWEB/desktop_images/" - fi + mkdir -p "$DESTWEB/desktop_images" + cp "$THIS_DIR"/desktop_images/* "$DESTWEB/desktop_images/" fi