release.yml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. # Release build of LYNX SHARE for Windows, macOS and Linux.
  2. #
  3. # Every published binary comes from this workflow, built from the tagged source on GitHub-hosted
  4. # runners, so anyone can trace a binary back to the commit and the run that produced it
  5. # (a requirement of the SignPath Foundation code signing program; see docs/CODE_SIGNING.md).
  6. #
  7. # version (ubuntu) reads the version (CMakeLists.txt) and the package label
  8. # build (ubuntu) cross-compiles LYNX.exe with Zig 0.14.1 + JUCE 8.0.4 (scripts/build-windows-zig.sh)
  9. # sign (ubuntu) SignPath signing request; skipped until the repository variable SIGNPATH_ENABLED is 'true'
  10. # package (windows) runs the self-test on the (signed) exe, builds Demo.lynx, the portable zip, the per-user
  11. # installer (NSIS, resources/installer/LYNX.nsi) and the Microsoft Store package (MSIX,
  12. # docs/STORE.md), which it installs and self-tests with a test identity
  13. # linux (ubuntu) CMake + GCC 13 build in an Ubuntu 22.04 container (glibc 2.35), glibc check, self-test,
  14. # AppImage and .tar.gz (scripts/package-linux.sh), offline start check of the AppImage
  15. # macos (macos) macos-app.yml: arm64 and x86_64 built on two runners in parallel, merged with lipo (round 190qd),
  16. # self-test, ad-hoc signature (no Apple Developer ID, not notarized), .dmg (scripts/package-macos.sh)
  17. # linux-arm64 linux-arm64.yml on GitHub's arm64 runner: the Linux job's steps for aarch64 (round 190oy),
  18. # LYNX-<label>-aarch64.AppImage and LYNX-<label>-linux-aarch64.tar.gz. publish waits for it and
  19. # takes its files when it passed; a failure there does not hold back the other platforms
  20. # publish (ubuntu) SHA256SUMS.txt over every file; on a tag push attaches everything to the (draft) GitHub release
  21. # plugins the optional plugin download (plugins.yml: LYNX's effects as CLAP + a short VST3 list for Windows,
  22. # Linux and macOS, each checked with plugexporttest, pluginval and clap-validator); never in the
  23. # app's installer, and the app's release doesn't wait for it
  24. # plugins-publish on a tag push attaches LYNX-Plugins-<label>-* (with their own SHA256SUMS file) to the same release
  25. # store (ubuntu) on a tag: only a notice. CI no longer submits to the Microsoft Store (the old package-only submission
  26. # reused outdated listings and failed certification); the full submission is made locally (docs/STORE.md)
  27. name: Release
  28. on:
  29. push:
  30. tags: ['v*']
  31. workflow_dispatch:
  32. inputs:
  33. store_build:
  34. description: 'MSIX store build 0..9 (a repackaged Store resubmission of the same release; scripts/make-msix-layout.py)'
  35. default: '0'
  36. permissions:
  37. contents: read
  38. concurrency:
  39. group: release-${{ github.ref }}
  40. cancel-in-progress: false
  41. env:
  42. ZIG_VERSION: 0.14.1
  43. ZIG_SHA256: 24aeeec8af16c381934a6cd7d95c807a8cb2cf7df9fa40d359aa884195c4716c
  44. JUCE_VERSION: 8.0.4
  45. JUCE_SHA256: 0effe9823a6fd8a4f98e5c08be7d308350e417b2d15dcf34011e778fefbbf005
  46. jobs:
  47. version:
  48. name: Version
  49. runs-on: ubuntu-24.04
  50. outputs:
  51. version: ${{ steps.version.outputs.version }}
  52. label: ${{ steps.version.outputs.label }}
  53. steps:
  54. - uses: actions/checkout@v5
  55. - name: 'Version (single source is CMakeLists.txt)'
  56. id: version
  57. shell: bash
  58. run: |
  59. version="$(sed -n 's/^project(LYNX VERSION \([0-9]*\.[0-9]*\.[0-9]*\(\.[0-9]*\)\{0,1\}\).*/\1/p' CMakeLists.txt)"
  60. [[ -n "$version" ]] || { echo "::error::no version in CMakeLists.txt"; exit 1; }
  61. if [[ "$GITHUB_REF_TYPE" == tag ]]; then
  62. tag="${GITHUB_REF_NAME#v}"
  63. [[ "$tag" == "$version" || "$tag" == "$version"-* ]] || { echo "::error::tag $GITHUB_REF_NAME does not match version $version"; exit 1; }
  64. label="$tag"
  65. else
  66. label="$version-${GITHUB_SHA::7}"
  67. fi
  68. echo "version=$version" >> "$GITHUB_OUTPUT"
  69. echo "label=$label" >> "$GITHUB_OUTPUT"
  70. echo "LYNX $version (package label $label)"
  71. build:
  72. name: Build LYNX.exe
  73. needs: version
  74. runs-on: ubuntu-24.04
  75. outputs:
  76. artifact-id: ${{ steps.upload.outputs.artifact-id }}
  77. steps:
  78. - uses: actions/checkout@v5
  79. # Only the downloaded toolchain is cached (checksums verified on download); the app is always built from scratch.
  80. - name: Cache toolchain
  81. id: cache
  82. uses: actions/cache@v5
  83. with:
  84. path: ~/opt
  85. key: toolchain-zig${{ env.ZIG_VERSION }}-juce${{ env.JUCE_VERSION }}-${{ env.ZIG_SHA256 }}-${{ env.JUCE_SHA256 }}
  86. - name: Download Zig and JUCE
  87. if: steps.cache.outputs.cache-hit != 'true'
  88. shell: bash
  89. run: |
  90. mkdir -p ~/opt && cd ~/opt
  91. curl -fsSL -o zig.tar.xz "https://ziglang.org/download/$ZIG_VERSION/zig-x86_64-linux-$ZIG_VERSION.tar.xz"
  92. echo "$ZIG_SHA256 zig.tar.xz" | sha256sum -c -
  93. tar xf zig.tar.xz && rm zig.tar.xz
  94. curl -fsSL -o juce.tar.gz "https://github.com/juce-framework/JUCE/archive/refs/tags/$JUCE_VERSION.tar.gz"
  95. echo "$JUCE_SHA256 juce.tar.gz" | sha256sum -c -
  96. tar xzf juce.tar.gz && mv "JUCE-$JUCE_VERSION" "juce-$JUCE_VERSION" && rm juce.tar.gz
  97. # Release code generation (round 190kz, owner decision; docs/PLATFORMS.md "Release optimisation"): a real -O3
  98. # (zig maps -O3 to -O2, so the -O3 goes to clang itself) and ThinLTO of LYNX's own objects; the instruction set
  99. # stays the x86-64 baseline (SSE2), the hottest loops pick AVX2 at run time (src/core/CpuFeatures.h). About
  100. # 8 more minutes of link on the runner; Harmless.cpp stays out of LTO (LYNX_WIN_LTO_SKIP, measured)
  101. - name: Build (Zig cross compile)
  102. shell: bash
  103. env:
  104. LYNX_WIN_OPT: -O2 -Xclang -O3
  105. LYNX_WIN_LTO: thin
  106. # JOBS=2 (queue 0.1.31 item 46, as plugins.yml and round-build.yml): the hosted runner is memory-bound (round 190ov
  107. # measured 11.2 / 16 GB + 2.5 / 3 GB swap at two compiles); one per core ran it out of memory ("lost communication")
  108. run: |
  109. ZIG="$HOME/opt/zig-x86_64-linux-$ZIG_VERSION/zig" JUCE_DIR="$HOME/opt/juce-$JUCE_VERSION" OUT=build-win JOBS=2 \
  110. ./scripts/build-windows-zig.sh 2>&1 | grep -v '^1 warning generated\.$'
  111. sha256sum build-win/LYNX.exe
  112. ./scripts/fetch-onnxruntime.sh windows build-win
  113. - name: Upload unsigned LYNX.exe
  114. id: upload
  115. uses: actions/upload-artifact@v7
  116. with:
  117. name: LYNX-unsigned
  118. path: |
  119. build-win/LYNX.exe
  120. build-win/lynx-asio.dll
  121. build-win/lynx-asio32.dll
  122. build-win/LYNX-bridge32.exe
  123. build-win/onnxruntime.dll
  124. if-no-files-found: error
  125. # the build's symbols (round 157a): a user's crash / hang file lists LYNX.exe+offset frames; with this LYNX.pdb
  126. # next to the same LYNX.exe, `LYNX.exe --symbolize <file> <out>` names them (signing does not change the offsets)
  127. - name: Upload symbols
  128. uses: actions/upload-artifact@v7
  129. with:
  130. name: LYNX-symbols
  131. path: build-win/LYNX.pdb
  132. retention-days: 90
  133. if-no-files-found: warn
  134. # ---------------------------------------------------------------------------------------------
  135. # SignPath code signing (docs/CODE_SIGNING.md). Build and signing are separate jobs: with the
  136. # release-signing policy (SignPath Foundation certificate) every request waits for a manual
  137. # approval in the SignPath web app; test-signing is approved automatically.
  138. # Settings:
  139. # repository secret SIGNPATH_API_TOKEN API token of the SignPath CI user (submitter role)
  140. # repository variable SIGNPATH_ORGANIZATION_ID organization id shown in the SignPath web app
  141. # repository variable SIGNPATH_PROJECT_SLUG project slug (default: LYNX)
  142. # repository variable SIGNPATH_POLICY_SLUG signing policy slug (default: release-signing)
  143. # repository variable SIGNPATH_ENABLED 'true' to switch this job on
  144. # ---------------------------------------------------------------------------------------------
  145. sign:
  146. name: Sign (SignPath)
  147. needs: build
  148. if: vars.SIGNPATH_ENABLED == 'true'
  149. runs-on: ubuntu-24.04
  150. timeout-minutes: 355 # GitHub-hosted jobs stop at 6 h
  151. permissions:
  152. actions: read # SignPath reads the job details and downloads the unsigned artifact
  153. contents: read
  154. steps:
  155. - name: Submit signing request
  156. uses: signpath/github-action-submit-signing-request@v2
  157. with:
  158. api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
  159. organization-id: ${{ vars.SIGNPATH_ORGANIZATION_ID }}
  160. project-slug: ${{ vars.SIGNPATH_PROJECT_SLUG || 'LYNX' }}
  161. signing-policy-slug: ${{ vars.SIGNPATH_POLICY_SLUG || 'release-signing' }}
  162. github-artifact-id: ${{ needs.build.outputs.artifact-id }}
  163. wait-for-completion: true
  164. wait-for-completion-timeout-in-seconds: 20700 # a release request waits up to 5 h 45 min for the manual approval
  165. output-artifact-directory: signed
  166. - name: Upload signed LYNX.exe
  167. uses: actions/upload-artifact@v7
  168. with:
  169. name: LYNX-signed
  170. path: |
  171. signed/LYNX.exe
  172. signed/lynx-asio.dll
  173. signed/lynx-asio32.dll
  174. signed/LYNX-bridge32.exe
  175. signed/onnxruntime.dll
  176. if-no-files-found: error
  177. package:
  178. name: Self-test and package
  179. needs: [version, build, sign]
  180. if: ${{ !cancelled() && needs.build.result == 'success' && (needs.sign.result == 'success' || needs.sign.result == 'skipped') }}
  181. runs-on: windows-latest
  182. env:
  183. LABEL: ${{ needs.version.outputs.label }}
  184. VERSION: ${{ needs.version.outputs.version }}
  185. steps:
  186. - uses: actions/checkout@v5
  187. - name: Download LYNX.exe
  188. uses: actions/download-artifact@v8
  189. with:
  190. name: ${{ needs.sign.result == 'success' && 'LYNX-signed' || 'LYNX-unsigned' }}
  191. path: bin
  192. - name: Check version resource and signature
  193. shell: pwsh
  194. run: |
  195. $exe = Get-Item bin\LYNX.exe
  196. $v = $exe.VersionInfo
  197. $v | Format-List ProductName, CompanyName, FileVersion, ProductVersion, LegalCopyright
  198. if ($v.ProductName -ne 'LYNX SHARE' -or $v.ProductVersion -ne $env:VERSION) { throw "version resource mismatch" }
  199. $sig = Get-AuthenticodeSignature $exe.FullName
  200. "Authenticode: $($sig.Status) $($sig.SignerCertificate.Subject)"
  201. if ('${{ needs.sign.result }}' -eq 'success') {
  202. # the test-signing policy signs with SignPath's self-signed test certificate: Windows does not trust it
  203. # (status UnknownError/NotTrusted), so only check that a signature from that certificate is present
  204. if ('${{ vars.SIGNPATH_POLICY_SLUG }}' -eq 'test-signing') {
  205. if ($sig.Status -eq 'NotSigned' -or $sig.SignerCertificate.Subject -notmatch 'Test certificate') { throw "test-signed build carries no test signature" }
  206. } elseif ($sig.Status -ne 'Valid') { throw "signed build is not validly signed" }
  207. }
  208. - name: Self-test
  209. shell: pwsh
  210. run: |
  211. $p = Start-Process bin\LYNX.exe -ArgumentList '--selftest', "$PWD\selftest.txt", "$PWD\selftest-demo.lynx" -Wait -PassThru
  212. Get-Content selftest.txt
  213. if ($p.ExitCode -ne 0 -or -not (Select-String -Path selftest.txt -Pattern '^result=OK' -Quiet)) { throw "self-test failed (exit $($p.ExitCode))" }
  214. # every built-in effect / instrument window opened as the mixer and Channel rack open them, with old-project and
  215. # random states; fails on a crash or a frozen UI (round 157a: the Parametric EQ froze LYNX when opened)
  216. - name: Editor windows test
  217. shell: pwsh
  218. run: |
  219. $p = Start-Process bin\LYNX.exe -ArgumentList '--opentest', "$PWD\opentest.txt" -Wait -PassThru
  220. Get-Content opentest.txt -Tail 5
  221. if ($p.ExitCode -ne 0 -or -not (Select-String -Path opentest.txt -Pattern '^result=OK' -Quiet)) { Get-Content opentest.txt | Select-String -Pattern 'FAIL|HANG'; throw "editor windows test failed (exit $($p.ExitCode))" }
  222. - name: Portable package and installer
  223. shell: pwsh
  224. run: |
  225. $name = "LYNX-$env:LABEL-windows-x64"
  226. New-Item -ItemType Directory -Force "pkg\$name" | Out-Null
  227. $p = Start-Process bin\LYNX.exe -ArgumentList '--showcase', "$PWD\pkg\$name\Demo.lynx" -Wait -PassThru
  228. if (-not (Test-Path "pkg\$name\Demo.lynx")) { throw "showcase did not write Demo.lynx (exit $($p.ExitCode))" }
  229. Copy-Item bin\LYNX.exe, bin\onnxruntime.dll, LICENSE, THIRD_PARTY.md, PRIVACY.md "pkg\$name\"
  230. # the third-party licence texts (round 190nk): Git for Windows' bash runs the same script as the other packages
  231. & "$env:ProgramFiles\Git\bin\bash.exe" scripts/collect-licenses.sh "pkg/$name/licenses"
  232. if ($LASTEXITCODE -ne 0 -or -not (Test-Path "pkg\$name\licenses\ara-ARA_API-LICENSE.txt")) { throw "collect-licenses failed" }
  233. # LYNX ASIO driver and its registration helpers (REA round 97)
  234. if (Test-Path bin\lynx-asio.dll) { Copy-Item bin\lynx-asio.dll, "asio\Register LYNX ASIO.bat", "asio\Unregister LYNX ASIO.bat" "pkg\$name\" }
  235. if (Test-Path bin\lynx-asio32.dll) { Copy-Item bin\lynx-asio32.dll "pkg\$name\" } # 32-bit hosts (round 106)
  236. Copy-Item bin\LYNX-bridge32.exe "pkg\$name\" # 32-bit plugins run in it (round 176a)
  237. New-Item -ItemType Directory -Force dist | Out-Null
  238. Compress-Archive -Path "pkg\$name" -DestinationPath "dist\$name.zip"
  239. Copy-Item bin\LYNX.exe dist\
  240. # per-user installer (NSIS is preinstalled on GitHub's Windows images)
  241. $nsis = (Get-Command makensis -ErrorAction SilentlyContinue).Source
  242. if (-not $nsis) { $nsis = "${env:ProgramFiles(x86)}\NSIS\makensis.exe" }
  243. if (-not (Test-Path $nsis)) { choco install nsis -y --no-progress; $nsis = "${env:ProgramFiles(x86)}\NSIS\makensis.exe" }
  244. $vi = if (($env:VERSION -split '\.').Count -ge 4) { $env:VERSION } else { "$env:VERSION.0" } # (a hotfix: 0.1.31.1)
  245. & $nsis -V2 -INPUTCHARSET UTF8 "-DVERSION=$env:VERSION" "-DVIVERSION=$vi" "-DSTAGE=$PWD\pkg\$name" "-DOUTFILE=$PWD\dist\LYNX-$env:LABEL-setup-x64.exe" `
  246. "-DICON=$PWD\resources\LYNX.ico" resources\installer\LYNX.nsi
  247. if ($LASTEXITCODE -ne 0) { throw "makensis failed ($LASTEXITCODE)" }
  248. # the installer installs and uninstalls cleanly (per user, into a scratch folder)
  249. $inst = "$env:RUNNER_TEMP\lynx-inst"
  250. Start-Process "dist\LYNX-$env:LABEL-setup-x64.exe" -ArgumentList '/S', "/D=$inst" -Wait
  251. if (-not (Test-Path "$inst\LYNX.exe")) { throw "installer did not install LYNX.exe" }
  252. # round 190nr: installing over a NEWER version removes what that version's installed-files.txt lists and this
  253. # version doesn't own (resources/installer/InstalledFiles.nsh); files that no list names stay
  254. if (-not (Test-Path "$inst\installed-files.txt")) { throw "installer did not write installed-files.txt" }
  255. New-Item -ItemType Directory "$inst\newer-only" | Out-Null; Set-Content "$inst\newer-only\a.txt" "x"
  256. Set-Content "$inst\My notes.txt" "x"; Add-Content "$inst\installed-files.txt" "newer-only"
  257. Start-Process "dist\LYNX-$env:LABEL-setup-x64.exe" -ArgumentList '/S', "/D=$inst" -Wait
  258. if (Test-Path "$inst\newer-only") { throw "install over a newer version left its newer-only folder" }
  259. if (-not (Test-Path "$inst\My notes.txt")) { throw "the installer removed a file no list names" }
  260. Remove-Item "$inst\My notes.txt"
  261. Start-Process "$inst\Uninstall.exe" -ArgumentList '/S', "_?=$inst" -Wait
  262. if (Test-Path "$inst\LYNX.exe") { throw "uninstaller left LYNX.exe" }
  263. # Microsoft Store package (round 165n, docs/STORE.md): an unsigned .msix the Store signs after certification.
  264. # Its identity comes from Partner Center (Product identity) through repository variables; placeholders until then.
  265. - name: Microsoft Store package (MSIX)
  266. shell: pwsh
  267. continue-on-error: true # (new in 0.1.20: must not hold back the other packages; the step's result shows)
  268. env:
  269. MSIX_IDENTITY_NAME: ${{ vars.MSIX_IDENTITY_NAME }}
  270. MSIX_PUBLISHER: ${{ vars.MSIX_PUBLISHER }}
  271. MSIX_PUBLISHER_DISPLAY: ${{ vars.MSIX_PUBLISHER_DISPLAY }}
  272. MSIX_DISPLAY_NAME: ${{ vars.MSIX_DISPLAY_NAME }}
  273. MSIX_STORE_BUILD: ${{ inputs.store_build || '0' }}
  274. run: |
  275. $sdk = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.*\x64\makeappx.exe" | Sort-Object { [version]$_.Directory.Parent.Name } | Select-Object -Last 1
  276. if (-not $sdk) { throw "Windows SDK (makeappx) not found" }
  277. $tools = $sdk.DirectoryName; "Windows SDK tools: $tools"
  278. $demo = "pkg\LYNX-$env:LABEL-windows-x64\Demo.lynx"
  279. function Pack($layout, $out, [switch]$test) {
  280. $a = @('scripts\make-msix-layout.py', '--version', $env:VERSION, '--bin', 'bin', '--out', $layout, '--extra', $demo, 'LICENSE', 'THIRD_PARTY.md', 'PRIVACY.md', "pkg\LYNX-$env:LABEL-windows-x64\licenses")
  281. if ($test) { $a += '--test-identity' }
  282. python @a; if ($LASTEXITCODE -ne 0) { throw "make-msix-layout failed" }
  283. & "$tools\makepri.exe" createconfig /cf "$layout.priconfig.xml" /dq en-US_pt-BR_es-ES_fr-FR_de-DE_it-IT_nl-NL_pl-PL_ru-RU_tr-TR_id-ID_ja-JP_ko-KR_zh-CN_zh-TW /pv 10.0.0 /o | Out-Null
  284. if ($LASTEXITCODE -ne 0) { throw "makepri createconfig failed" }
  285. & "$tools\makepri.exe" new /pr $layout /cf "$layout.priconfig.xml" /of "$layout\resources.pri" /o
  286. if ($LASTEXITCODE -ne 0) { throw "makepri new failed" }
  287. & "$tools\makeappx.exe" pack /d $layout /p $out /o
  288. if ($LASTEXITCODE -ne 0) { throw "makeappx pack failed" }
  289. }
  290. New-Item -ItemType Directory -Force msix | Out-Null
  291. Pack 'msix\store' "dist\LYNX-$env:LABEL-store.msix"
  292. Pack 'msix\test' 'msix\LYNX-test.msix' -test
  293. Get-Item "dist\LYNX-$env:LABEL-store.msix", 'msix\LYNX-test.msix' | Format-Table Name, Length
  294. # the package installed for real (the test identity carries Windows' "unsigned" publisher OID, so it installs
  295. # without a certificate) and LYNX run inside it: package identity, settings folder on the real disk (what
  296. # Explorer opens), the self-test; then removed
  297. - name: MSIX install test
  298. shell: pwsh
  299. continue-on-error: true
  300. run: |
  301. # the package depends on Microsoft's VC++ runtime framework (onnxruntime.dll): the Store installs it, here we do
  302. Invoke-WebRequest https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile msix\vclibs.appx
  303. Add-AppxPackage -Path msix\LYNX-test.msix -AllowUnsigned -DependencyPath msix\vclibs.appx
  304. $pkg = Get-AppxPackage | Where-Object { $_.Name -eq ([xml](Get-Content msix\test\AppxManifest.xml)).Package.Identity.Name } | Select-Object -First 1
  305. if (-not $pkg) { throw "package not installed" }
  306. "installed: $($pkg.PackageFullName) at $($pkg.InstallLocation)"
  307. try {
  308. $alias = "$env:LOCALAPPDATA\Microsoft\WindowsApps\lynx.exe"
  309. if (-not (Test-Path $alias)) { throw "execution alias lynx.exe missing" }
  310. $p = Start-Process $alias -ArgumentList '--packageinfo', "$PWD\packageinfo.txt" -Wait -PassThru
  311. Get-Content packageinfo.txt
  312. if (-not (Select-String -Path packageinfo.txt -Pattern '^packaged=yes' -Quiet)) { throw "LYNX did not run with the package identity" }
  313. if (-not (Select-String -Path packageinfo.txt -Pattern '^result=OK' -Quiet)) { throw "packageinfo failed (exit $($p.ExitCode))" }
  314. $probe = "$env:LOCALAPPDATA\Packages\$($pkg.PackageFamilyName)\LocalCache\Roaming\LYNX\package-probe.txt"
  315. if (-not (Test-Path $probe)) { throw "the settings folder is not on the real disk: $probe" }
  316. "seen from outside the package: $probe"
  317. $p = Start-Process $alias -ArgumentList '--selftest', "$PWD\msix-selftest.txt", "$PWD\msix-selftest.lynx" -Wait -PassThru
  318. Get-Content msix-selftest.txt -Tail 3
  319. if ($p.ExitCode -ne 0 -or -not (Select-String -Path msix-selftest.txt -Pattern '^result=OK' -Quiet)) { throw "self-test inside the package failed (exit $($p.ExitCode))" }
  320. } finally {
  321. Remove-AppxPackage -Package $pkg.PackageFullName
  322. }
  323. if (Get-AppxPackage | Where-Object { $_.PackageFullName -eq $pkg.PackageFullName }) { throw "package not removed" }
  324. - name: Upload package
  325. uses: actions/upload-artifact@v7
  326. with:
  327. name: LYNX-${{ env.LABEL }}-windows-x64
  328. path: dist/*
  329. if-no-files-found: error
  330. # Built inside an Ubuntu 22.04 container (glibc 2.35, the oldest Ubuntu LTS in standard support, which the
  331. # AppImage catalog tests on): a binary only runs on systems whose glibc is at least as new as the one it was
  332. # built against. GCC 13 comes from the toolchain PPA; libstdc++/libgcc are linked statically (CMakeLists.txt),
  333. # so no newer C++ runtime is needed either. scripts/check-linux-compat.sh fails the job otherwise.
  334. linux:
  335. name: Linux (AppImage, tar.gz)
  336. needs: version
  337. runs-on: ubuntu-24.04
  338. container:
  339. image: ubuntu:22.04
  340. options: --cap-add=SYS_ADMIN # lets check-appimage-start.sh run the AppImage in a network namespace (offline)
  341. env:
  342. LABEL: ${{ needs.version.outputs.label }}
  343. DEBIAN_FRONTEND: noninteractive
  344. MAX_GLIBC: '2.35'
  345. steps:
  346. - name: Build dependencies (Ubuntu 22.04 + GCC 13 from ppa:ubuntu-toolchain-r/test)
  347. run: |
  348. # (round 190qd) Launchpad's PPA answered 503 on half the requests during the 0.1.31 release: apt retries
  349. echo 'Acquire::Retries "30";' > /etc/apt/apt.conf.d/80-lynx-retries
  350. apt-get update -q
  351. apt-get install -y -q --no-install-recommends ca-certificates curl git gnupg software-properties-common
  352. add-apt-repository -y ppa:ubuntu-toolchain-r/test
  353. apt-get update -q
  354. apt-get install -y -q gcc-13 g++-13 cmake ninja-build pkg-config file binutils xvfb xauth x11-utils \
  355. fonts-dejavu-core libasound2-dev libjack-jackd2-dev libx11-dev libxrandr-dev libxinerama-dev \
  356. libxcursor-dev libxext-dev libxcomposite-dev libfreetype-dev libfontconfig1-dev libgl-dev desktop-file-utils zsync
  357. ldd --version | head -1
  358. g++-13 --version | head -1
  359. - uses: actions/checkout@v5
  360. - name: JUCE (checksum verified)
  361. run: |
  362. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  363. curl -fsSL -o juce.tar.gz "https://github.com/juce-framework/JUCE/archive/refs/tags/$JUCE_VERSION.tar.gz"
  364. echo "$JUCE_SHA256 juce.tar.gz" | sha256sum -c -
  365. mkdir -p "$RUNNER_TEMP/juce" && tar xzf juce.tar.gz -C "$RUNNER_TEMP/juce" --strip-components 1 && rm juce.tar.gz
  366. - name: Build
  367. run: |
  368. cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DFETCHCONTENT_SOURCE_DIR_JUCE="$RUNNER_TEMP/juce" \
  369. -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13
  370. cmake --build build --target LYNX -- -k 0
  371. sha256sum build/LYNX_artefacts/Release/LYNX
  372. - name: Runs on glibc ${{ env.MAX_GLIBC }} without the system's libstdc++
  373. run: ./scripts/check-linux-compat.sh build/LYNX_artefacts/Release/LYNX "$MAX_GLIBC"
  374. - name: Self-test and demo project
  375. run: |
  376. bin=build/LYNX_artefacts/Release/LYNX
  377. xvfb-run -a "$bin" --selftest "$PWD/selftest.txt" "$PWD/selftest-demo.lynx" || true
  378. cat selftest.txt
  379. grep -q '^result=OK' selftest.txt
  380. xvfb-run -a "$bin" --opentest "$PWD/opentest.txt" || true
  381. tail -3 opentest.txt; grep -E 'FAIL|HANG' opentest.txt || true
  382. grep -q '^result=OK' opentest.txt
  383. xvfb-run -a "$bin" --showcase "$PWD/Demo.lynx" || true
  384. test -s Demo.lynx
  385. - name: Package
  386. run: ./scripts/package-linux.sh build/LYNX_artefacts/Release/LYNX "$LABEL" dist Demo.lynx
  387. # round 190rb: the package strips LYNX, so a Linux crash file's LYNX+offset frames had no names (the 0.1.29-0.1.31
  388. # reports could not be mapped). The symbol table of this same build, kept apart: `addr2line -f -C -e
  389. # LYNX-linux-x86_64.debug 0x<offset>` names a frame (the offsets are the same in the stripped package)
  390. - name: Keep the symbols
  391. run: objcopy --only-keep-debug build/LYNX_artefacts/Release/LYNX LYNX-linux-x86_64.debug
  392. - name: Upload symbols
  393. uses: actions/upload-artifact@v7
  394. with:
  395. name: LYNX-symbols-linux-x86_64
  396. path: LYNX-linux-x86_64.debug
  397. retention-days: 90
  398. if-no-files-found: warn
  399. # The catalog runs the AppImage offline for ~11 s and expects a window: start it without network (when the
  400. # container allows a network namespace), check that it is still running and shows a top-level window.
  401. - name: AppImage starts offline and shows its window
  402. run: REQUIRE_OFFLINE=1 ./scripts/check-appimage-start.sh "dist/LYNX-$LABEL-x86_64.AppImage"
  403. # issue #142 (NixOS): a system where JUCE finds no font at all; LYNX draws with the font it brings.
  404. - name: AppImage starts on a system without fonts
  405. run: FONTS=none ./scripts/check-appimage-start.sh "dist/LYNX-$LABEL-x86_64.AppImage"
  406. - name: Upload package
  407. uses: actions/upload-artifact@v7
  408. with:
  409. name: LYNX-${{ env.LABEL }}-linux-x86_64
  410. path: dist/*
  411. if-no-files-found: error
  412. # round 190qd: each architecture on its own runner, merged with lipo (one universal job compiled everything twice and
  413. # neared GitHub's 6 h job limit); see macos-app.yml
  414. macos:
  415. name: macOS
  416. needs: version
  417. permissions:
  418. contents: write # (macos-app.yml's attach job asks for it; it runs only on a manual run of macos-app.yml)
  419. uses: ./.github/workflows/macos-app.yml
  420. with:
  421. label: ${{ needs.version.outputs.label }}
  422. linux-arm64:
  423. name: Linux arm64
  424. needs: version
  425. uses: ./.github/workflows/linux-arm64.yml
  426. with:
  427. label: ${{ needs.version.outputs.label }}
  428. publish:
  429. name: Checksums and release
  430. needs: [version, package, linux, macos, linux-arm64]
  431. if: ${{ !cancelled() && needs.package.result == 'success' && needs.linux.result == 'success' && needs.macos.result == 'success' }}
  432. runs-on: ubuntu-24.04
  433. permissions:
  434. contents: write # attach the files to the release on a tag push
  435. env:
  436. LABEL: ${{ needs.version.outputs.label }}
  437. steps:
  438. - name: Download the packages
  439. uses: actions/download-artifact@v8
  440. with:
  441. pattern: LYNX-${{ env.LABEL }}-*
  442. path: dist
  443. merge-multiple: true
  444. # SPDX 2.3 software bill of materials of the third-party components (round 190nr): THIRD_PARTY.md + licenses/.
  445. - uses: actions/checkout@v5
  446. with:
  447. path: src
  448. - name: SBOM
  449. run: src/scripts/make-sbom.sh "$LABEL" "dist/LYNX-$LABEL-sbom.spdx.json"
  450. # The in-app updater (src/core/UpdateCheck.cpp, round 166b) picks the release files by these names: keep them stable.
  451. # LYNX-<label>-setup-x64.exe, LYNX-<label>-windows-x64.zip, LYNX-<label>-macos-universal.dmg (any *.dmg),
  452. # LYNX-<label>-x86_64.AppImage (+ .zsync; versions up to 0.1.24 find it by this name, later ones through scripts/publish-appimage-update.sh), LYNX-<label>-linux-x86_64.tar.gz,
  453. # LYNX-<label>-aarch64.AppImage (+ .zsync) and LYNX-<label>-linux-aarch64.tar.gz (Linux arm64, from 0.1.31),
  454. # and SHA256SUMS.txt, which every download is checked against (no SHA256SUMS.txt line = no update from that file).
  455. - name: SHA256SUMS
  456. run: |
  457. cd dist
  458. rm -f SHA256SUMS.txt
  459. sha256sum -- * > SHA256SUMS.txt
  460. cat SHA256SUMS.txt
  461. {
  462. echo "### After publishing this release"
  463. echo "Run \`scripts/publish-appimage-update.sh v$LABEL\`: until then, AppImage update checks keep offering the previous release."
  464. } >> "$GITHUB_STEP_SUMMARY"
  465. echo "::notice title=After publishing::Run scripts/publish-appimage-update.sh v$LABEL (AppImage update address)"
  466. - name: Upload all files
  467. uses: actions/upload-artifact@v7
  468. with:
  469. name: LYNX-${{ env.LABEL }}-all
  470. path: dist/*
  471. if-no-files-found: error
  472. - name: Attach to the GitHub release
  473. if: github.ref_type == 'tag'
  474. env:
  475. GH_TOKEN: ${{ github.token }}
  476. GH_REPO: ${{ github.repository }}
  477. run: |
  478. tag="$GITHUB_REF_NAME"
  479. if ! gh release view "$tag" > /dev/null 2>&1; then
  480. gh release create "$tag" --draft --prerelease --title "LYNX SHARE ${tag#v}" \
  481. --notes "Built from \`$GITHUB_SHA\` by [this workflow run]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)."
  482. fi
  483. gh release upload "$tag" dist/* --clobber
  484. # LYNX's plugins for other hosts (round 188b, docs/PLUGIN_EXPORT.md): a separate, optional download with its own
  485. # LYNX-Plugins-<label>-SHA256SUMS.txt. Its file names never end like the app's (the updater picks the app's by suffix).
  486. plugins:
  487. name: Plugins
  488. needs: version
  489. uses: ./.github/workflows/plugins.yml
  490. with:
  491. label: ${{ needs.version.outputs.label }}
  492. plugins-publish:
  493. name: Plugins on the release
  494. needs: [version, publish, plugins]
  495. if: ${{ !cancelled() && needs.publish.result == 'success' && needs.plugins.result == 'success' && github.ref_type == 'tag' }}
  496. runs-on: ubuntu-24.04
  497. permissions:
  498. contents: write # attach the files to the (draft) release that publish made
  499. env:
  500. LABEL: ${{ needs.version.outputs.label }}
  501. steps:
  502. - uses: actions/download-artifact@v8
  503. with:
  504. name: LYNX-Plugins-${{ env.LABEL }}-all
  505. path: dist
  506. - name: Attach to the GitHub release
  507. env:
  508. GH_TOKEN: ${{ github.token }}
  509. GH_REPO: ${{ github.repository }}
  510. run: |
  511. ls -la dist
  512. gh release upload "$GITHUB_REF_NAME" dist/LYNX-Plugins-* --clobber
  513. # Microsoft Store: DISABLED in CI (round 190ij, queue item 23). This job used to run `msstore publish`, which clones the
  514. # last published submission and swaps only the package. That reused the old 0.1.22 listings and the old pepper icon,
  515. # and certification failed (10.1.1.11 On Device Tiles, 10.1.1.3 Inaccurate Representation). The working path is a full
  516. # submission (15 listings, images, certification note) made by the maintainer's local scripts (submit.sh +
  517. # build_body.py, Partner Center API) after the release is published; see docs/STORE.md > Automatic Store submission.
  518. # The job therefore creates NO submission and touches no Store secret; it only prints a reminder on a tag run.
  519. store:
  520. name: Microsoft Store submission (manual)
  521. needs: [version, publish]
  522. if: ${{ !cancelled() && needs.publish.result == 'success' && github.ref_type == 'tag' }}
  523. runs-on: ubuntu-24.04
  524. steps:
  525. - name: Reminder
  526. env:
  527. LABEL: ${{ needs.version.outputs.label }}
  528. run: |
  529. echo "::notice title=Microsoft Store::CI does not submit to the Store (it would reuse old listings). Submit LYNX-$LABEL-store.msix with the local full-submission script (docs/STORE.md)."