Skip to content

Commit

Permalink
feat: support MacOS ARM builds
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Jul 20, 2024
1 parent 89de944 commit bdeb251
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/actions/internal/prepare-os/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ runs:
# workaround to prevent "Error: The `brew link` step did not complete successfully" during "brew install mono"
# and setup-python action, see https://github.com/actions/setup-python/issues/577
rm -f \
sudo rm -f \
/usr/local/share/man/man1/* \
/usr/local/share/man/man5/* \
/usr/local/bin/idle3* \
Expand Down
7 changes: 6 additions & 1 deletion .github/actions/internal/setup-lua/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,12 @@ runs:
echo "::group::Setup Lua: Install hererocks dependencies"
case "${{ runner.os }}" in
Linux) sudo apt-get install -y --no-install-recommends build-essential libpcre2-dev libssl-dev libreadline-dev cmake unzip ;;
macOS) brew install pcre [email protected]; lualib_install_opts+=" OPENSSL_DIR=/usr/local/opt/[email protected]" ;;
macOS)
brew install pcre pcre2 [email protected]
lualib_install_opts+=" OPENSSL_DIR=$(brew --prefix [email protected])"
lualib_install_opts+=" PCRE_DIR=$(brew --prefix pcre)"
lualib_install_opts+=" PCRE2_DIR=$(brew --prefix pcre2)"
;;
esac
echo "::endgroup::"
Expand Down
9 changes: 7 additions & 2 deletions .github/actions/internal/setup-neko/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,15 @@ runs:
macOS)
if [[ ! -f "$NEKO_HOME/neko" ]]; then
rm -rf "$NEKO_HOME"
case "$(machine)" in
*arm*) archive_suffix=osx-arm64 ;;
*) archive_suffix=osx64 ;;
esac
if [[ $NEKO_VERSION == 'latest' ]]; then
archive_url=$(eval curl -sSfL ${auth_header:-} https://api.github.com/repos/HaxeFoundation/neko/releases | grep -o "https://.*/download/.*/neko.*-osx64.tar.gz" | head -n 1)
archive_url=$(eval curl -sSfL ${auth_header:-} https://api.github.com/repos/HaxeFoundation/neko/releases | grep -o "https://.*/download/.*/neko.*-${archive_suffix}.tar.gz" | head -n 1)
else
archive_url="https://github.com/HaxeFoundation/neko/releases/download/v${NEKO_VERSION//./-}/neko-${NEKO_VERSION}-osx64.tar.gz"
archive_url="https://github.com/HaxeFoundation/neko/releases/download/v${NEKO_VERSION//./-}/neko-${NEKO_VERSION}-${archive_suffix}.tar.gz"
fi
mkdir -p "$NEKO_HOME"
$(set -x; curl -sSfL $archive_url | tar -xz --strip-components=1 -C "$NEKO_HOME")
Expand Down
10 changes: 6 additions & 4 deletions .github/actions/setup-haxe/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ runs:
echo "$HAXE_HOME" >> "$GITHUB_PATH"
echo "HAXEPATH=$HAXE_HOME" | tee -a "$GITHUB_ENV"
echo "HAXE_STD_PATH=$HAXE_HOME/std" | tee -a "$GITHUB_ENV"
ln -sfv "$(dirname $(which neko))/libneko.2.dylib" "$HAXE_HOME/libneko.2.dylib" # workaround for "dyld: Library not loaded: @rpath/libneko.2.dylib"
# workaround for "dyld: Library not loaded: @rpath/libneko.2.dylib"
(set -x; ln -sfv "$(dirname $(which neko))/libneko.2.dylib" "$HAXE_HOME/libneko.2.dylib")
(set -x; sudo mkdir -p /usr/local/lib; sudo ln -sfv "$(dirname $(which neko))/libneko.2.dylib" /usr/local/lib/libneko.2.dylib)
(set -x; haxelib setup $HAXE_HOME/lib)
;;
Windows)
Expand All @@ -138,7 +141,7 @@ runs:
echo "$(cygpath -w "$HAXE_HOME")" >> "$GITHUB_PATH"
echo "HAXEPATH=$(cygpath -w "$HAXE_HOME")" | tee -a "$GITHUB_ENV"
echo "HAXE_STD_PATH=$(cygpath -w "$HAXE_HOME/std")" | tee -a "$GITHUB_ENV"
(set -x; haxelib setup "$(cygpath "$HAXE_HOME")\\lib")
;;
esac
Expand All @@ -149,7 +152,6 @@ runs:
shell: bash
run: haxe -version # haxe 3 only supports -version. haxe 4 also --version


- name: "Install: yq" # https://github.com/mikefarah/yq
uses: vegardit/gha-setup-yq@v1

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build.action-setup-haxe-targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os:
os: # https://github.com/actions/runner-images#available-images
- ubuntu-latest
- macos-latest
- macos-13 # Intel
- macos-latest # ARM
- windows-latest

steps:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/build.action-test-with-haxe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,20 @@ jobs:
strategy:
fail-fast: false
matrix:
os:
os: # https://github.com/actions/runner-images#available-images
- ubuntu-latest
- macos-latest
- macos-13 # Intel
- windows-latest
haxe:
- nightly
- 4.3.4
- 4.3.5
- 4.2.5
- 3.4.7
include:
- os: macos-latest # ARM
haxe: nightly
- os: macos-latest # ARM
haxe: 4.3.5

steps:
- name: Show environment variables
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/build.workflow-test-with-haxe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,20 @@ jobs:
strategy:
fail-fast: false
matrix:
os:
os: # https://github.com/actions/runner-images#available-images
- ubuntu-latest
- macos-latest
- macos-13 # Intel
- windows-latest
haxe:
- nightly
- 4.3.4
- 4.3.5
- 4.2.5
- 3.4.7
include:
- os: macos-latest # ARM
haxe: nightly
- os: macos-latest # ARM
haxe: 4.3.5
with:
haxe-reusable-workflows-repo: ${{ github.repository }}
haxe-reusable-workflows-version: ${{ github.ref }}
Expand Down

0 comments on commit bdeb251

Please sign in to comment.