Skip to content

Commit

Permalink
Update github action script for building latest macos version(intel &…
Browse files Browse the repository at this point in the history
… applesilicon).
  • Loading branch information
amoxu committed Sep 19, 2024
1 parent 4a250f4 commit b258283
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 5 deletions.
Binary file modified .github/.DS_Store
Binary file not shown.
77 changes: 72 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,69 @@
name: Build OpenOCD Mac & Linux & Windows
on: push
jobs:
build-mac:
runs-on: macos-11
build-mac-applesilicon:
runs-on: macos-latest
env:
BUILD_DIR: build
steps:
- uses: actions/checkout@v2
- name: install deps
run: brew install libtool automake texinfo coreutils pkg-config cmake gnu-sed
- name: build
env:
MAKE_JOBS: 2
run: |
export PATH=/opt/homebrew/bin:$PATH
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
export CFLAGS=-mmacosx-version-min=10.9
export LDFLAGS="-F/System/Library/Frameworks -framework Foundation -framework AppKit -framework IOKit -framework Security"
export PREFIX="$(realpath $BUILD_DIR)/opt"
export BUILD_FOLD="$(realpath $BUILD_DIR)/libs"
mkdir -p $PREFIX $BUILD_FOLD
#LIBUSB1
export LIBUSB1_VER=1.0.26
git clone https://github.com/libusb/libusb && cd libusb && git checkout tags/v$LIBUSB1_VER -b v$LIBUSB1_VER && ./bootstrap.sh
./configure --prefix="$PREFIX" --disable-shared
make install
#HIDAPI
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
export HIDAPI_VER=0.11.2
cd $BUILD_FOLD && git clone https://github.com/libusb/hidapi && cd hidapi && git checkout tags/hidapi-$HIDAPI_VER -b $HIDAPI_VER && ./bootstrap
cmake -DCMAKE_INSTALL_PREFIX="$PREFIX" -DBUILD_SHARED_LIBS=false -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
make install
#LIBFTDI
export LIBFTDI_VER=1.5
cd $BUILD_FOLD && git clone git://developer.intra2net.com/libftdi && cd libftdi && git checkout tags/v$LIBFTDI_VER -b v$LIBFTDI_VER
sed -i "24,39s/^/# /" ./src/CMakeLists.txt
cmake -DCMAKE_INSTALL_PREFIX="$PREFIX" -DSTATICLIBS=ON -DEXAMPLES=OFF -DFTDI_EEPROM=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 ./
make install
#CAPSTONE
export CAPSTONE_VER=4.0.2
cd $BUILD_FOLD && git clone https://github.com/capstone-engine/capstone.git && cd capstone && git checkout tags/$CAPSTONE_VER -b $CAPSTONE_VER
make install PREFIX="$PREFIX" CAPSTONE_BUILD_CORE_ONLY=yes CAPSTONE_STATIC=yes CAPSTONE_SHARED=no CAPSTONE_ARCHS="arm"
cd $PREFIX/../..
./bootstrap
./configure --prefix="$PREFIX/openocd" --disable-werror --disable-doxygen-html --with-capstone
make
make install-strip
echo "ARTIFACT_PATH=$PREFIX/openocd" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: openocd-mac-applesilicon
path: ${{ env.ARTIFACT_PATH }}/*

build-mac-intel:
runs-on: macos-12
env:
BUILD_DIR: build
steps:
Expand All @@ -17,6 +78,7 @@ jobs:
run: |
export PATH=/usr/local/bin:$PATH
export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
export CFLAGS=-mmacosx-version-min=10.9
export LDFLAGS="-F/System/Library/Frameworks -framework Foundation -framework AppKit -framework IOKit -framework Security"
Expand Down Expand Up @@ -60,9 +122,10 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: openocd-mac
name: openocd-mac-intel
path: ${{ env.ARTIFACT_PATH }}/*


build-linux:
runs-on: ubuntu-20.04
env:
Expand Down Expand Up @@ -246,7 +309,8 @@ jobs:
pack:
runs-on: ubuntu-latest
needs:
- build-mac
- build-mac-applesilicon
- build-mac-intel
- build-linux
- build-windows-x86
- build-windows-x64
Expand All @@ -262,7 +326,10 @@ jobs:
echo "$PWD"
mkdir bin-darwin_x86_64
cp -rv ../build/openocd-mac/bin/* bin-darwin_x86_64
cp -rv ../build/openocd-mac-intel/bin/* bin-darwin_x86_64
mkdir bin-darwin_arm64
cp -rv ../build/openocd-mac-applesilicon/bin/* bin-darwin_arm64
mkdir bin-windows_amd64
cp -rv ../build/openocd-windows-x64/bin/*.exe bin-windows_amd64
Expand Down

0 comments on commit b258283

Please sign in to comment.