Skip to content

Commit

Permalink
Merge branch 'main' of github.com:streetpea/chiaki-ng
Browse files Browse the repository at this point in the history
streetpea committed Dec 13, 2024
2 parents 21fdc17 + 3f81161 commit 3fa4aa8
Showing 5 changed files with 226 additions and 20 deletions.
62 changes: 59 additions & 3 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
@@ -305,15 +305,71 @@ jobs:
cp scripts/qtwebengine_import.qml gui/src/qml/
- name: Run build script
working-directory: chiaki-ng/scripts
working-directory: chiaki-ng
run: |
set -xe
podman run --rm \
-v "`pwd`:/build/chiaki" \
-w "/build/chiaki" \
--device /dev/fuse \
--cap-add SYS_ADMIN \
-t docker.io/streetpea/chiaki-ng-builder:qt6.7 \
/bin/bash -c "sudo -E scripts/build-appimage.sh /build/appdir"
cp appimage/chiaki-ng.AppImage appimage/chiaki-ng.AppImage_x86_64
- name: Upload chiaki-ng Artifact
uses: nanoufo/action-upload-artifacts-and-release-assets@v2
with:
path: |
chiaki-ng/appimage/chiaki-ng.AppImage_x86_64
upload-release-files: true
if-no-files-found: error
release-upload-url: ${{ needs.create-release.outputs.upload_url }}

build-appimage_arm64:
name: Build chiaki-ng appimage_arm64
runs-on: ubuntu-latest
steps:
- name: Setup Podman
run: |
sudo apt update
sudo apt-get -y install podman
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'recursive'
path: 'chiaki-ng'

- name: Add QmlWebEngine Import
working-directory: chiaki-ng
run: |
cp scripts/qtwebengine_import.qml gui/src/qml/
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: "arm64"

- name: Run build script
working-directory: chiaki-ng
run: |
./run-podman-build-appimage.sh
set -xe
podman run --rm \
-v "`pwd`:/build/chiaki" \
-w "/build/chiaki" \
--platform linux/arm64 \
--device /dev/fuse \
--cap-add SYS_ADMIN \
-t docker.io/streetpea/chiaki-ng-builder:qt6.7 \
/bin/bash -c "sudo -E scripts/build-appimage.sh /build/appdir"
cp appimage/chiaki-ng.AppImage appimage/chiaki-ng.AppImage_arm64
- name: Upload chiaki-ng Artifact
uses: nanoufo/action-upload-artifacts-and-release-assets@v2
with:
path: |
chiaki-ng/appimage/chiaki-ng.AppImage
chiaki-ng/appimage/chiaki-ng.AppImage_arm64
upload-release-files: true
if-no-files-found: error
release-upload-url: ${{ needs.create-release.outputs.upload_url }}
62 changes: 59 additions & 3 deletions .github/workflows/build-weekly.yaml
Original file line number Diff line number Diff line change
@@ -292,15 +292,71 @@ jobs:
cp scripts/qtwebengine_import.qml gui/src/qml/
- name: Run build script
working-directory: chiaki-ng/scripts
working-directory: chiaki-ng
run: |
set -xe
podman run --rm \
-v "`pwd`:/build/chiaki" \
-w "/build/chiaki" \
--device /dev/fuse \
--cap-add SYS_ADMIN \
-t docker.io/streetpea/chiaki-ng-builder:qt6.7 \
/bin/bash -c "sudo -E scripts/build-appimage.sh /build/appdir"
cp appimage/chiaki-ng.AppImage appimage/chiaki-ng.AppImage_x86_64
- name: Upload chiaki-ng Artifact
uses: nanoufo/action-upload-artifacts-and-release-assets@v2
with:
path: |
chiaki-ng/appimage/chiaki-ng.AppImage_x86_64
upload-release-files: true
if-no-files-found: error
release-upload-url: ${{ needs.create-release.outputs.upload_url }}

build-appimage_arm64:
name: Build chiaki-ng appimage_arm64
runs-on: ubuntu-latest
steps:
- name: Setup Podman
run: |
sudo apt update
sudo apt-get -y install podman
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'recursive'
path: 'chiaki-ng'

