Skip to content

Commit

Permalink
Add build ci
Browse files Browse the repository at this point in the history
  • Loading branch information
bitst0rm committed Dec 5, 2024
1 parent 0dfbea3 commit 4a61430
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build capstone and keystone using emscripten

on:
workflow_dispatch:

jobs:
setup:
runs-on: macos-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize and install dependencies
run: |
git submodule update --init --recursive
chmod +x ./install_deps.sh
./install_deps.sh
- name: Build capstone
run: |
cd packages/capstone
chmod +x ./build-lib.sh
./build-lib.sh
npm install
npm run build
- name: Upload capstone dist folder
uses: actions/upload-artifact@v4
with:
name: capstone-dist
path: packages/capstone/dist

- name: Build keystone
run: |
cd packages/keystone
chmod +x ./build-lib.sh
./build-lib.sh
npm install
npm run build
- name: Upload keystone dist folder
uses: actions/upload-artifact@v4
with:
name: keystone-dist
path: packages/keystone/dist
34 changes: 34 additions & 0 deletions install_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

VERSION=latest

# Install Homebrew if not present
if ! command -v brew &> /dev/null; then
echo "Homebrew not found, installing..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
export PATH="/opt/homebrew/bin:$PATH" # Ensure Homebrew is on the PATH
fi

# Install realpath and jq via Homebrew
if ! command -v realpath &> /dev/null; then
echo "realpath not found, installing..."
brew install coreutils
fi

if ! command -v jq &> /dev/null; then
echo "jq not found, installing..."
brew install jq
fi

# Install cmake via Homebrew
if ! command -v cmake &> /dev/null; then
echo "cmake not found, installing..."
brew install cmake
fi

# Install emsdk
cd
git clone https://github.com/emscripten-core/emsdk.git --depth 1
cd emsdk
./emsdk install $VERSION
./emsdk activate $VERSION

0 comments on commit 4a61430

Please sign in to comment.