Skip to content

Commit

Permalink
build librime debug
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Jan 2, 2025
1 parent 18d252b commit 6d5fb48
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
68 changes: 68 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: macOS debug build

on:
workflow_dispatch:

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

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: |
brew install ninja
mkdir build/macos-${{ matrix.arch }}/usr
for dep in boost glog leveldb lua marisa opencc yaml-cpp; do
file=$dep${{ matrix.arch }}.tar.bz2
wget -P cache https://github.com/fcitx-contrib/fcitx5-prebuilder/releases/download/macos/$file
tar xf cache/$file -C build/macos-${{ matrix.arch }}/usr
done
- name: Build
run: |
git submodule update --init librime librime-lua librime-octagram librime-predict
DEBUG=1 python scripts/librime.py macos
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: artifact-librime-${{ matrix.arch }}
path: |
build/macos-${{ matrix.arch }}/*.tar.bz2
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
pattern: artifact-librime*
merge-multiple: true

- name: Release
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: debug
prerelease: true
title: "Debug Build"
files: |
*.tar.bz2
3 changes: 2 additions & 1 deletion scripts/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# macos-x86_64/usr, ios-arm64/usr, js/usr
USR = f'{TARGET}{INSTALL_PREFIX}'

DEBUG = os.environ.get('DEBUG') == '1'

def ensure(program: str, args: list[str]):
command = " ".join([program, *args])
Expand Down Expand Up @@ -163,7 +164,7 @@ def configure(self):
]
command += self.ios
else: # Ninja
command.append('-DCMAKE_BUILD_TYPE=Release')
command.append(f'-DCMAKE_BUILD_TYPE={"Debug" if DEBUG else "Release"}')

if PLATFORM == 'js':
# emscripten defaults to full-static libs but we want plugins based on these dependencies to be dynamic.
Expand Down

0 comments on commit 6d5fb48

Please sign in to comment.