From d961b6d7a9e21483b5fcd963ce6af009eaedd757 Mon Sep 17 00:00:00 2001 From: NLsdt <98735725+nlsdt@users.noreply.github.com> Date: Fri, 26 Sep 2025 10:13:53 +0800 Subject: [PATCH] chore: add linux build CI file (#1332) * feat: add linux build file * update --------- Co-authored-by: bggRGjQaUbCoE --- .github/workflows/linux.yml | 78 +++++++++++++++++++++++++++++++++++++ linux/CMakeLists.txt | 1 + 2 files changed, 79 insertions(+) create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 00000000..5ecd66c6 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,78 @@ +name: Build for Linux + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review + paths-ignore: + - "**.md" + workflow_dispatch: + inputs: + branch: + required: false + default: "main" + +jobs: + build-linux-app: + name: Release Linux + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.branch }} + fetch-depth: 0 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev unzip webkit2gtk-4.1 libasound2-dev + sudo apt-get install -y gcc g++ autoconf automake debhelper glslang-dev ladspa-sdk xutils-dev libasound2-dev \ + libarchive-dev libbluray-dev libbs2b-dev libcaca-dev libcdio-paranoia-dev libdrm-dev \ + libdav1d-dev libdvdnav-dev libegl1-mesa-dev libepoxy-dev libfontconfig-dev libfreetype6-dev \ + libfribidi-dev libgl1-mesa-dev libgbm-dev libgme-dev libgsm1-dev libharfbuzz-dev libjpeg-dev \ + libbrotli-dev liblcms2-dev libmodplug-dev libmp3lame-dev libopenal-dev \ + libopus-dev libopencore-amrnb-dev libopencore-amrwb-dev libpulse-dev librtmp-dev \ + libsdl2-dev libsixel-dev libssh-dev libsoxr-dev libspeex-dev libtool \ + libv4l-dev libva-dev libvdpau-dev libvorbis-dev libvo-amrwbenc-dev \ + libunwind-dev libvpx-dev libwayland-dev libx11-dev libxext-dev \ + libxkbcommon-dev libxrandr-dev libxss-dev libxv-dev libxvidcore-dev \ + linux-libc-dev nasm ninja-build pkg-config python3 python3-docutils wayland-protocols \ + x11proto-core-dev zlib1g-dev libfdk-aac-dev libtheora-dev libwebp-dev \ + unixodbc-dev libpq-dev libxxhash-dev libaom-dev \ + libgtk-3-0 libblkid1 liblzma5 libmpv-dev + shell: bash + + - name: Setup flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + flutter-version-file: pubspec.yaml + + - name: Get Flutter dependencies + run: flutter pub get + shell: bash + + - name: Set and Extract version + run: | + dart lib/scripts/build.dart + VERSION=$(cat pubspec.yaml | grep 'version:' | sed 's/version: //g' | tr -d '[:space:]') + echo "version=$VERSION" >> $GITHUB_ENV + shell: bash + + #TODO: deb and rpm packages need to be build + - name: Build Linux + run: flutter build linux --release -v + + - name: Package linux build output + run: tar -zcvf PiliPlus_linux_${{ env.version }}_amd64.tar.gz -C build/linux/x64/release/bundle . + + - name: Upload linux outputs + uses: actions/upload-artifact@v4 + with: + name: linux_outputs + path: | + PiliPlus_linux_*.tar.gz diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 496fa7b3..9f43a59e 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -42,6 +42,7 @@ endif() function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_14) target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE -Wno-error=deprecated-declarations) # Allow deprecated warnings target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") endfunction()