release.yml 31 KB

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