This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
306 additions
and
41 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
name: suyu-linux-build | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'select branch to build(default: dev)' | ||
required: false | ||
default: 'dev' | ||
release_type: | ||
description: 'select release_type to build(default: mainline)' | ||
required: false | ||
default: 'mainline' | ||
schedule: | ||
- cron: "0 0 */2 * *" | ||
|
||
jobs: | ||
suyu_linux_build: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: { ref: main } | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup Ninja | ||
uses: ashutoshvarma/setup-ninja@v1.1 | ||
|
||
- name: Download and install Boost | ||
uses: MarkusJx/install-boost@v2.4.5 | ||
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 "version=$(git describe --tags --always)" >> $GITHUB_OUTPUT | ||
- name: Set up cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cache | ||
key: ${{ runner.os }}-suyu-linux-${{ steps.version.outputs.hash }} | ||
restore-keys: | | ||
${{ runner.os }}-suyu-linux- | ||
- 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: 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: Package Artifacts | ||
run: | | ||
export DATE=${{ steps.version.outputs.date }} | ||
export VERSION=${{ steps.version.outputs.version }} | ||
export WORKSPACE=${{ github.workspace }} | ||
export RELEASE_TYPE=${{ github.event.inputs.release_type || 'mainline' }} | ||
cd ${{ github.workspace }}/suyu/build | ||
bash ${{ github.workspace }}/script/package_suyu_linux.sh | ||
- name: Release Suyu Linux (Suyu-Linux) | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
name: Suyu Linux ${{ steps.version.outputs.date }} | ||
tag_name: suyu-linux | ||
files: suyu-linux-${{ github.event.inputs.release_type || 'mainline' }}-${{ steps.version.outputs.date }}-${{ steps.version.outputs.version }}.AppImage | ||
|
||
- 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: suyu-linux-${{ github.event.inputs.release_type || 'mainline' }}-${{ steps.version.outputs.date }}-${{ steps.version.outputs.version }}.AppImage |
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
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
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
Oops, something went wrong.