Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Starting chm build #50

Merged
merged 5 commits into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/chm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
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

- name: 'fixup_html'
shell: bash
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

- 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
working-directory: ${{ github.workspace }}/HTMLversion
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