From d15aa067cafbebd1c6a0dbb6edc286d89463a71b Mon Sep 17 00:00:00 2001 From: Steve-xmh <39523898+Steve-xmh@users.noreply.github.com> Date: Sun, 3 Mar 2024 14:33:23 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=8E=20Set=20up=20build=20action=20for?= =?UTF-8?q?=20macOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_macos.yaml | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/build_macos.yaml diff --git a/.github/workflows/build_macos.yaml b/.github/workflows/build_macos.yaml new file mode 100644 index 0000000..b1d45e9 --- /dev/null +++ b/.github/workflows/build_macos.yaml @@ -0,0 +1,33 @@ +on: [ push, pull_request ] + +name: CI + +jobs: + build: + name: build for macOS + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ macos-latest ] + steps: + - uses: actions/checkout@v4 + - name: Build for Intel/Apple Silicon target + run: | + rustup target add aarch64-apple-darwin x86_64-apple-darwin + cargo build --verbose --release --target aarch64-apple-darwin + cargo build --verbose --release --target x86_64-apple-darwin + - name: Create Fat Executable for Intel/Apple Silicon + run: | + lipo -create -output target/libv8_killer_core.dylib \ + target/aarch64-apple-darwin/release/libv8_killer_core.dylib \ + target/x86_64-apple-darwin/release/libv8_killer_core.dylib + lipo -create -output target/v8_killer_launcher \ + target/aarch64-apple-darwin/release/v8_killer_launcher \ + target/x86_64-apple-darwin/release/v8_killer_launcher + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.os }}-release + path: | + target/libv8_killer_core.dylib + target/v8_killer_launcher