- name: Add QmlWebEngine Import
working-directory: chiaki-ng
run: |
cp scripts/qtwebengine_import.qml gui/src/qml/
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: "arm64"

- name: Run build script
working-directory: chiaki-ng
run: |
./run-podman-build-appimage.sh
set -xe
podman run --rm \
-v "`pwd`:/build/chiaki" \
-w "/build/chiaki" \
--platform linux/arm64 \
--device /dev/fuse \
--cap-add SYS_ADMIN \
-t docker.io/streetpea/chiaki-ng-builder:qt6.7 \
/bin/bash -c "sudo -E scripts/build-appimage.sh /build/appdir"
cp appimage/chiaki-ng.AppImage appimage/chiaki-ng.AppImage_arm64
- name: Upload chiaki-ng Artifact
uses: nanoufo/action-upload-artifacts-and-release-assets@v2
with:
path: |
chiaki-ng/appimage/chiaki-ng.AppImage
chiaki-ng/appimage/chiaki-ng.AppImage_arm64
upload-release-files: true
if-no-files-found: error
release-upload-url: ${{ needs.create-release.outputs.upload_url }}
42 changes: 30 additions & 12 deletions scripts/build-appimage.sh
Original file line number Diff line number Diff line change
@@ -47,20 +47,38 @@ cd appimage
export ARCH="$(uname -m)"
curl -L -O https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${ARCH}.AppImage
chmod +x linuxdeploy-${ARCH}.AppImage
curl -L -O https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${ARCH}.AppImage
chmod +x linuxdeploy-plugin-qt-${ARCH}.AppImage

export LD_LIBRARY_PATH="${QT_PATH}/${QT_VERSION}/${GCC_STRING}/lib:$(pwd)/../build_appimage/third-party/cpp-steam-tools:$LD_LIBRARY_PATH"
export QML_SOURCES_PATHS="$(pwd)/../gui/src/qml"

APPIMAGE_EXTRACT_AND_RUN=1 ./linuxdeploy-${ARCH}.AppImage \
--appdir="${appdir}" \
-e "${appdir}/usr/bin/chiaki" \
-d "${appdir}/usr/share/applications/chiaking.desktop" \
--plugin qt \
--exclude-library='libva*' \
--exclude-library='libvulkan*' \
--exclude-library='libhidapi*' \
--output appimage
if [ "$(uname -m)" = "aarch64" ]
then
curl -LO https://github.com/multiarch/qemu-user-static/releases/download/v7.2.0-1/qemu-aarch64-static
chmod +x qemu-aarch64-static
curl -LO https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-aarch64.AppImage
chmod +x appimagetool-aarch64.AppImage
./qemu-aarch64-static ./linuxdeploy-${ARCH}.AppImage \
--appdir="${appdir}" \
-e "${appdir}/usr/bin/chiaki" \
-d "${appdir}/usr/share/applications/chiaking.desktop" \
--exclude-library='libva*' \
--exclude-library='libvulkan*' \
--exclude-library='libhidapi*'
curl -L -O https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${ARCH}.AppImage
chmod +x linuxdeploy-plugin-qt-${ARCH}.AppImage
./qemu-aarch64-static ./linuxdeploy-plugin-qt-${ARCH}.AppImage --appdir="${appdir}"
./qemu-aarch64-static ./appimagetool-aarch64.AppImage "${appdir}"
else
curl -L -O https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${ARCH}.AppImage
chmod +x linuxdeploy-plugin-qt-${ARCH}.AppImage
./linuxdeploy-${ARCH}.AppImage \
--appdir="${appdir}" \
-e "${appdir}/usr/bin/chiaki" \
-d "${appdir}/usr/share/applications/chiaking.desktop" \
--plugin qt \
--exclude-library='libva*' \
--exclude-library='libvulkan*' \
--exclude-library='libhidapi*' \
--output appimage
fi

mv chiaki-ng-${ARCH}.AppImage chiaki-ng.AppImage
74 changes: 74 additions & 0 deletions scripts/build-small-appimage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/bash

