-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (114 loc) · 3.62 KB
/
ci.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt install -y --no-install-recommends clang-format
- name: Lint
run: ./scripts/lint.sh
build:
runs-on: ubuntu-24.04
needs: lint
env:
NODE_VERSION: 18
JAVA_VERSION: "17"
SDK_VERSION_MAJOR: 5.0.5
SDK_VERSION_MINOR: 310
strategy:
fail-fast: false
matrix:
arch: [arm64-v8a, x86_64]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ env.JAVA_VERSION }}
- name: Install OpenHarmony SDK
uses: fcitx-contrib/ohpm-cli-tools@master
with:
major: ${{ env.SDK_VERSION_MAJOR }}
minor: ${{ env.SDK_VERSION_MINOR }}
- name: Run codelinter
if: ${{ matrix.arch == 'x86_64' }}
run: codelinter
- name: Setup OpenHarmony SDK
run: |
# Setup npm registry
npm config set registry https://repo.huaweicloud.com/repository/npm/
npm config set "@ohos:registry" https://repo.harmonyos.com/npm/
# Setup ohpm
ohpm -v
ohpm config set registry https://ohpm.openharmony.cn/ohpm/
ohpm config set strict_ssl false
- name: Install dependencies
run: |
sudo apt install -y --no-install-recommends gettext
./scripts/install-deps.sh ${{ matrix.arch }}
- name: Filter ABI
run: |
if [[ ${{ matrix.arch }} == "arm64-v8a" ]]; then
sed -i '/x86_64/d' build-profile.json5
else
sed -i '/arm64-v8a/d' build-profile.json5
fi
cat build-profile.json5
- name: Build HAP
run: |
git apply --directory=entry/src/main/cpp/fcitx5 patches/fcitx5.patch
git apply --directory=entry/src/main/cpp/libime patches/libime.patch
# Install dependencies
ohpm install --all
# Build product
hvigorw -v
hvigorw clean --no-daemon
hvigorw assembleHap --mode module -p product=default --parallel --no-daemon
hvigorw assembleHap --mode module -p product=default --parallel --no-daemon # bundle generated resfile
mv entry/build/default/outputs/default/entry-default-unsigned.hap fcitx5-harmony-${{ matrix.arch }}.hap
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: fcitx5-harmony-${{ matrix.arch }}.hap
path: fcitx5-harmony-${{ matrix.arch }}.hap
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
compare:
if: ${{ github.ref != 'refs/heads/main' }}
needs: build
uses: ./.github/workflows/compare.yml
release:
needs: build
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Release
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: true
title: "Nightly Build"
files: |
*.hap