-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (80 loc) · 2.23 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
name: ci
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
lint:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
brew install swift-format
pip install pyright ruff
- name: Lint
run: |
swift-format lint -rs im src
ruff check package.py
pyright package.py
build:
needs: lint
runs-on: ${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
os: [macos-14, macos-13]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
brew install ninja
pip install requests
- name: Build vanilla edition
run: |
python package.py
mv build/src/Fcitx5Installer.zip .
rm -rf build
- name: Build Pinyin edition
run: |
python package.py 拼音版 chinese-addons,lua pinyin true
mv build/src/Fcitx5Installer.zip Fcitx5-Pinyin.zip
rm -rf build
- name: Build Rime edition
run: |
python package.py 中州韵版 rime rime true
mv build/src/Fcitx5Installer.zip Fcitx5-Rime.zip
rm -rf build
- name: Upload artifact
if: ${{ github.ref != 'refs/heads/master' }}
uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}
path: |
*.zip
- name: Create Nightly release
if: ${{ (matrix.os == 'macos-14') && (github.ref == 'refs/heads/master') }}
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: true
title: "Nightly Build"
files: |
Fcitx5Installer.zip
Fcitx5-Pinyin.zip
Fcitx5-Rime.zip
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3