From 54faa532a346bd00edb3ca09a193074708b3924d Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Tue, 23 Apr 2024 13:10:23 +0100 Subject: [PATCH] Explicitly use macos-12 for intel builds --- .github/workflows/publish.yml | 2 +- tools/load_build_targets.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 75ecc6f..4e0fc0e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -113,7 +113,7 @@ jobs: - run: python -m pip install PyYAML click - run: echo $LOAD_BUILD_TARGETS_SCRIPT | base64 --decode > load_build_targets.py env: - LOAD_BUILD_TARGETS_SCRIPT: aW1wb3J0IGpzb24KaW1wb3J0IG9zCmltcG9ydCByZQoKaW1wb3J0IGNsaWNrCmltcG9ydCB5YW1sCgpNQUNISU5FX1RZUEUgPSB7CiAgICAibGludXgiOiAidWJ1bnR1LWxhdGVzdCIsCiAgICAibWFjb3MiOiAibWFjb3MtbGF0ZXN0IiwKICAgICJ3aW5kb3dzIjogIndpbmRvd3MtbGF0ZXN0IiwKfQpNMV9SVU5ORVIgPSAibWFjb3MtMTQiCgpDSUJXX0JVSUxEID0gb3MuZW52aXJvbi5nZXQoIkNJQldfQlVJTEQiLCAiKiIpCkNJQldfQVJDSFMgPSBvcy5lbnZpcm9uLmdldCgiQ0lCV19BUkNIUyIsICJhdXRvIikKCgpAY2xpY2suY29tbWFuZCgpCkBjbGljay5vcHRpb24oIi0tdGFyZ2V0cyIsIGRlZmF1bHQ9IiIpCmRlZiBsb2FkX2J1aWxkX3RhcmdldHModGFyZ2V0cyk6CiAgICAiIiJTY3JpcHQgdG8gbG9hZCBjaWJ1aWxkd2hlZWwgdGFyZ2V0cyBmb3IgR2l0SHViIEFjdGlvbnMgd29ya2Zsb3cuIiIiCiAgICAjIExvYWQgbGlzdCBvZiB0YXJnZXRzCiAgICB0YXJnZXRzID0geWFtbC5sb2FkKHRhcmdldHMsIExvYWRl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o= - id: set-outputs run: python load_build_targets.py --targets "${{ inputs.targets }}" shell: sh diff --git a/tools/load_build_targets.py b/tools/load_build_targets.py index fe5fa15..3426df2 100644 --- a/tools/load_build_targets.py +++ b/tools/load_build_targets.py @@ -7,7 +7,7 @@ MACHINE_TYPE = { "linux": "ubuntu-latest", - "macos": "macos-latest", + "macos": "macos-12", "windows": "windows-latest", } M1_RUNNER = "macos-14" @@ -39,7 +39,8 @@ def get_os(target): if "macos" in target: if get_cibw_archs(target) in {"arm64", "universal2"}: return M1_RUNNER - return MACHINE_TYPE["macos"] + else: + return MACHINE_TYPE["macos"] if "win" in target: return MACHINE_TYPE["windows"] return MACHINE_TYPE["linux"]