set -xe

if [ "$(uname -m)" = "aarch64" ]
then
export GCC_STRING="gcc_arm64"
else
export GCC_STRING="gcc_64"
fi

export PATH="${QT_PATH}/${QT_VERSION}/${GCC_STRING}/bin:$PATH"


# sometimes there are errors in linuxdeploy in docker/podman when the appdir is on a mount
appdir=${1:-`pwd`/appimage/appdir}

export PATH="`pwd`/appimage/protoc/bin:$PATH"
cd build_appimage
qt-cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCHIAKI_ENABLE_TESTS=ON \
-DCHIAKI_ENABLE_GUI=ON \
-DCHIAKI_GUI_ENABLE_SDL_GAMECONTROLLER=ON \
-DCMAKE_INSTALL_PREFIX=/usr \
..
cd ..

# purge leftover proto/nanopb_pb2.py which may have been created with another protobuf version
rm -fv third-party/nanopb/generator/proto/nanopb_pb2.py

ninja -C build_appimage
build_appimage/test/chiaki-unit

DESTDIR="${appdir}" ninja -C build_appimage install
cd appimage

export ARCH="$(uname -m)"
curl -L -O https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${ARCH}.AppImage
chmod +x linuxdeploy-${ARCH}.AppImage
curl -L -O https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${ARCH}.AppImage
chmod +x linuxdeploy-plugin-qt-${ARCH}.AppImage

export LD_LIBRARY_PATH="${QT_PATH}/${QT_VERSION}/${GCC_STRING}/lib:$(pwd)/../build_appimage/third-party/cpp-steam-tools:$LD_LIBRARY_PATH"
export QML_SOURCES_PATHS="$(pwd)/../gui/src/qml"
if [ "$(uname -m)" = "aarch64" ]
then
curl -LO https://github.com/multiarch/qemu-user-static/releases/download/v7.2.0-1/qemu-aarch64-static
chmod +x qemu-aarch64-static
curl -LO https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-aarch64.AppImage
chmod +x appimagetool-aarch64.AppImage
./qemu-aarch64-static ./linuxdeploy-${ARCH}.AppImage \
--appdir="${appdir}" \
-e "${appdir}/usr/bin/chiaki" \
-d "${appdir}/usr/share/applications/chiaking.desktop" \
--exclude-library='libva*' \
--exclude-library='libvulkan*' \
--exclude-library='libhidapi*'
./qemu-aarch64-static ./linuxdeploy-plugin-qt-${ARCH}.AppImage --appdir="${appdir}"
./qemu-aarch64-static ./appimagetool-aarch64.AppImage "${appdir}"
else
./linuxdeploy-${ARCH}.AppImage \
--appdir="${appdir}" \
-e "${appdir}/usr/bin/chiaki" \
-d "${appdir}/usr/share/applications/chiaking.desktop" \
--plugin qt \
--exclude-library='libva*' \
--exclude-library='libvulkan*' \
--exclude-library='libhidapi*' \
--output appimage
fi

mv chiaki-ng-${ARCH}.AppImage chiaki-ng.AppImage
6 changes: 4 additions & 2 deletions scripts/fetch-protoc.sh
Original file line number Diff line number Diff line change
@@ -8,11 +8,13 @@ ROOT="`pwd`"

if [ "$(uname -m)" = "aarch64" ]
then
URL='https://github.com/protocolbuffers/protobuf/releases/download/v29.1/protoc-29.1-linux-aarch_64.zip'
export ARCH_SUFFIX="aarch_64"
else
URL='https://github.com/protocolbuffers/protobuf/releases/download/v29.1/protoc-29.1-linux-x86_64.zip'
export ARCH_SUFFIX="x86_64"
fi

URL=https://github.com/protocolbuffers/protobuf/releases/download/v3.9.1/protoc-3.9.1-linux-${ARCH_SUFFIX}.zip

curl -L "$URL" -o protoc.zip
unzip protoc.zip -d protoc

0 comments on commit 3fa4aa8

Please sign in to comment.