set LANGUAGE env to avoid libintl-lite crash #80
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 | |
build: | |
needs: lint | |
runs-on: macos-13 | |
strategy: | |
fail-fast: false # hdiutil: create failed - Resource busy | |
matrix: | |
arch: [x86_64, arm64] | |
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 \ | |
extra-cmake-modules \ | |
xkeyboardconfig \ | |
iso-codes \ | |
ninja | |
./install-deps.sh ${{ matrix.arch }} | |
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: | | |
arm-brew-install \ | |
xkeyboardconfig \ | |
iso-codes | |
cp -f /usr/local/bin/msgfmt /tmp/fcitx5/bin | |
- 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 || ./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: Check validity | |
if: ${{ matrix.arch == 'x86_64' }} | |
run: ./check-validity.sh | |
- 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 |