Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Dec 24, 2023
0 parents commit af0d105
Show file tree
Hide file tree
Showing 31 changed files with 1,617 additions and 0 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
build
*.dmg
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "fcitx5"]
path = fcitx5
url = https://github.com/fcitx/fcitx5
36 changes: 36 additions & 0 deletions CMakeLists.txt
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)
Loading

0 comments on commit af0d105

Please sign in to comment.