Skip to content

Commit

Permalink
Merge From Upstream (#1)
Browse files Browse the repository at this point in the history
This include changes from 53ce306 upto 09da263. Some commits are deliberately excluded. 5c7fb64 is temporarily excluded.

Co-authored-by: Qijia Liu <[email protected]>
Co-authored-by: Kian-Meng Ang <[email protected]>
Co-authored-by: Weng Xuetian <[email protected]>
Co-authored-by: fxliang <[email protected]>
Co-authored-by: Bambooin <[email protected]>
Co-authored-by: ksqsf <[email protected]>
Co-authored-by: ksqsf <[email protected]>
Co-authored-by: Xing Chen · 单单 <[email protected]>
Co-authored-by: wxyzhen <[email protected]>
Co-authored-by: AlfredLouis00 <[email protected]>
Co-authored-by: WhiredPlanck <[email protected]>
Co-authored-by: wxyzh <[email protected]>
Co-authored-by: 葉修齊 <[email protected]>
Co-authored-by: Shewer Lu <[email protected]>
Co-authored-by: fxliang <[email protected]>
Co-authored-by: groverlynn <[email protected]>
Co-authored-by: 居戎氏 <[email protected]>
Co-authored-by: Ace-Who <[email protected]>
Co-authored-by: morse.hsiao <[email protected]>
Co-authored-by: Rocka <[email protected]>
Co-authored-by: LEO Yoon-Tsaw <[email protected]>
Co-authored-by: mokapsing <[email protected]>
  • Loading branch information
23 people committed Mar 31, 2024
1 parent 1564d4a commit 1a25326
Show file tree
Hide file tree
Showing 191 changed files with 4,261 additions and 2,556 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
6 changes: 6 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# apply clang format in other folders
3368db1525b4441844cda859bb6fc70adaf845c6

# apply clang format in src folder
ab586ca1f32477edc00dfd6cfa555dd5425d283f

17 changes: 17 additions & 0 deletions .github/workflows/commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,28 @@ on:
pull_request:

jobs:
lint:
runs-on: macos-14
steps:
- name: Checkout last commit
uses: actions/checkout@v4
- name: Install clang-format
run: brew install clang-format
- name: Lint
run: make clang-format-lint

linux:
needs: lint
uses: ./.github/workflows/linux-build.yml

macos:
needs: lint
uses: ./.github/workflows/macos-build.yml

windows:
needs: lint
uses: ./.github/workflows/windows-build.yml

docker:
needs: lint
uses: ./.github/workflows/docker-build.yml
16 changes: 16 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Docker build
on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout last commit
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build with plugins
run: docker build -t librime .
14 changes: 13 additions & 1 deletion .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
name: Linux build
on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [g++, clang]
compiler: [gcc, clang]
include:
- compiler: gcc
cxx_compiler: g++
- compiler: clang
cxx_compiler: clang++
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.cxx_compiler }}

steps:
- name: Checkout last commit
uses: actions/checkout@v4
Expand All @@ -19,3 +29,5 @@ jobs:

- name: Build
run: make release
env:
CMAKE_GENERATOR: Ninja
69 changes: 34 additions & 35 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,84 @@
name: macOS build
on:
workflow_call:
inputs:
build_variant:
required: false
type: string
jobs:
build:
runs-on: macos-latest
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [macos-13, macos-14]
include:
- runs-on: macos-13
create-distributable: false
- runs-on: macos-14
create-distributable: ${{ github.event_name != 'pull_request' }}
build_variant: universal
env:
boost_version: 1.83.0
BOOST_ROOT: ${{ github.workspace }}/deps/boost_1_83_0
boost_version: 1.84.0
BOOST_ROOT: ${{ github.workspace }}/deps/boost-1.84.0
steps:
- name: Checkout last commit
uses: actions/checkout@v4
with:
submodules: recursive

- name: Configure build variant
if: contains(inputs.build_variant, '-universal')
- name: Configure build environment
run: |
echo BUILD_UNIVERSAL=1 >> $GITHUB_ENV
brew install llvm ninja
echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH
- name: Cache Boost
id: cache-boost
uses: actions/cache@v3
with:
path: |
${{ env.BOOST_ROOT }}.tar.bz2
${{ env.BOOST_ROOT }}/stage
key: ${{ runner.os }}-boost-${{ env.boost_version }}

- name: Extract Boost source tarball
if: steps.cache-boost.outputs.cache-hit == 'true'
- name: Configure build variant
if: matrix.build_variant == 'universal'
run: |
pushd deps
tar --bzip2 -xf ${{ env.BOOST_ROOT }}.tar.bz2
popd
echo BUILD_UNIVERSAL=1 >> $GITHUB_ENV
- name: Install Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
run: ./install-boost.sh

- name: Check submodules
run: git submodule > submodule-status

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
bin
include
lib
share
key: ${{ runner.os }}${{ inputs.build_variant }}-deps-${{ hashFiles('submodule-status') }}
key: ${{ runner.os }}-${{ matrix.build_variant || runner.arch }}-deps-${{ hashFiles('submodule-status') }}

- name: Build dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: make xcode/deps
run: make deps

- name: Build
run: make xcode
run: make release

- name: Set version info
if: matrix.create-distributable
run: |
echo "librime ${{ github.ref_name }}" >> version-info.txt
echo $(git ls-tree HEAD:plugins | awk '$2 == "commit" {print $4,$3}') >> version-info.txt
- name: Create distributable
if: matrix.create-distributable
run: |
make xcode/dist
tar -cjvf rime-TypeDuck-${{ github.ref_name }}-${{ runner.os }}.tar.bz2 \
make install
tar -cjvf rime-TypeDuck-${{ github.ref_name }}-${{ runner.os }}-${{ matrix.build_variant || runner.arch }}.tar.bz2 \
dist version-info.txt
tar -cjvf rime-deps-TypeDuck-${{ github.ref_name }}-${{ runner.os }}.tar.bz2 \
tar -cjvf rime-deps-TypeDuck-${{ github.ref_name }}-${{ runner.os }}-${{ matrix.build_variant || runner.arch }}.tar.bz2 \
--exclude '*/.placeholder' \
bin include lib share
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: matrix.create-distributable
uses: actions/upload-artifact@v4
with:
name: artifact-${{ runner.os }}-${{ matrix.build_variant || runner.arch }}
path: |
rime-TypeDuck-${{ github.ref_name }}-${{ runner.os }}.tar.bz2
rime-deps-TypeDuck-${{ github.ref_name }}-${{ runner.os }}.tar.bz2
rime-TypeDuck-${{ github.ref_name }}-${{ runner.os }}-${{ matrix.build_variant || runner.arch }}.tar.bz2
rime-deps-TypeDuck-${{ github.ref_name }}-${{ runner.os }}-${{ matrix.build_variant || runner.arch }}.tar.bz2
9 changes: 5 additions & 4 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:

macos:
uses: ./.github/workflows/macos-build.yml
with:
build_variant: '-universal'

windows:
uses: ./.github/workflows/windows-build.yml
Expand All @@ -22,11 +20,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifact
merge-multiple: true

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
name: "librime for TypeDuck: ${{ github.ref_name }}"
name: librime for TypeDuck: ${{ github.ref_name }}
files: |
artifact/*
Loading

0 comments on commit 1a25326

Please sign in to comment.