Skip to content

Commit

Permalink
ci: use native m1 runner
Browse files Browse the repository at this point in the history
  • Loading branch information
elbywan committed Feb 4, 2024
1 parent 7d1810d commit 509b420
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,54 @@ jobs:
uses: actions/checkout@v2
- name: Install Crystal
run: brew update && brew install crystal || true
- name: Copy static libraries
run: |
mkdir -p ./libs
# openssl
cp /usr/local/opt/openssl@3/lib/libssl.a libs/
cp /usr/local/opt/openssl@3/lib/libcrypto.a libs/
# libevent
cp /usr/local/opt/libevent/lib/libevent_pthreads.a libs/
cp /usr/local/opt/libevent/lib/libevent.a libs/
# libyaml
/usr/local/opt/libyaml/lib/libyaml.a libs/
# libgc
cp /usr/local/opt/bdw-gc/lib/libgc.a libs/
# libpcre
cp /usr/local/opt/pcre2/lib/libpcre2-8.a libs/
- name: Build the binary
# Statically link most non-system libraries
run: |
cc=$(env CRYSTAL_LIBRARY_PATH=`pwd`/libs/x86_64-apple-darwin shards build --target="x86_64-apple-darwin" --cross-compile --no-debug --release -Dpreview_mt | tail -n 1)
eval $cc
run: env CRYSTAL_LIBRARY_PATH=`pwd`/libs shards build --no-debug --release -Dpreview_mt
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
name: zap_x86_64-apple-darwin
path: ./bin/zap
if-no-files-found: error
macos_arm64:
runs-on: macos-latest
runs-on: macos-14
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Crystal
run: brew update && brew install crystal || true
- name: Build the binary
# Statically link most non-system libraries
- name: Copy static libraries
run: |
cc=$(env CRYSTAL_LIBRARY_PATH=`pwd`/libs/arm64-apple-darwin shards build --target="arm64-apple-darwin" --cross-compile --no-debug --release | tail -n 1 | sed -e "s/-rdynamic/--target=arm64-apple-darwin -rdynamic/g")
eval $cc
mkdir -p ./libs
# openssl
cp /usr/local/opt/openssl@3/lib/libssl.a libs/
cp /usr/local/opt/openssl@3/lib/libcrypto.a libs/
# libevent
cp /usr/local/opt/libevent/lib/libevent_pthreads.a libs/
cp /usr/local/opt/libevent/lib/libevent.a libs/
# libyaml
/usr/local/opt/libyaml/lib/libyaml.a libs/
# libgc
cp /usr/local/opt/bdw-gc/lib/libgc.a libs/
# libpcre
cp /usr/local/opt/pcre2/lib/libpcre2-8.a libs/
- name: Build the binary
run: env CRYSTAL_LIBRARY_PATH=`pwd`/libs shards build --no-debug --release -Dpreview_mt
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
Expand Down
Binary file removed libs/arm64-apple-darwin/libcrypto.a
Binary file not shown.
Binary file removed libs/arm64-apple-darwin/libevent.a
Binary file not shown.
Binary file removed libs/arm64-apple-darwin/libgc.a
Binary file not shown.
Binary file removed libs/arm64-apple-darwin/libpcre2-8.a
Binary file not shown.
Binary file removed libs/arm64-apple-darwin/libssl.a
Binary file not shown.
Binary file removed libs/arm64-apple-darwin/libyaml.a
Binary file not shown.
Binary file removed libs/x86_64-apple-darwin/libcrypto.a
Binary file not shown.
Binary file removed libs/x86_64-apple-darwin/libevent.a
Binary file not shown.
Binary file removed libs/x86_64-apple-darwin/libevent_pthreads.a
Binary file not shown.
Binary file removed libs/x86_64-apple-darwin/libgc.a
Binary file not shown.
Binary file removed libs/x86_64-apple-darwin/libpcre2-8.a
Binary file not shown.
Binary file removed libs/x86_64-apple-darwin/libssl.a
Binary file not shown.
Binary file removed libs/x86_64-apple-darwin/libyaml.a
Binary file not shown.

0 comments on commit 509b420

Please sign in to comment.