From 2d7610f1db89bf23d7b0972a74dd55138090be69 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 31 Mar 2026 14:50:30 +0000 Subject: [PATCH 1/2] ci: use macos-15 GitHub-hosted runner Replace deprecated macos-11 with macos-15. Bump asdf cache keys so builds do not reuse caches from the old image. Co-authored-by: Dominic Letz --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6298ca3..4197e15 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,14 +7,14 @@ env: jobs: macos: - runs-on: macos-11 + runs-on: macos-15 steps: - name: asdf cache uses: actions/cache@v3 id: asdf-cache with: path: /Users/runner/.asdf - key: macos-otp-${{ env.OTP_VERSION }} + key: macos-15-otp-${{ env.OTP_VERSION }} - name: "Installing Erlang" if: steps.asdf-cache.outputs.cache-hit != 'true' @@ -34,7 +34,7 @@ jobs: uses: actions/cache/save@v3 with: path: /Users/runner/.asdf - key: macos-otp-${{ env.OTP_VERSION }} + key: macos-15-otp-${{ env.OTP_VERSION }} - uses: actions/checkout@v3 - name: "Create keychain" From 81987dbdd18a1129331e3540e3218765f4c5a5b7 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 1 Apr 2026 08:36:05 +0000 Subject: [PATCH 2/2] fix: resolve Mix warning and Credo nesting issues - Replace Mix.ensure_application!/1 with Application.ensure_all_started/1 (Mix API no longer public; :public_key is in extra_applications) - Extract maybe_rewrite_dep_to_approot/4 to flatten release/1 callback nesting - Extract import_webkit_entry/2 to satisfy Credo in import_webkit/2 Co-authored-by: Dominic Letz --- lib/package/linux.ex | 20 ++++++++++++-------- lib/package/macos.ex | 14 +++++++------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/lib/package/linux.ex b/lib/package/linux.ex index a4681dc..ad05ede 100644 --- a/lib/package/linux.ex +++ b/lib/package/linux.ex @@ -80,14 +80,7 @@ defmodule Desktop.Deployment.Package.Linux do files = wildcard(Path.dirname(libwebkit), "#{basename}/*") for file <- files do - if File.dir?(file) do - File.mkdir_p!(Path.join([priv(pkg), "libwebkit2gtk", Path.basename(file)])) - - for subfile <- wildcard(file, "*"), - do: priv_import!(pkg, subfile, extra_path: ["libwebkit2gtk/#{Path.basename(file)}"]) - else - priv_import!(pkg, file, extra_path: ["libwebkit2gtk"]) - end + import_webkit_entry(pkg, file) end redirection = @@ -99,6 +92,17 @@ defmodule Desktop.Deployment.Package.Linux do end end + defp import_webkit_entry(%Package{} = pkg, file) do + if File.dir?(file) do + File.mkdir_p!(Path.join([priv(pkg), "libwebkit2gtk", Path.basename(file)])) + + for subfile <- wildcard(file, "*"), + do: priv_import!(pkg, subfile, extra_path: ["libwebkit2gtk/#{Path.basename(file)}"]) + else + priv_import!(pkg, file, extra_path: ["libwebkit2gtk"]) + end + end + defp import_libgstreamer_modules(%Package{} = pkg, deps) do libgst = Enum.find(deps, fn lib -> String.starts_with?(Path.basename(lib), "libgstreamer") end) diff --git a/lib/package/macos.ex b/lib/package/macos.ex index 56efca1..965926f 100644 --- a/lib/package/macos.ex +++ b/lib/package/macos.ex @@ -93,11 +93,7 @@ defmodule Desktop.Deployment.Package.MacOS do end for bin <- find_binaries(root) do - rewrite_deps(bin, fn dep -> - if should_rewrite?(bin, dep) do - rewrite_to_approot(pkg, bin, dep, root) - end - end) + rewrite_deps(bin, &maybe_rewrite_dep_to_approot(pkg, bin, &1, root)) end developer_id = find_developer_id() @@ -327,6 +323,10 @@ defmodule Desktop.Deployment.Package.MacOS do )) end + defp maybe_rewrite_dep_to_approot(pkg, bin, dep, root) do + if should_rewrite?(bin, dep), do: rewrite_to_approot(pkg, bin, dep, root) + end + defp rewrite_to_approot(pkg, bin, dep, root) do location = if String.contains?(dep, ".framework/") do @@ -373,9 +373,9 @@ defmodule Desktop.Deployment.Package.MacOS do @friendly_attribute {2, 5, 4, 3} def locate_uid(pem_filename) do cert = File.read!(pem_filename) - # Test for missing public_key application + # Ensure :public_key is started (see extra_applications in mix.exs) # ref https://elixirforum.com/t/nerves-key-hub-mix-tasks-fail-because-of-missing-pubkey-pem-module/62821/2 - Mix.ensure_application!(:public_key) + Application.ensure_all_started(:public_key) cert_der = List.keyfind!(:public_key.pem_decode(cert), :Certificate, 0) :public_key.der_decode(:Certificate, elem(cert_der, 1))