Replace all sed commands with patch #191
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: | |
build: | |
runs-on: ubuntu-latest | |
container: archlinux:base-devel | |
env: | |
ABI: "armeabi-v7a,arm64-v8a,x86,x86_64" | |
NDK_VERSION: "25.2.9519653" | |
CMAKE_VERSION: "3.22.1" | |
ANDROID_PLATFORM: "23" | |
steps: | |
- name: Install build dependencies | |
run: | | |
pacman -Syu --needed --noconfirm \ | |
git unzip ghc cabal-install haskell-shake haskell-aeson-pretty \ | |
cmake extra-cmake-modules ninja fmt fcitx5 boost python opencc jdk17-openjdk check | |
- name: Fetch source code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: Install NDK and CMake | |
run: | | |
sdkmanager --install "ndk;${{ env.NDK_VERSION }}" | |
sdkmanager --install "cmake;${{ env.CMAKE_VERSION }}" | |
- name: Build everything | |
env: | |
LANG: "C.UTF-8" | |
ANDROID_NDK_ROOT: ${{ env.ANDROID_HOME }}/ndk/${{ env.NDK_VERSION }} | |
run: | | |
git config --global --add safe.directory '*' | |
# use archlinux's dynamic only ghc | |
cabal configure --disable-library-vanilla --enable-shared --enable-executable-dynamic --ghc-options=-dynamic | |
./build-cabal -j everything | |
- name: Pack prebuilt libraries | |
if: github.event_name == 'pull_request' | |
run: | | |
cd build | |
mkdir prebuilt | |
for TARGET in $(<artifacts.txt) | |
do | |
cp -a "$TARGET" prebuilt/ | |
done | |
tar --zstd -cf prebuilt.tar.zst prebuilt/ | |
- name: Upload prebuilt to artifact | |
if: github.event_name == 'pull_request' | |
uses: actions/upload-artifact@v4 | |
with: | |
path: build/prebuilt.tar.zst | |
- name: Fetch fcitx5-android/prebuilt | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
uses: actions/checkout@v3 | |
with: | |
path: prebuilt | |
repository: fcitx5-android/prebuilt | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Push to fcitx5-android/prebuilt | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
working-directory: prebuilt | |
run: | | |
rm -r ./* | |
for TARGET in $(<../build/artifacts.txt) | |
do | |
cp -a "../build/$TARGET" ./ | |
done | |
git remote set-url origin "https://${{ secrets.BOT_TOKEN }}@github.com/fcitx5-android/prebuilt.git" | |
git config user.name "Fcitx5 Android Bot" | |
git config user.email "102923727+android-fcitx5@users.noreply.github.com" | |
git add . | |
git diff-index --quiet HEAD || git commit -m "Auto update" | |
git push --set-upstream origin "HEAD:master" --follow-tags --atomic |