feats: add option for maxAllowedWidth #1294
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: build | |
on: | |
push: | |
tags-ignore: | |
- switch-portlibs | |
- mingw-packages | |
- macos-dylib | |
paths-ignore: | |
- scripts/mingw64/*/* | |
- scripts/switch/*/* | |
- debian/* | |
- images/* | |
- CHANGELOG.md | |
- README.md | |
branches: [ dev ] | |
pull_request: | |
paths-ignore: | |
- scripts/mingw64/*/* | |
- scripts/switch/*/* | |
branches: [ dev ] | |
workflow_dispatch: | |
inputs: | |
nx: | |
description: build nintendo switch | |
type: boolean | |
ps4: | |
description: build playstation 4 | |
type: boolean | |
macos: | |
description: build macos dmg | |
type: boolean | |
arm_flatpak: | |
description: build flatpak (aarch64) | |
type: boolean | |
snap: | |
description: build snapcraft | |
type: boolean | |
deb: | |
description: build ubuntu deb | |
type: boolean | |
aur: | |
description: build archlinux package | |
type: boolean | |
mingw64: | |
description: build win64 mingw64 | |
type: boolean | |
msvc: | |
description: build win64 msvc | |
type: boolean | |
permissions: | |
contents: write | |
jobs: | |
upload-release: | |
needs: [ build-mingw, build-nx, build-macos, build-flatpak, build-aur, build-ps4 ] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Download Assets | |
uses: actions/download-artifact@v4 | |
- name: Package Assets | |
run: | | |
for p in Switchfin-windows-*; do | |
[[ -d $p ]] && 7z a -mx=9 $p.7z ./$p/* && rm -rf $p | |
done | |
for p in Switchfin-Flatpak*; do | |
mv $p/Switchfin-Linux.flatpak $p.flatpak && rm -rf $p | |
done | |
rm Switchfin-*/*-debug-*.pkg.tar.* | |
tree | |
- name: Release and Upload Assets | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Switchfin ${{ github.ref_name }} | |
tag_name: ${{ github.ref_name }} | |
generate_release_notes: true | |
draft: true | |
files: | | |
Switchfin-windows-*.7z | |
Switchfin-macOS-*/*.dmg | |
Switchfin-NintendoSwitch-deko3d-*/*.nro | |
Switchfin-PS4-*/*.pkg | |
Switchfin-*.flatpak | |
Switchfin-*/*.pkg.tar.* | |
body: | | |
 | |
