From b783bc21c2b421839ab7688e45c536b5fd5e2829 Mon Sep 17 00:00:00 2001 From: Masahiro Sakai Date: Sun, 10 Nov 2024 00:05:55 +0900 Subject: [PATCH] GitHub Actions: build x86_64 and aarch64 binaries for macos --- .github/workflows/build.yaml | 17 +++++++++++++++-- misc/build_artifacts.hs | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5369bda6..bef696b0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -34,11 +34,19 @@ jobs: coveralls: false release: true - ghc: '9.6.6' - os: macos-13 # Intel Mac + os: macos-latest stack_yaml: 'stack-ghc-9.6.yaml' stack_args: '' flags: '--flag toysolver:BuildToyFMF --flag toysolver:BuildSamplePrograms --flag toysolver:BuildMiscPrograms --flag toysolver:optparse-applicative-018' - platform: macos + platform: macos-aarch64 + coveralls: false + release: true + - ghc: '9.6.6' + os: macos-latest + stack_yaml: 'stack-ghc-9.6.yaml' + stack_args: '' + flags: '--flag toysolver:BuildToyFMF --flag toysolver:BuildSamplePrograms --flag toysolver:BuildMiscPrograms --flag toysolver:optparse-applicative-018' + platform: macos-x86_64 coveralls: false release: true @@ -113,6 +121,11 @@ jobs: - name: Setup stack run: stack config set system-ghc --global true + - name: Write arch to stack.yaml + if: matrix.platform == macos-x86_64 + run: | + echo "arch: x86_64" >> ${STACK_YAML} + #- name: Fix ld path (Windows) # if: runner.os == 'Windows' # run: ruby misc/fix-x86_64-windows-ghc-8.10.2-settings.rb diff --git a/misc/build_artifacts.hs b/misc/build_artifacts.hs index 6500c2da..c3ca01c5 100644 --- a/misc/build_artifacts.hs +++ b/misc/build_artifacts.hs @@ -23,7 +23,7 @@ main = sh $ do case Info.os of "mingw32" -> (if Info.arch == "x86_64" then "win64" else "win32", Just "exe", archive7z) "linux" -> ("linux-" ++ Info.arch, Nothing, archiveTarXz) - "darwin" -> ("macos", Nothing, archiveTarXz) + "darwin" -> ("macos-" ++ Info.arch, Nothing, archiveTarXz) _ -> error ("unknown os: " ++ Info.os) exe_files = [ "toyconvert"