suyu-linux-build #14
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: suyu-linux-build | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'select branch to build(default: dev)' | |
required: false | |
default: 'dev' | |
# schedule: | |
# - cron: "0 0 * * *" | |
jobs: | |
suyu_linux_build: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Ninja | |
uses: ashutoshvarma/[email protected] | |
- name: Download and install Boost | |
uses: MarkusJx/[email protected] | |
id: install-boost | |
with: | |
boost_version: 1.79.0 | |
platform_version: 22.04 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '6.6.1' | |
host: 'linux' | |
target: 'desktop' | |
install-deps: 'true' | |
- name: Download suyu source code | |
run: | | |
cd ${{ github.workspace }} | |
git clone --branch ${{ github.event.inputs.branch || 'dev' }} https://git.suyu.dev/suyu/suyu.git --recursive | |
- id: version | |
name: Get version | |
run: | | |
echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT | |
cd ${{ github.workspace }}/suyu | |
echo "hash=$(git log -1 --pretty=format:%H)" >> $GITHUB_OUTPUT | |
echo "short_hash=$(git describe --always --long)" >> $GITHUB_OUTPUT | |
echo "version=$(git describe --tags --always)" >> $GITHUB_OUTPUT | |
- name: Prepare environment | |
run: | | |
sudo apt update | |
sudo apt-get install ccache autoconf cmake g++-11 gcc-11 git glslang-tools libasound2 libboost-context-dev libglu1-mesa-dev libhidapi-dev libpulse-dev libtool libudev-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxext-dev libxkbcommon-x11-0 mesa-common-dev nasm ninja-build qtbase5-dev qtbase5-private-dev qtwebengine5-dev qtmultimedia5-dev libmbedtls-dev catch2 libfmt-dev liblz4-dev nlohmann-json3-dev libzstd-dev libssl-dev libavfilter-dev libavcodec-dev libswscale-dev | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '6.3.1' | |
host: 'linux' | |
dir: '${{ github.workspace }}/suyu/' | |
set-env: true | |
modules: 'qtnetworkauth qtwebengine' | |
- name: Build Linux | |
run: | | |
cd ${{ github.workspace }}/suyu | |
set -e | |
ccache -sv | |
mkdir build || true && cd build | |
cmake .. \ | |
-DBoost_USE_STATIC_LIBS=ON \ | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DSUYU_USE_PRECOMPILED_HEADERS=OFF \ | |
-DDYNARMIC_USE_PRECOMPILED_HEADERS=OFF \ | |
-DCMAKE_CXX_FLAGS="-march=x86-64-v2" \ | |
-DCMAKE_CXX_COMPILER=g++ \ | |
-DCMAKE_C_COMPILER=gcc \ | |
-DCMAKE_INSTALL_PREFIX="/usr" \ | |
-DDISPLAY_VERSION="1.0.0" \ | |
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF \ | |
-DENABLE_QT_TRANSLATION=OFF \ | |
-DSUYU_USE_BUNDLED_VCPKG=ON \ | |
-DUSE_DISCORD_PRESENCE=ON \ | |
-DSUYU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \ | |
-DSUYU_USE_BUNDLED_FFMPEG=ON \ | |
-DSUYU_ENABLE_LTO=OFF \ | |
-DSUYU_CRASH_DUMPS=ON \ | |
-DENABLE_QT6=ON \ | |
-DSUYU_USE_FASTER_LD=ON \ | |
-DBoost_INCLUDE_DIR=${{steps.install-boost.outputs.BOOST_ROOT}}/include \ | |
-DBoost_LIBRARY_DIRS=${{steps.install-boost.outputs.BOOST_ROOT}}/lib \ | |
-DQT6_LOCATION=${QT_ROOT_DIR} \ | |
-GNinja | |
ninja | |
ccache -sv | |
# - name: Release Suyu Android (Suyu-Android) | |
# uses: softprops/action-gh-release@v2 | |
# with: | |
# name: Suyu Android ${{ steps.version.outputs.date }} | |
# tag_name: suyu-android | |
# files: ${{ github.workspace }}/suyu-${{ steps.version.outputs.date }}-${{ steps.version.outputs.version }}.apk | |
# - name: Release Suyu Linux ${{ steps.version.outputs.date }} | |
# uses: softprops/action-gh-release@v2 | |
# with: | |
# name: ${{ steps.version.outputs.date }} | |
# tag_name: ${{ steps.version.outputs.date }} | |
# files: ${{ github.workspace }}/suyu-${{ steps.version.outputs.date }}-${{ steps.version.outputs.version }}.apk |