don't use system expat #41
Workflow file for this run
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
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: | |
fail-fast: false # hdiutil: create failed - Resource busy | |
matrix: | |
arch: [x86_64, arm64] | |
include: | |
- { arch: x86_64, homebrew_prefix: /usr/local } | |
- { arch: arm64, homebrew_prefix: /opt/homebrew } | |
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 (x86) | |
if: ${{ matrix.arch == 'x86_64' }} | |
run: | | |
brew install \ | |
expat \ | |
fmt \ | |
extra-cmake-modules \ | |
libxkbcommon \ | |
iso-codes \ | |
json-c \ | |
ninja | |
pip install "dmgbuild[badge_icons]" | |
- name: Setup arm homebrew | |
if: ${{ matrix.arch == 'arm64' }} | |
uses: fcitx-contrib/macos-cross@master | |
- name: Install dependencies (arm) | |
if: ${{ matrix.arch == 'arm64' }} | |
run: | | |
brew install \ | |
extra-cmake-modules \ | |
ninja | |
pip install "dmgbuild[badge_icons]" | |
arm-brew-install \ | |
expat \ | |
fmt \ | |
gettext \ | |
xkeyboardconfig \ | |
libxkbcommon \ | |
iso-codes \ | |
json-c \ | |
libuv | |
cp -f /usr/local/bin/msgfmt /opt/homebrew/bin | |
- name: Build | |
run: | | |
cmake -B build -G Ninja \ | |
-DCMAKE_Swift_COMPILER=`which swiftc` \ | |
-DCMAKE_FIND_ROOT_PATH=${{ matrix.homebrew_prefix }} \ | |
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} \ | |
-DCMAKE_BUILD_TYPE=Release | |
cmake --build build || ./fix-cross-build.sh | |
sudo cmake --install build | |
dmgbuild -s dmg/config.py Fcitx5 Fcitx5-${{ matrix.arch }}.dmg | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Fcitx5-${{ matrix.arch }}.dmg | |
path: | | |
Fcitx5-${{ matrix.arch }}.dmg | |
- name: Setup tmate session | |
if: ${{ failure() }} | |
uses: mxschmitt/action-tmate@v3 | |
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 | |
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 | |
Fcitx5-arm64.dmg |