release.yml had grown thirteen inline shell and PowerShell blocks, some of them twenty lines, which made the workflow hard to read and impossible to lint or run outside Actions. Each one is now a file under scripts/ci and the workflow only wires them up. Two things fall out of the move rather than being separate changes. The two signing steps were near-duplicates and are now one sign-binaries.ps1 taking a path list, used for both the packaged binaries and the finished installer. The pinned Inno Setup language file URL and checksum move to the packaging job's env, where they read as configuration instead of being buried mid-script. The Server job now checks this repository out into automation/ for its two scripts. That checkout has to come after the MSIME-Server one, because checkout cleans its destination and the workspace root would take automation/ with it. shellcheck is clean on all six shell scripts. The PowerShell is not syntax-checked here for lack of pwsh, but four of the seven are verbatim from steps that already ran green in run 33953797415.
36 lines
1.3 KiB
PowerShell
36 lines
1.3 KiB
PowerShell
# Give the compiled installer its final name, record its checksum and summarise the build.
|
|
#
|
|
# Inno Setup names the output from MyAppVersion alone; unsigned builds get a suffix here so the
|
|
# published asset says what it is.
|
|
#
|
|
# Requires TARGET_VERSION, ASSET_SUFFIX, DICTIONARY_TAG. Run from the installer directory.
|
|
# Writes asset_path, asset_name and asset_sha256 to GITHUB_OUTPUT.
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$built = "Output/MetasequoiaIME_Setup_v$env:TARGET_VERSION.exe"
|
|
if (-not (Test-Path $built)) { throw "Inno Setup did not produce $built" }
|
|
|
|
$final = "Output/MetasequoiaIME_Setup_v$env:TARGET_VERSION$env:ASSET_SUFFIX.exe"
|
|
if ($built -ne $final) { Move-Item $built $final -Force }
|
|
|
|
$hash = (Get-FileHash $final -Algorithm SHA256).Hash.ToLower()
|
|
$size = [math]::Round((Get-Item $final).Length / 1MB, 1)
|
|
$name = Split-Path $final -Leaf
|
|
|
|
"asset_path=$((Resolve-Path $final).Path)" >> $env:GITHUB_OUTPUT
|
|
"asset_name=$name" >> $env:GITHUB_OUTPUT
|
|
"asset_sha256=$hash" >> $env:GITHUB_OUTPUT
|
|
|
|
@(
|
|
'### Installer'
|
|
''
|
|
'| Field | Value |'
|
|
'| --- | --- |'
|
|
"| File | $name |"
|
|
"| Size | $size MB |"
|
|
"| SHA256 | ``$hash`` |"
|
|
"| Dictionaries | $env:DICTIONARY_TAG |"
|
|
) | Add-Content -Path $env:GITHUB_STEP_SUMMARY
|
|
|
|
Write-Host "$name ($size MB, sha256 $hash)"
|