Skip to content

cross build to arm64 (#8) #53

cross build to arm64 (#8)

cross build to arm64 (#8) #53

Workflow file for this run

name: ci
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
build-fcitx5-msys:
runs-on: windows-2025
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Lint
run: ./win32/scripts/lint.ps1
- name: Install dependencies
run: |
C:/msys64/usr/bin/pacman -Syu --noconfirm
C:/msys64/usr/bin/pacman -S --noconfirm `
mingw-w64-clang-x86_64-extra-cmake-modules `
cmake `
fmt `
gcc `
gettext-devel `
libuv-devel `
msys2-runtime-devel `
ninja
cp -r its C:/msys64/usr/share/gettext
Add-Content $env:GITHUB_PATH "C:/msys64/usr/bin"
- name: Build
run: |
cmake -B build -G Ninja `
-DCMAKE_BUILD_TYPE=Release
cmake --build build
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
build-fcitx5-clang:
runs-on: windows-2025
strategy:
fail-fast: false
matrix:
arch: [x86_64, arm64]
include:
- { arch: x86_64, cmake_arch: AMD64, pkg_arch: x86_64 }
- { arch: arm64, cmake_arch: ARM64, pkg_arch: aarch64 }
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
C:/msys64/usr/bin/pacman -Syu --noconfirm
C:/msys64/usr/bin/pacman -S --noconfirm `
mingw-w64-clang-${{ matrix.pkg_arch }}-extra-cmake-modules `
mingw-w64-clang-${{ matrix.pkg_arch }}-dlfcn `
mingw-w64-clang-${{ matrix.pkg_arch }}-fmt `
mingw-w64-clang-${{ matrix.pkg_arch }}-libuv `
mingw-w64-clang-x86_64-clang `
mingw-w64-clang-x86_64-cmake `
mingw-w64-clang-x86_64-ninja `
mingw-w64-clang-x86_64-pkgconf `
gettext
if ("${{ matrix.arch }}" -eq "arm64") {
C:/msys64/usr/bin/pacman -S --noconfirm `
mingw-w64-clang-aarch64-clang
}
mkdir -p C:/msys64/usr/share/gettext
cp -r its C:/msys64/usr/share/gettext
Add-Content $env:GITHUB_PATH "C:/msys64/clang64/bin"
git apply --directory=fcitx5 patches/fcitx5.patch
- name: Build
run: |
cmake -B build/${{ matrix.arch }} -G Ninja `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_TOOLCHAIN_FILE='windows-cross/msys2.toolchain.cmake' `
-DARCH=${{ matrix.cmake_arch }}
cmake --build build/${{ matrix.arch }}
- name: Package
env:
DESTDIR: dist/${{ matrix.arch }}
run: |
cmake --install build/${{ matrix.arch }}
cd dist/${{ matrix.arch }} && tar cjf ../Fcitx5-${{ matrix.arch }}-dev.tar.bz2 bin/lib* include lib
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Fcitx5-${{ matrix.arch }}
path: |
dist/Fcitx5-${{ matrix.arch }}*.tar.bz2
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
build-win32:
runs-on: windows-2025
defaults:
run:
working-directory: win32
steps:
- name: Disable CRLF
working-directory: .
run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- name: Build
run: |
cmake -B build -G Ninja `
-DCMAKE_BUILD_TYPE=Release
cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
- name: Check validity
run: md5sum -c checksum
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
release:
needs: build-fcitx5-clang
if: ${{ github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, '!release') }}
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-*.tar.bz2