Skip to content

Build chiaki-ng msys2 arm64 Windows #33

Build chiaki-ng msys2 arm64 Windows

Build chiaki-ng msys2 arm64 Windows #33

name: Build chiaki-ng msys2 arm64 Windows
on:
workflow_dispatch:
jobs:
build-windows_arm64-msys2:
name: Build windows msys2 arm version
runs-on: windows-11-arm
defaults:
run:
shell: msys2 {0}
steps:
- name: Disable autocrlf
shell: pwsh
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: msys2/setup-msys2@v2
with:
msystem: clangarm64
update: true
install: git
pacboy: >-
ca-certificates:p
cc:p
cmake:p
curl:p
diffutils:p
fast_float:p
fftw:p
hidapi:p
json-c:p
lcms2:p
libdovi:p
meson:p
miniupnpc:p
gcc:p
nasm:p
ninja:p
openssl:p
opus:p
pkgconf:p
protobuf:p
python:p
python-psutil:p
python-glad:p
python-jinja:p
python-pip:p
qt6-base:p
qt6-declarative:p
qt6-svg:p
SDL2:p
shaderc:p
speexdsp:p
spirv-cross:p
vulkan:p
vulkan-headers:p
- name: Install python protobuf and zip
run: |
pip install protobuf
pacman -S git make unzip zip --noconfirm
- name: Build libbplacebo
run: |
scripts/build-libplacebo-windows-arm.sh
- name: Setup ffmpeg
run: |
curl -LO https://github.com/streetpea/FFmpeg-Builds/releases/download/latest/ffmpeg-n7.1-latest-winarm64-gpl-shared-7.1.zip
unzip ffmpeg-n7.1-latest-winarm64-gpl-shared-7.1.zip
cp -a "ffmpeg-n7.1-latest-winarm64-gpl-shared-7.1/bin/." /clangarm64/bin
cp -a "ffmpeg-n7.1-latest-winarm64-gpl-shared-7.1/include/." /clangarm64/include
cp -a "ffmpeg-n7.1-latest-winarm64-gpl-shared-7.1/lib/." /clangarm64/lib
- name: Configure chiaki-ng
run: |
cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCHIAKI_ENABLE_CLI=OFF
- name: Build chiaki-ng
run: |
cmake --build build --config Release --clean-first --target chiaki
- name: Deploy chiaki-ng
run: |
mkdir chiaki-ng-Win
cp build/gui/chiaki.exe chiaki-ng-Win/
export PATH="${{ github.workspace }}/build/third-party/cpp-steam-tools:/clangarm64/share/qt6/bin/:${PATH}"
export QT_PLUGIN_PATH="/clangarm64/share/qt6/plugins"
export QML2_IMPORT_PATH="/clangarm64/share/qt6/qml"
echo chiaki-ng-Win/chiaki.exe > tmp0.txt
while [ -e tmp0.txt ]
do
cp tmp0.txt tmp.txt
rm tmp0.txt
sort -u tmp.txt -o tmp.txt
ldd $(<tmp.txt) | grep -v ":" | cut -d " " -f3 | grep -iv "system32" | grep -iv "not" | xargs -d $'\n' sh -c 'for arg do if [ -n "$arg" ] && [ ! -e "chiaki-ng-Win/${arg##*/}" ]; then echo "Copied $arg"; cp "$arg" chiaki-ng-Win/ ; echo "$arg" >> tmp0.txt; fi; done'
done
windeployqt6.exe --no-translations --qmldir=gui/src/qml chiaki-ng-Win/chiaki.exe
- name: Download d3d12 files
run : |
mkdir d3d12SDK
cd d3d12SDK
curl -Lo d3d12sdk.zip https://www.nuget.org/api/v2/package/Microsoft.Direct3D.D3D12/1.714.0-preview
unzip d3d12sdk.zip
mkdir ../chiaki-ng-Win/D3D12
cp build/native/bin/arm64/*.dll ../chiaki-ng-Win/D3D12/
- name: Package chiaki-ng
run: |
CHIAKI_VERSION_MAJOR="$(grep 'CHIAKI_VERSION_MAJOR' CMakeLists.txt | grep -Eo '[0-9]')"
CHIAKI_VERSION_MINOR="$(grep 'CHIAKI_VERSION_MINOR' CMakeLists.txt | grep -Eo '[0-9]')"
CHIAKI_VERSION_PATCH="$(grep 'CHIAKI_VERSION_PATCH' CMakeLists.txt | grep -Eo '[0-9]')"
RELEASE_PACKAGE_FILE="chiaki-ng-win_arm64-MSYS2-portable-$CHIAKI_VERSION_MAJOR.$CHIAKI_VERSION_MINOR.$CHIAKI_VERSION_PATCH-test-build-${{ github.sha }}.zip"
zip -r $RELEASE_PACKAGE_FILE chiaki-ng-Win
echo "RELEASE_PACKAGE_PATH=${RELEASE_PACKAGE_FILE}" >> $GITHUB_ENV
- name: Upload chiaki-ng Artifact
uses: actions/upload-artifact@v4
with:
name: chiaki-ng-win_arm64-MSYS2-Release-portable.zip
path: ${{ env.RELEASE_PACKAGE_PATH }}
if-no-files-found: error
retention-days: 7
- name: Compile .ISS to .EXE Installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
with:
path: "scripts/chiaki-ng.iss"
options: /O+
- name: Upload chiaki-ng Artifact
uses: actions/upload-artifact@v4
with:
name: chiaki-ng-win_arm64-MSYS2-Release-installer.exe
path: chiaki-ng-windows-installer.exe
if-no-files-found: error
retention-days: 7