Skip to content

Commit

Permalink
GitHub Actions: build x86_64 and aarch64 binaries for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
msakai committed Nov 9, 2024
1 parent 6eb5e14 commit b783bc2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion misc/build_artifacts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b783bc2

Please sign in to comment.