Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
ci: native arm build (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored Feb 2, 2024
1 parent 6b1ab73 commit d58ce0d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,31 @@ on:

jobs:
build:
runs-on: macos-13
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
arch: [x86_64, arm64]
os: [macos-14, macos-13]
include:
- { os: macos-14, arch: arm64 }
- { os: macos-13, arch: x86_64 }

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: |
brew install \
extra-cmake-modules \
ninja
wget https://github.com/fcitx-contrib/fcitx5-macos-prebuilder/releases/download/latest/marisa-x86_64.tar.bz2
tar xjvf marisa-x86_64.tar.bz2 -C /usr/local bin/marisa-build
wget https://github.com/fcitx-contrib/fcitx5-macos-prebuilder/releases/download/latest/marisa-${{ matrix.arch }}.tar.bz2
sudo tar xjvf marisa-${{ matrix.arch }}.tar.bz2 -C /usr/local bin/marisa-build
- name: Download and install Fcitx5.app
run: |
Expand All @@ -45,7 +52,6 @@ jobs:
build/*.tar.bz2
- name: Check validity
if: ${{ matrix.arch == 'x86_64' }}
run: ./check-validity.sh

- name: Setup tmate session
Expand All @@ -64,9 +70,6 @@ jobs:
with:
merge-multiple: true

- name: Repackage arm
run: ./fix-cross-build.sh

- name: Release
uses: 'marvinpinto/action-automatic-releases@latest'
with:
Expand Down
2 changes: 1 addition & 1 deletion check-validity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
has_homebrew_deps=0

for lib in $(find build -name '*.so'); do
if otool -L $lib | grep /usr/local; then
if otool -L $lib | grep '/usr/local\|/opt/homebrew'; then
otool -L $lib
has_homebrew_deps=1
fi
Expand Down
1 change: 1 addition & 0 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ f5m_configure() {
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DCMAKE_FIND_ROOT_PATH="/Library/Input Methods/Fcitx5.app/Contents;$INSTALL_PREFIX" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=13 \
-DCMAKE_OSX_ARCHITECTURES=$ARCH "$@"
}

Expand Down

0 comments on commit d58ce0d

Please sign in to comment.