-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit af0d105
Showing
31 changed files
with
1,617 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
runs-on: macos-13 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true # needs fcitx5/.clang-format | ||
|
||
- name: Install dependencies | ||
run: brew install clang-format swift-format | ||
|
||
- name: Lint | ||
run: | | ||
find macosfrontend src -name '*.cpp' -o -name '*.h' | xargs clang-format -Werror --dry-run -style=file:fcitx5/.clang-format | ||
swift-format lint -rs src | ||
swiftlint --strict src | ||
build: | ||
needs: lint | ||
runs-on: macos-13 | ||
strategy: | ||
matrix: | ||
arch: [x86_64] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- uses: SwiftyLab/setup-swift@latest | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Install dependencies | ||
run: | | ||
brew install \ | ||
fmt \ | ||
extra-cmake-modules \ | ||
ninja | ||
pip install "dmgbuild[badge_icons]" | ||
- name: Build | ||
run: | | ||
cmake -B build -G Ninja \ | ||
-DCMAKE_Swift_COMPILER=`which swiftc` \ | ||
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} \ | ||
-DCMAKE_BUILD_TYPE=Release | ||
cmake --build build | ||
sudo cmake --install build | ||
dmgbuild -s dmg/config.py Fcitx5 Fcitx5-${{ matrix.arch }}.dmg | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: | | ||
Fcitx5-${{ matrix.arch }}.dmg | ||
release: | ||
needs: build | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
merge-multiple: true | ||
|
||
- name: Create Nightly release | ||
if: ${{ 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: | | ||
Fcitx5-x86_64.dmg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.DS_Store | ||
build | ||
*.dmg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "fcitx5"] | ||
path = fcitx5 | ||
url = https://github.com/fcitx/fcitx5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
cmake_minimum_required(VERSION 3.27) | ||
|
||
project(fcitx5-macos VERSION 0.1.0 LANGUAGES CXX Swift) | ||
|
||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) | ||
|
||
include(InitializeSwift) | ||
include(AddSwift) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
option(ENABLE_TEST "" OFF) | ||
option(ENABLE_COVERAGE "" OFF) | ||
option(ENABLE_ENCHANT "" OFF) | ||
option(ENABLE_X11 "" OFF) | ||
option(ENABLE_WAYLAND "" OFF) | ||
option(ENABLE_DBUS "" OFF) | ||
option(ENABLE_DOC "" OFF) | ||
option(ENABLE_SERVER "" OFF) | ||
option(ENABLE_KEYBOARD "" OFF) | ||
option(USE_SYSTEMD "" OFF) | ||
option(ENABLE_XDGAUTOSTART "" OFF) | ||
option(ENABLE_EMOJI "" OFF) | ||
option(ENABLE_LIBUUID "" OFF) | ||
|
||
set(APP_INSTALL_PATH "/Library/Input Methods") | ||
set(CMAKE_INSTALL_PREFIX "${APP_INSTALL_PATH}/Fcitx5.app/Contents") | ||
# Reproducible | ||
set(CMAKE_INSTALL_LIBDATADIR "${CMAKE_INSTALL_PREFIX}/lib") | ||
add_subdirectory(fcitx5) | ||
|
||
add_subdirectory(macosfrontend) | ||
|
||
include_directories(include) | ||
add_subdirectory(src) | ||
add_subdirectory(dmg) |
Oops, something went wrong.