build-nx: | |
runs-on: ubuntu-latest | |
if: ${{ inputs.nx || github.event_name != 'workflow_dispatch' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { driver: opengl } | |
- { driver: deko3d, cmake: "-DUSE_DEKO3D=ON", shuffix: "-deko3d" } | |
driver: [opengl, deko3d] | |
container: | |
image: devkitpro/devkita64:20241023 | |
env: | |
BASE_URL: https://github.com/dragonflylee/switchfin/releases/download/switch-portlibs | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Update deko3d dependencies | |
if: ${{ matrix.driver == 'deko3d' }} | |
run: | | |
dkp-pacman --noconfirm -R switch-libmpv | |
dkp-pacman --noconfirm -U $BASE_URL/libuam-master-1-any.pkg.tar.zst | |
- name: Update dependencies | |
run: | | |
dkp-pacman --noconfirm -U $BASE_URL/hacBrewPack-3.05-1-x86_64.pkg.tar.zst | |
for pkg in mbedtls-2.28.9-3 curl-8.7.1-1 harfbuzz-10.1.0-1 ffmpeg-7.1-6 libmpv${{ matrix.shuffix }}-0.36.0-5 nspmini-main-1; do | |
dkp-pacman --noconfirm -U $BASE_URL/switch-${pkg}-any.pkg.tar.zst | |
done | |
git config --system --add safe.directory $GITHUB_WORKSPACE | |
- name: Build nro | |
run: | | |
cmake -B build ${{ matrix.cmake }} \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DPLATFORM_SWITCH=ON -DBUILTIN_NSP=ON \ | |
-DVERSION_BUILD=${{ github.run_number }} | |
make -C build Switchfin.nro -j$(nproc) | |
- name: Upload Assets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Switchfin-NintendoSwitch${{ matrix.shuffix }}-${{ github.run_number }} | |
path: | | |
build/Switchfin.nro | |
build/Switchfin.elf | |
build-ps4: | |
runs-on: ubuntu-latest | |
if: ${{ inputs.ps4 || github.event_name != 'workflow_dispatch' }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build | |
run: | | |
docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) xfangfang/wiliwili_ps4_builder \ | |
"cmake -B build -DPLATFORM_PS4=ON -DVERSION_BUILD=${{ github.run_number }} && \ | |
make -C build -j$(nproc)" | |
- name: Upload Assets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Switchfin-PS4-${{ github.run_number }} | |
path: | | |
build/Switchfin.oelf | |
build/*.pkg | |
build-flatpak: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [ x86_64, aarch64 ] | |
container: | |
image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08 | |
options: --privileged | |
if: ${{ inputs.arm_flatpak || github.event_name != 'workflow_dispatch' }} | |
steps: | |
- uses: actions/checkout@v4 | |
if: ${{ matrix.arch == 'x86_64' || inputs.arm_flatpak || startsWith(github.ref, 'refs/tags/') }} | |
with: | |
submodules: recursive | |
- name: Install docker | |
if: ${{ matrix.arch == 'aarch64' && (inputs.arm_flatpak || startsWith(github.ref, 'refs/tags/')) }} | |
run: dnf -y install docker | |
- name: Set up QEMU | |
if: ${{ matrix.arch == 'aarch64' && (inputs.arm_flatpak || startsWith(github.ref, 'refs/tags/')) }} | |
uses: docker/setup-qemu-action@v3 | |
- name: Set workspace permissions | |
run: git config --system --add safe.directory $GITHUB_WORKSPACE | |
- name: Build flatpak | |
uses: flatpak/flatpak-github-actions/flatpak-builder@master | |
if: ${{ matrix.arch == 'x86_64' || inputs.arm_flatpak || startsWith(github.ref, 'refs/tags/') }} | |
with: | |
bundle: Switchfin-Linux-${{ matrix.arch }}-${{ github.run_number }}.flatpak | |
manifest-path: scripts/flatpak.yaml | |
cache-key: flatpak-builder-${{ hashFiles('scripts/flatpak.yaml') }} | |
upload-artifact: false | |
arch: ${{ matrix.arch }} | |
- name: Upload Assets | |
uses: actions/upload-artifact@v4 | |
if: ${{ matrix.arch == 'x86_64' || inputs.arm_flatpak || startsWith(github.ref, 'refs/tags/') }} | |
with: | |
name: Switchfin-Flatpak-${{ matrix.arch }}-${{ github.run_number }} | |
path: Switchfin-*.flatpak | |
if-no-files-found: error | |
build-deb: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { img: ubuntu, tag: focal } | |
- { img: ubuntu, tag: noble } | |
- { img: debian, tag: bookworm } | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/${{ github.repository_owner }}/build:${{ matrix.img }}-${{ matrix.tag }} | |
if: ${{ inputs.deb || github.event_name != 'workflow_dispatch' }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache depends | |
id: cache-deps | |
uses: actions/cache@v4 | |
with: | |
path: /opt/switchfin | |
key: deps-${{ matrix.img }}-${{ matrix.tag }} | |
- name: Build depends | |
if: steps.cache-deps.outputs.cache-hit != 'true' | |
run: make -f debian/rules curl glfw mpv | |
- name: Build deb | |
env: | |
DH_QUIET: "1" | |
run: | | |
git config --system --add safe.directory $GITHUB_WORKSPACE | |
dpkg-buildpackage -b -nc | |
mv ../switchfin_*.deb $GITHUB_WORKSPACE | |
- name: Upload Assets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Switchfin-${{ matrix.img }}-${{ matrix.tag }}-${{ github.run_number }} | |
path: switchfin_*.deb | |
build-snap: | |
runs-on: ubuntu-latest | |
if: ${{ inputs.snap }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build snap | |
run: | | |
docker run --rm --tty --network host -v $PWD:/work -w /work/scripts --privileged diddledani/snapcraft:core20 | |
- name: Upload Assets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Switchfin-Snapcraft-${{ github.run_number }} | |
path: scripts/*.snap | |
build-aur: | |
runs-on: ubuntu-latest | |
if: ${{ inputs.aur || github.event_name != 'workflow_dispatch' }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build aur | |
run: | | |
docker run --rm --tty --network host -v $PWD:/work -e PUID=$(id -u) -w /work/scripts/aur archlinux bash entrypoint.sh | |
- name: Upload Assets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Switchfin-Archlinux-${{ github.run_number }} | |
path: scripts/aur/*.pkg.tar.* | |
build-macos: | |
runs-on: macos-latest | |
if: ${{ inputs.macos || github.event_name != 'workflow_dispatch' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- tag: Silicon | |
arch: arm64 | |
target: "11.0" | |
- tag: Intel | |
arch: x86_64 | |
target: "10.15" | |
- tag: Intel_Old | |
arch: x86_64 | |
target: "10.11" | |
cmake: -DUSE_BOOST_FILESYSTEM=ON | |
tag: [ Silicon, Intel, Intel_Old ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install deps | |
run: | | |
brew install create-dmg dylibbundler | |
curl -sSL https://github.com/dragonflylee/switchfin/releases/download/macos-dylib/dylib-ffmpeg71-${{ matrix.tag }}.tar.gz | tar zxf - -C /tmp | |
- name: Build App | |
env: | |
DYLD_LIBRARY_PATH: /tmp/lib | |
run: | | |
cmake -B build ${{ matrix.cmake }} \ | |
-DCMAKE_PREFIX_PATH=/tmp \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DPLATFORM_DESKTOP=ON \ | |
-DUSE_SYSTEM_GLFW=ON \ | |
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} \ | |
-DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.target }} \ | |
-DVERSION_BUILD=${{ github.run_number }} | |
make -C build -j$(sysctl -n hw.ncpu) | |
- name: Create DMG | |
run: | | |
mkdir -p dist | |
mv build/Switchfin.app dist/ | |
cp README.md dist | |
dist/Switchfin.app/Contents/MacOS/Switchfin -version | |
create-dmg --window-pos 200 120 --window-size 800 400 \ | |
--icon-size 100 --icon "Switchfin.app" 200 190 \ | |
--icon "README.md" 400 100 --hide-extension "Switchfin.app" \ | |
--app-drop-link 600 185 --volicon ./scripts/macos/dmg.icns \ | |
--volname "Switchfin" Switchfin-macOS-${{ matrix.tag }}-${{ github.run_number }}.dmg "dist/" | |
- name: Upload Assets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Switchfin-macOS-${{ matrix.tag }}-${{ github.run_number }} | |
path: Switchfin-*.dmg | |
build-mingw: | |
if: ${{ inputs.mingw64 == true || github.event_name != 'workflow_dispatch'}} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { arch: x64, msystem: MINGW64 } | |
- { arch: x86, msystem: MINGW32 } | |
arch: [ x64, x86 ] | |
runs-on: windows-latest | |
env: | |
MSYSTEM: ${{ matrix.msystem }} | |
MSYS2_PATH_TYPE: inherit | |
defaults: | |
run: | |
shell: C:\shells\msys2bash.cmd {0} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install dependency | |
run: | | |
for pkg in glfw-3.5.0-1 curl-8.11.1-1 mpv-0.39.0-4 libwebp-1.4.0-1; do | |
curl -sLO https://github.com/dragonflylee/switchfin/releases/download/mingw-packages/${MINGW_PACKAGE_PREFIX}-${pkg}-any.pkg.tar.zst | |
done | |
pacman -U --noconfirm *.pkg.tar.zst | |
pacman -S --needed --noconfirm \ | |
${MINGW_PACKAGE_PREFIX}-cc \ | |
${MINGW_PACKAGE_PREFIX}-ninja unzip | |
curl -sLO https://github.com/rainers/cv2pdb/releases/download/v0.53/cv2pdb-0.53.zip | |
unzip cv2pdb-0.53.zip cv2pdb64.exe -d /usr/bin | |
- if: matrix.msystem == 'MINGW32' | |
name: Config Editbin | |
shell: powershell | |
run: | | |
$vcvarsall_path = vswhere.exe -latest -products * -find "VC\Auxiliary\Build\vcvarsall.bat" | |
$cc1_path = Get-ChildItem -Path "C:\msys64\mingw32\lib\gcc" -Filter cc1plus.exe -Recurse -ErrorAction SilentlyContinue | ForEach-Object { $_.FullName } | |
cmd.exe /c "call ""$vcvarsall_path"" x86_amd64 && editbin /LARGEADDRESSAWARE $cc1_path" | |
- name: Build | |
run: | | |
cmake -B build -G Ninja \ | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DPLATFORM_DESKTOP=ON \ | |
-DWIN32_TERMINAL=OFF \ | |
-DZLIB_USE_STATIC_LIBS=ON \ | |
-DUSE_SYSTEM_GLFW=ON \ | |
-DUSE_D3D11=ON \ | |
-DUSE_LIBROMFS=ON \ | |
-DVERSION_BUILD=${{ github.run_number }} | |
cmake --build build | |
cv2pdb64 build/Switchfin.exe | |
cp -a README.md ${MINGW_PREFIX}/bin/libmpv-2.dll build | |
- name: Upload Assets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Switchfin-windows-${{ matrix.arch }}-${{ github.run_number }} | |
path: | | |
build/Switchfin.exe | |
build/Switchfin.pdb | |
build/libmpv-2.dll | |
build/README.md |