Skip to content

Merge pull request #37 from MKN-Makuno/over_the_rainbow_Xp #15

Merge pull request #37 from MKN-Makuno/over_the_rainbow_Xp

Merge pull request #37 from MKN-Makuno/over_the_rainbow_Xp #15

Workflow file for this run

name: build
on: [push, pull_request]
jobs:
linux-build:
runs-on: ubuntu-20.04
strategy:
matrix:
ffmpeg: [n5.0, n6.0]
steps:
- name: Update APT
run: sudo apt-get update
- name: Install Dependencies
run: |
sudo apt-get install --assume-yes build-essential git make cmake autoconf automake libcurl4-openssl-dev \
libtool pkg-config libasound2-dev libpulse-dev libaudio-dev \
libjack-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev \
libxfixes-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev \
libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \
libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \
libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ">=3.10"
- name: Checkout love-appimage-source
uses: actions/checkout@v4
with:
repository: DarkEnergyProcessor/ls2-love-appimage-script
- name: Checkout LÖVE
uses: actions/checkout@v4
with:
repository: DarkEnergyProcessor/livesim3-love
path: love2d-master
submodules: recursive
- name: Checkout livesim2
uses: actions/checkout@v4
with:
path: depls2
submodules: true
- name: Get love-appimage-source Commit
id: las
run: python depls2/build-util/gha_commit_hash.py
- name: Get LOVE Commit
id: love
working-directory: love2d-master
run: python ../depls2/build-util/gha_commit_hash.py
- name: Pre-Prepare AppImage
run: make appimagetool LuaJIT-v2.1/Makefile
- name: Get LuaJIT branch
id: luajit
working-directory: LuaJIT-v2.1
run: python ../depls2/build-util/gha_commit_hash.py
- name: Restore Compiled AppImage
id: appimage
uses: actions/cache@v4
with:
key: ${{ steps.las.outputs.commit }}-${{ steps.luajit.outputs.commit }}-${{ steps.love.outputs.commit }}-${{ matrix.ffmpeg }}
path: squashfs-root
- name: Get Dependencies for AppImage
if: steps.appimage.outputs.cache-hit != 'true'
shell: python
env:
FFMPEG_BRANCH: ${{ matrix.ffmpeg }}
run: |
import os
for i in range(250):
if os.system(f"make getdeps FFMPEG_BRANCH={os.environ['FFMPEG_BRANCH']} LOVE_BRANCH=master") == 0:
raise SystemExit(0)
raise Exception("make getdeps failed")
- name: Build AppImage
if: steps.appimage.outputs.cache-hit != 'true'
env:
FFMPEG_BRANCH: ${{ matrix.ffmpeg }}
run: make FFMPEG_BRANCH=$FFMPEG_BRANCH LOVE_BRANCH=master
- name: Extract AppImage
if: steps.appimage.outputs.cache-hit != 'true'
run: ./love-master.AppImage --appimage-extract
- name: Copy squashfs-root to dist
run: cp -r squashfs-root dist
- name: Add livesim2
run: cp -r depls2 dist/share/livesim2
- name: Delete Stuff
working-directory: dist/share/livesim2
run: rm -rf .git build-util
- name: Update AppImage Metadata
working-directory: dist
run: |
set -e
rm love.svg love.desktop
cp ../depls2/assets/image/icon/new_icon_1024x1024.png livesim2.png
cp ../depls2/build-util/livesim2.desktop livesim2.desktop
- name: Build tar
working-directory: dist
run: tar cvzf ../livesim2.tar.gz *
- name: Build AppImage
run: ./appimagetool dist livesim2.AppImage
- name: Artifact AppImage
uses: actions/upload-artifact@v4
with:
name: livesim2-ffmpeg-${{ matrix.ffmpeg }}.AppImage
path: livesim2.AppImage
if-no-files-found: error
- name: Artifact tar
uses: actions/upload-artifact@v4
with:
name: livesim2-ffmpeg-${{ matrix.ffmpeg }}.tar.gz
path: livesim2.tar.gz
if-no-files-found: error
windows-build:
# windows-latest is required due to setCaseSensitiveInfo
runs-on: windows-latest
strategy:
matrix:
ffmpeg: ["5.0.1", "6.0"]
defaults:
run:
shell: cmd
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ">=3.10"
- name: Make Directory and Set Case Sensitive Mode
run: |
mkdir depls2
if errorlevel 1 exit /b 1
fsutil file setCaseSensitiveInfo depls2
if errorlevel 1 exit /b 1
- name: Checkout
uses: actions/checkout@v4
with:
path: depls2
- name: Clone Megasource
uses: actions/checkout@v4
with:
path: megasource
repository: love2d/megasource
ref: 11.x
- name: Get Megasource Commit
id: megasource
working-directory: megasource
run: python ../depls2/build-util/gha_commit_hash.py
- name: Checkout LOVE
uses: actions/checkout@v4
with:
path: megasource/libs/love
repository: DarkEnergyProcessor/livesim3-love
submodules: recursive
- name: Get LOVE Commit
id: love
working-directory: megasource/libs/love
run: python ../../../depls2/build-util/gha_commit_hash.py
- name: Restore Resource Hacker
id: resourcehacker
uses: actions/cache@v4
with:
key: resourcehacker
path: resourcehacker
- name: Get Resource Hacker
if: steps.resourcehacker.outputs.cache-hit != 'true'
run: |
curl -Lfo resourcehacker.zip http://www.angusj.com/resourcehacker/resource_hacker.zip
if errorlevel 1 exit /b 1
mkdir resourcehacker
if errorlevel 1 exit /b 1
7z x -oresourcehacker resourcehacker.zip
if errorlevel 1 exit /b 1
- name: Generate Icon
run: magick convert depls2/assets/image/icon/new_icon_1024x1024.png -resize 256x256 -define icon:auto-resize="256,128,96,64,48,32,16" livesim2.ico
- name: Generate Resource File
run: |
copy /y depls2\build-util\livesim2.manifest livesim2.manifest
if errorlevel 1 exit /b 1
python depls2/build-util/create_rc.py depls2/main.lua livesim2.rc
if errorlevel 1 exit /b 1
start "" /B /WAIT resourcehacker\ResourceHacker.exe -open livesim2.rc -save livesim2.res -action compile
- name: Download FFmpeg Development Libraries
env:
FFMPEG_VERSION: ${{ matrix.ffmpeg }}
run: curl -Lo ffmpeg-dev.7z https://github.com/GyanD/codexffmpeg/releases/download/%FFMPEG_VERSION%/ffmpeg-%FFMPEG_VERSION%-full_build-shared.7z
- name: Extract FFmpeg Development Libraries
run: 7z x ffmpeg-dev.7z
- name: Restore Compiled LOVE
id: lovec
uses: actions/cache@v4
with:
path: installdir
key: ${{ steps.megasource.outputs.commit }}-${{ steps.love.outputs.commit }}-${{ matrix.ffmpeg }}
- name: Configure
if: steps.lovec.outputs.cache-hit != 'true'
env:
FFMPEG_VERSION: ${{ matrix.ffmpeg }}
run: |
set BUILD_TARGET=x64
set LS2X_LIBAV_TARGET=-DLS2X_LIBAV_INCLUDE_DIR=%CD%\ffmpeg-%FFMPEG_VERSION%-full_build-shared\include
cmake -Bbuild -Smegasource -T v143 -A %BUILD_TARGET% --install-prefix=%CD%\installdir %LS2X_LIBAV_TARGET% -DLOVE_MPG123=0
- name: Build
if: steps.lovec.outputs.cache-hit != 'true'
run: cmake --build build --config Release --target install -j2
- name: Archive Lua Scripts
working-directory: depls2
run: |
echo 1> OUTSIDE_ASSET
7z a -ssc ../livesim2_luascript.zip -ir!*.lua OUTSIDE_ASSET
if errorlevel 1 exit /b 1
del OUTSIDE_ASSET
exit /b 0
- name: Make dist Directory
run: |
mkdir dist
if errorlevel 1 exit /b 1
fsutil file setCaseSensitiveInfo dist
if errorlevel 1 exit /b 1
- name: Copy depls2 to dist
run: xcopy depls2 dist /e /y /h /r
- name: Delete Some Stuff
working-directory: dist
run: |
del /s /q *.lua love_*.exe TODO.txt .gitignore .gitmodules mpg123.dll
rmdir /s /q .git .github build-util docs game libs
exit /b 0
- name: Copy LOVE to dist
run: |
xcopy installdir dist /e /y /h /r
if errorlevel 1 exit /b 1
del /s /q love_*.exe mpg123.dll
exit /b 0
- name: Replace Resource Data
run: |
copy /Y /B dist\lovec_*.exe temp.exe
if errorlevel 1 exit /b 1
start "" /B /WAIT resourcehacker\ResourceHacker.exe -open temp.exe -save newtemp.exe -action addoverwrite -res livesim2.res
- name: Fuse
run: copy /B newtemp.exe+livesim2_luascript.zip dist\livesim2.exe
- name: Test Version
working-directory: dist
run: livesim2.exe -version
- name: Artifact
uses: actions/upload-artifact@v4
with:
name: livesim2-ffmpeg-${{ matrix.ffmpeg }}
path: dist
if-no-files-found: error
android-build:
runs-on: ubuntu-latest
strategy:
matrix:
build_type: [Debug, Release]
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ">=3.10"
- name: Setup Java 17
uses: actions/setup-java@v4
with:
distribution: adopt-hotspot
java-version: 17
- name: Get livesim3-love-android Commit
id: ls3a
run: git ls-remote https://github.com/DarkEnergyProcessor/livesim3-love-android master | awk '{ print "commit="$1}' >> $GITHUB_OUTPUT
- name: Restore livesim3-love-android Cache
id: ls3a_cache
uses: actions/cache@v4
with:
key: ${{ steps.ls3a.outputs.commit }}-${{ matrix.build_type }}
path: livesim3-love-android-cached
- name: Checkout livesim3-love-android
uses: actions/checkout@v4
if: ${{ steps.ls3a_cache.outputs.cache-hit != 'true' }}
with:
repository: DarkEnergyProcessor/livesim3-love-android
path: livesim3-love-android
submodules: recursive
- name: Build livesim3-love-android
if: ${{ steps.ls3a_cache.outputs.cache-hit != 'true' }}
working-directory: livesim3-love-android
run: bash ./gradlew assembleEmbedNoRecord${{ matrix.build_type }}
- name: Copy Partially Compiled Directory (Cache Miss)
if: ${{ steps.ls3a_cache.outputs.cache-hit != 'true' }}
run: cp -r livesim3-love-android livesim3-love-android-cached
- name: Copy Partially Compiled Directory (Cache Hit)
if: ${{ steps.ls3a_cache.outputs.cache-hit == 'true' }}
run: cp -r livesim3-love-android-cached livesim3-love-android
- name: Checkout livesim2
uses: actions/checkout@v4
with:
path: livesim3-love-android/app/src/embed/assets
submodules: true
- name: Replace Version Information
working-directory: livesim3-love-android
run: python app/src/embed/assets/build-util/replace_gradle_properties.py app/src/embed/assets/main.lua gradle.properties -o gradle.properties
- name: Delete Some Stuff
working-directory: livesim3-love-android/app/src/embed/assets
run: rm -rf .git build-util
- name: Build APK
working-directory: livesim3-love-android
run: bash ./gradlew assembleEmbedNoRecord${{ matrix.build_type }}
- name: Artifact APK
uses: actions/upload-artifact@v4
with:
name: livesim2-android-${{ matrix.build_type }}
path: livesim3-love-android/app/build/outputs/apk
if-no-files-found: error