| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- name: build
- on:
- push:
- workflow_dispatch:
- env:
- HOME: "${{github.workspace}}\\home"
- jobs:
- build:
- # Only set the topic `has-issrc-build-env` if the secrets are available
- if: contains(github.event.repository.topics, 'has-issrc-build-env') && github.ref != 'refs/heads/copilot-review'
- runs-on: windows-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- with:
- submodules: true
- - name: Setup MSBuild
- uses: microsoft/setup-msbuild@v2
- - name: Initialize build environment
- env:
- ISSRC_BUILD_ENV_ZIP_PASSWORD: ${{ secrets.ISSRC_BUILD_ENV_ZIP_PASSWORD }}
- ISSRC_BUILD_ENV_ZIP_URL: ${{ secrets.ISSRC_BUILD_ENV_ZIP_URL }}
- run: |
- (New-Object Net.WebClient).DownloadFile($env:ISSRC_BUILD_ENV_ZIP_URL, "issrc-build-env.zip")
- & "C:\\Program Files\\7-Zip\\7z.exe" x -oissrc-build-env -p"$env:ISSRC_BUILD_ENV_ZIP_PASSWORD" issrc-build-env.zip
- if (!(Test-Path issrc-build-env\bin\dcc32.exe)) {
- Write-Host "Failed to extract dcc32.exe"
- Exit 1
- }
- Remove-Item issrc-build-env.zip
- $DELPHIXEROOT = (Get-Item .\issrc-build-env).FullName
- "DELPHIXEROOT=$DELPHIXEROOT" | Out-File -NoNewline -Encoding ascii -Append "$env:GITHUB_ENV"
- "set BDS=$DELPHIXEROOT" | Out-File -Encoding ascii issrc-build-env\bin\rsvars.bat
- "set BDSCOMMONDIR=$DELPHIXEROOT" | Out-File -NoNewline -Encoding ascii -Append issrc-build-env\bin\rsvars.bat
- - name: Configure build
- run: |
- "set DELPHIXEROOT=$env:DELPHIXEROOT" | Out-File -Encoding ascii compilesettings.bat
- "set ISSIGTOOL_KEY_FILE=${{github.workspace}}\mykey.isprivatekey" | Out-File -NoNewline -Encoding ascii -Append compilesettings.bat
- "set HHCEXE=%ProgramFiles(x86)%\HTML Help Workshop\hhc.exe" | Out-File -NoNewline -Encoding ascii ISHelp\compilesettings.bat
- - name: Build issrc
- run: |
- .\build.bat
- - name: Clean up temporary files
- if: always()
- shell: bash
- run: |
- rm -rf mykey.isprivatekey
- - name: Copy license.txt into all artifacts
- run: |
- copy license.txt Files
- copy license.txt Output
- copy license.txt ISHelp/Staging
- - name: Upload Files/
- uses: actions/upload-artifact@v4
- with:
- name: Files
- path: Files/
- - name: Upload Output/
- uses: actions/upload-artifact@v4
- with:
- name: Output
- path: Output/
- - name: Upload ISHelp/
- uses: actions/upload-artifact@v4
- with:
- name: ISHelp
- path: |
- ISHelp/Staging/
- ISHelp/Staging-dark/
- - name: Find mt.exe
- if: contains(github.event.repository.topics, 'issrc-build-verify')
- shell: bash
- run: |
- set -x &&
- mt=$(ls -t /c/Program\ Files*/Windows\ Kits/10/bin/*/x64/mt.exe) &&
- test -n "$mt" &&
- echo "${mt%%/mt.exe*}" >>$GITHUB_PATH
- - name: Verify installer
- if: contains(github.event.repository.topics, 'issrc-build-verify')
- shell: bash
- run: |
- set -x &&
- ver="$(sed -n 's/^set VER=//p' <build.bat)" &&
- mt '-inputresource:Output\innosetup-'$ver.exe -out:innosetup-$ver.manifest &&
- cat innosetup-$ver.manifest &&
- mkdir -p Output/innosetup-$ver.exe.Local &&
- cp -R "$(cygpath -au "$SYSTEMROOT")"/WinSxS/x86_microsoft.windows.common-controls_* Output/innosetup-$ver.exe.Local/ &&
- mkdir Output/innosetup-$ver.en-US &&
- mkdir Output/innosetup-$ver.en &&
- mkdir Output/innosetup-$ver.ENU &&
- mkdir -p trace &&
- echo "$ver" >trace/ver &&
- curl -LO https://download.sysinternals.com/files/ProcessMonitor.zip &&
- unzip ProcessMonitor.zip &&
- # Need to start the background process via PowerShell because it would
- # block for some reason if started as a Bash background process.
- powershell -command 'start-process -NoNewWindow -FilePath .\Procmon.exe -ArgumentList "-AcceptEula -Quiet -BackingFile trace/procmon.pml -RunTime 60"' &&
- test $? = 0 &&
- ps -W &&
- ./Procmon.exe -AcceptEula -WaitForIdle &&
- ./Output/innosetup-$ver.exe //verysilent //dir=InnoSetup //noicons \
- //tasks= //portable=1 &&
- test -x InnoSetup/ISCC.exe &&
- ./Procmon.exe -Terminate -Quiet &&
- powershell -command 'start-process -NoNewWindow -Wait -FilePath .\Procmon.exe -ArgumentList "-OpenLog trace\procmon.pml -SaveAs trace\procmon.csv"'
- - name: Upload trace
- if: contains(github.event.repository.topics, 'issrc-build-verify')
- uses: actions/upload-artifact@v4
- with:
- name: trace
- path: trace/
- - name: Check trace
- if: contains(github.event.repository.topics, 'issrc-build-verify')
- shell: bash
- run: |
- set -x &&
- curdir="$(cygpath -aw Output | sed 's/\\/&&/g')" &&
- ver="$(sed 's/\./\\&/g' <trace/ver)" &&
- sed -ne '/"'$curdir'\\innosetup-'$ver'\.\(exe\|exe\.Config\|en-US\|en\|ENU\|EN\)"/d' \
- -e '/"System","[0-9]*","\(CreateFileMapping\|FASTIO_[A-Z_]*\)"/d' -e '/"'$curdir'\\/p' \
- trace/procmon.csv >trace/filtered.csv &&
- if test -s trace/filtered.csv
- then
- echo ":error:Unexpected filesystem access" >&2
- cat trace/filtered.csv >&2
- exit 1
- fi
|