From 9e72f01b498ff40a3847121454925c20df06427e Mon Sep 17 00:00:00 2001 From: Kai <2857693944@qq.com> Date: Sat, 17 Aug 2024 00:44:05 +0800 Subject: [PATCH 1/3] [ci] fix github action on macos x86 --- .github/workflows/pack.yml | 2 +- .github/workflows/release_macos.yml | 2 +- .github/workflows/release_windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pack.yml b/.github/workflows/pack.yml index a9f858a..81aa999 100644 --- a/.github/workflows/pack.yml +++ b/.github/workflows/pack.yml @@ -20,7 +20,7 @@ jobs: # The type of runner that the job will run on strategy: matrix: - os: ["windows-latest", "macos-latest", "macos-11"] + os: ["windows-latest", "macos-latest", "macos-13"] python-version: ["3.8", "3.9", "3.10"] # must use str, not int, or 3.10 will be recognized as 3.1 runs-on: ${{ matrix.os }} # Steps represent a sequence of tasks that will be executed as part of the job diff --git a/.github/workflows/release_macos.yml b/.github/workflows/release_macos.yml index 625520f..11f946d 100644 --- a/.github/workflows/release_macos.yml +++ b/.github/workflows/release_macos.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: python-version: ["3.9"] # must use str, not int, or 3.10 will be recognized as 3.1 - os: ["macos-latest", "macos-11"] + os: ["macos-latest", "macos-13"] runs-on: ${{ matrix.os }} # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.github/workflows/release_windows.yml b/.github/workflows/release_windows.yml index 55866da..706f190 100644 --- a/.github/workflows/release_windows.yml +++ b/.github/workflows/release_windows.yml @@ -14,7 +14,7 @@ on: jobs: # This workflow contains a single job called "build" build: - name: test pack task + name: release and upload assets task # The type of runner that the job will run on strategy: matrix: From 2eddfb10387e045bb78bd740237bb37abb4be1aa Mon Sep 17 00:00:00 2001 From: Kai <2857693944@qq.com> Date: Sat, 17 Aug 2024 01:29:45 +0800 Subject: [PATCH 2/3] replace macos version number by arch in release --- pack.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pack.py b/pack.py index b50210d..c98d709 100644 --- a/pack.py +++ b/pack.py @@ -159,10 +159,13 @@ def pack(): windows_out = windows_out_new print(windows_out) elif os_name.startswith("macos"): - if os_name != "macos-latest": - macos_out_new = macos_out.replace("macos", os_name.replace("-", "_")) - os.rename(macos_out, macos_out_new) - macos_out = macos_out_new + macos_version = os_name.split("-")[1] + if macos_version.isdigit() and int(macos_version) <= 14: + macos_out_new = macos_out.replace("macos", "macos_x64") + else: # github actions macos-latest is using M1 chip + macos_out_new = macos_out.replace("macos", "macos_arm64") + os.rename(macos_out, macos_out_new) + macos_out = macos_out_new print(macos_out) else: sys.exit(1) From 4c8e24a92a12bb658e6f6ab684ca0f0a93af5b1b Mon Sep 17 00:00:00 2001 From: Kai <60053077+kaidegit@users.noreply.github.com> Date: Sat, 17 Aug 2024 01:40:12 +0800 Subject: [PATCH 3/3] fix typo --- pack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pack.py b/pack.py index c98d709..948c1d2 100644 --- a/pack.py +++ b/pack.py @@ -160,7 +160,7 @@ def pack(): print(windows_out) elif os_name.startswith("macos"): macos_version = os_name.split("-")[1] - if macos_version.isdigit() and int(macos_version) <= 14: + if macos_version.isdigit() and int(macos_version) < 14: macos_out_new = macos_out.replace("macos", "macos_x64") else: # github actions macos-latest is using M1 chip macos_out_new = macos_out.replace("macos", "macos_arm64")