|
| 1 | +name: chm |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - develop |
| 8 | + paths-ignore: |
| 9 | + - 'doc/**' |
| 10 | + - 'Version3/**' |
| 11 | + - 'README.md' |
| 12 | + pull_request: |
| 13 | + branches: |
| 14 | + - master |
| 15 | + - develop |
| 16 | + paths-ignore: |
| 17 | + - 'doc/**' |
| 18 | + - 'Version3/**' |
| 19 | + - 'README.md' |
| 20 | + schedule: |
| 21 | + - cron: '1 2 2/7 * *' |
| 22 | + workflow_dispatch: |
| 23 | + |
| 24 | +jobs: |
| 25 | + build-chm: |
| 26 | + runs-on: windows-latest |
| 27 | + steps: |
| 28 | + |
| 29 | + - name: '🧰 Checkout' |
| 30 | + uses: actions/checkout@v4 |
| 31 | + |
| 32 | + - name: 'fixup_html' |
| 33 | + shell: bash |
| 34 | + working-directory: ${{ github.workspace }}/HTMLversion/HTML |
| 35 | + run: ./fixup_html.bash |
| 36 | + |
| 37 | + - name: cache htmlhelp |
| 38 | + id: cache-htmlhelp |
| 39 | + uses: actions/cache@v4 |
| 40 | + with: |
| 41 | + path: "C:/Program Files (x86)/HTML Help Workshop" |
| 42 | + key: ${{ runner.os }}-htmlhelp |
| 43 | + |
| 44 | + - name: install htmlhelp |
| 45 | + if: steps.cache-htmlhelp.outputs.cache-hit != 'true' |
| 46 | + timeout-minutes: 5 |
| 47 | + run: | |
| 48 | + 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 |
| 49 | + cmd /c start /wait .\htmlhelp.exe /q /c /t:$(Get-Location)\tmp |
| 50 | + $file = "$(Get-Location)\tmp\htmlhelp.inf" |
| 51 | + (Get-Content $file) | Foreach-Object { $_ ` |
| 52 | + -replace '^BeginPrompt', ';;BeginPrompt' ` |
| 53 | + -replace '^EndPrompt', ';;EndPrompt' ` |
| 54 | + -replace '^49000=CustomLDID49000, 1', '49000=CustomLDID49000, 5' ` |
| 55 | + -replace '^"hhupd.exe', ';;hhupd.exe' ` |
| 56 | + -replace '^DefaultInstallDir="C:\\Program Files\\HTML Help Workshop"', 'DefaultInstallDir="%ProgramFiles%\\HTML Help Workshop"' |
| 57 | + } | Set-Content $file |
| 58 | + cmd /c start /wait .\tmp\setup.exe |
| 59 | + Remove-Item -Recurse -Force .\tmp |
| 60 | + Remove-Item -Recurse -Force .\htmlhelp.exe |
| 61 | +
|
| 62 | + - name: add htmlhelp to path |
| 63 | + run: Write-Output 'C:\Program Files (x86)\HTML Help Workshop' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append |
| 64 | + |
| 65 | + - name: compile chm |
| 66 | + shell: bash |
| 67 | + working-directory: ${{ github.workspace }}/HTMLversion |
| 68 | + run: | |
| 69 | + # hhc returns 1 on success |
| 70 | + set +e |
| 71 | + hhc phreeqc3.hhp | tee hhc.out |
| 72 | + status=${PIPESTATUS[0]} |
| 73 | + set -e |
| 74 | + if [ "$status" -eq 1 ]; then |
| 75 | + echo "[OK]" |
| 76 | + exit 0 |
| 77 | + else |
| 78 | + echo "[FAILED]" |
| 79 | + exit 1 |
| 80 | + fi |
| 81 | +
|
| 82 | + - uses: actions/upload-artifact@v4 |
| 83 | + with: |
| 84 | + name: chm |
| 85 | + path: ${{github.workspace}}/HTMLversion/phreeqc3.chm |
0 commit comments