forked from rime/librime
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (82 loc) · 2.83 KB
/
macos-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: macOS build
on:
workflow_call:
inputs:
repository:
default: ${{ github.repository }}
required: false
type: string
rime_plugins:
required: false
type: string
jobs:
build:
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: true
build_variant: universal
env:
boost_version: 1.84.0
BOOST_ROOT: ${{ github.workspace }}/deps/boost-1.84.0
RIME_PLUGINS: ${{ inputs.rime_plugins }}
steps:
- name: Checkout last commit
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
submodules: recursive
- name: Configure build environment
run: |
brew install llvm ninja
echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH
echo git_ref_name="$(git describe --always)" >> $GITHUB_ENV
- name: Configure build variant
if: matrix.build_variant == 'universal'
run: |
echo BUILD_UNIVERSAL=1 >> $GITHUB_ENV
- name: Install Boost
run: ./install-boost.sh
- name: Check submodules
run: git submodule > submodule-status
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: |
bin
include
lib
share
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 deps
- name: Install Rime plugins
run: ./action-install-plugins-macos.sh
- name: Build and test
run: make test
- name: Create distributable
if: matrix.create-distributable
run: |
make install
tar -cjvf rime-${{ env.git_ref_name }}-${{ runner.os }}-${{ matrix.build_variant || runner.arch }}.tar.bz2 \
dist version-info.txt
tar -cjvf rime-deps-${{ env.git_ref_name }}-${{ runner.os }}-${{ matrix.build_variant || runner.arch }}.tar.bz2 \
--exclude '*/.placeholder' \
bin include lib share
- name: Upload artifacts
if: matrix.create-distributable
uses: actions/upload-artifact@v4
with:
name: artifact-${{ runner.os }}-${{ matrix.build_variant || runner.arch }}
path: |
rime-${{ env.git_ref_name }}-${{ runner.os }}-${{ matrix.build_variant || runner.arch }}.tar.bz2
rime-deps-${{ env.git_ref_name }}-${{ runner.os }}-${{ matrix.build_variant || runner.arch }}.tar.bz2