From f40b51c551a082d2f88085cc5e635f7267f3040d Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Mon, 15 Apr 2024 14:16:16 -0600 Subject: [PATCH 1/5] Starting chm build --- .github/workflows/chm.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/chm.yml diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml new file mode 100644 index 000000000..0456d72d7 --- /dev/null +++ b/.github/workflows/chm.yml @@ -0,0 +1,30 @@ +name: chm + +on: + push: + branches: + - master + - develop + paths-ignore: + - 'doc/**' + - 'Version3/**' + - 'README.md' + pull_request: + branches: + - master + - develop + paths-ignore: + - 'doc/**' + - 'Version3/**' + - 'README.md' + schedule: + - cron: '1 2 2/7 * *' + workflow_dispatch: + +jobs: + build-chm: + runs-on: windows-latest + steps: + + - name: '🧰 Checkout' + uses: actions/checkout@v4 From 90b9d1f7c97f802b5ec0f88685e4b9d16c9314f3 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Mon, 15 Apr 2024 14:28:49 -0600 Subject: [PATCH 2/5] Added fixup_html step --- .github/workflows/chm.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index 0456d72d7..e98d9cdf9 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -28,3 +28,8 @@ jobs: - name: '🧰 Checkout' uses: actions/checkout@v4 + + - name: 'fixup_html' + shell: bash + working-directory: ./HTMLversion/HTML + run: ./fixup_html.bash From 73ee5e160ac160c32f5103b9391d984fd7f23f50 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Mon, 15 Apr 2024 14:50:00 -0600 Subject: [PATCH 3/5] Added htmlhelp steps --- .github/workflows/chm.yml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index e98d9cdf9..de6e092d8 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -31,5 +31,37 @@ jobs: - name: 'fixup_html' shell: bash - working-directory: ./HTMLversion/HTML + working-directory: ${{ github.workspace }}/HTMLversion/HTML run: ./fixup_html.bash + + - name: cache htmlhelp + id: cache-htmlhelp + uses: actions/cache@v4 + with: + path: "C:/Program Files (x86)/HTML Help Workshop" + key: ${{ runner.os }}-htmlhelp + + - name: install htmlhelp + if: steps.cache-htmlhelp.outputs.cache-hit != 'true' + timeout-minutes: 5 + run: | + curl -L -O --max-time 120 http://web.archive.org/web/20160201063255/http://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe + cmd /c start /wait .\htmlhelp.exe /q /c /t:$(Get-Location)\tmp + $file = "$(Get-Location)\tmp\htmlhelp.inf" + (Get-Content $file) | Foreach-Object { $_ ` + -replace '^BeginPrompt', ';;BeginPrompt' ` + -replace '^EndPrompt', ';;EndPrompt' ` + -replace '^49000=CustomLDID49000, 1', '49000=CustomLDID49000, 5' ` + -replace '^"hhupd.exe', ';;hhupd.exe' ` + -replace '^DefaultInstallDir="C:\\Program Files\\HTML Help Workshop"', 'DefaultInstallDir="%ProgramFiles%\\HTML Help Workshop"' + } | Set-Content $file + cmd /c start /wait .\tmp\setup.exe + Remove-Item -Recurse -Force .\tmp + Remove-Item -Recurse -Force .\htmlhelp.exe + # the next line doesn't seem to work (supposed to set the path) + # echo 'C:\Program Files (x86)\HTML Help Workshop' >> $GITHUB_PATH + Write-Output 'C:\Program Files (x86)\HTML Help Workshop' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: 'hhc' + working-directory: ${{ github.workspace }}/HTMLversion + run: Get-Command hhc From 1bd1a8b15d3e44e8f55adb06712f8d4d44793263 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Mon, 15 Apr 2024 15:12:46 -0600 Subject: [PATCH 4/5] Added compile and upload step --- .github/workflows/chm.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index de6e092d8..d15352dbb 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -58,10 +58,27 @@ jobs: cmd /c start /wait .\tmp\setup.exe Remove-Item -Recurse -Force .\tmp Remove-Item -Recurse -Force .\htmlhelp.exe - # the next line doesn't seem to work (supposed to set the path) - # echo 'C:\Program Files (x86)\HTML Help Workshop' >> $GITHUB_PATH + # set path Write-Output 'C:\Program Files (x86)\HTML Help Workshop' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: 'hhc' + - name: compile chm + shell: bash working-directory: ${{ github.workspace }}/HTMLversion - run: Get-Command hhc + run: | + # hhc returns 1 on success + set +e + hhc phreeqc3.hhp | tee hhc.out + status=${PIPESTATUS[0]} + set -e + if [ "$status" -eq 1 ]; then + echo "[OK]" + exit 0 + else + echo "[FAILED]" + exit 1 + fi + + - uses: actions/upload-artifact@v4 + with: + name: chm + path: ${{github.workspace}}/HTMLversion/phreeqc3.chm From 4969164a94524f59a7b4c041831ac3f12a19ea69 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Mon, 15 Apr 2024 15:20:36 -0600 Subject: [PATCH 5/5] Moved htmlhelp path to new step --- .github/workflows/chm.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index d15352dbb..2255c4d8f 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -58,8 +58,9 @@ jobs: cmd /c start /wait .\tmp\setup.exe Remove-Item -Recurse -Force .\tmp Remove-Item -Recurse -Force .\htmlhelp.exe - # set path - Write-Output 'C:\Program Files (x86)\HTML Help Workshop' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: add htmlhelp to path + run: Write-Output 'C:\Program Files (x86)\HTML Help Workshop' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: compile chm shell: bash