Merge branch 'main' of https://github.com/cambrige-stacker/cambridge #185
Workflow file for this run
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: 'Custom Assembly' | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
assembly: | |
if: ${{ github.event_name == 'push' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Version naming | |
run: | | |
echo "version = \"${GITHUB_REF#refs/tags/}\"" > load/version.lua | |
- name: Assemble | |
run: | | |
zip -r9 cambridge.love libs load res scene tetris *.lua -x "res/img/rpc/*" res/bgm/pacer_test.mp3 "libs/discord-rpc*" "libs/discordGameSDK/*" | |
cat dist/windows/love.exe cambridge.love > dist/windows/cambridge.exe | |
cat dist/win_aarch64/love.exe cambridge.love > dist/win_aarch64/cambridge.exe | |
cat dist/win32/love.exe cambridge.love > dist/win32/cambridge.exe | |
cp SOURCES.md LICENSE.md dist/windows/ | |
cp SOURCES.md LICENSE.md dist/win32/ | |
mkdir dist/windows/libs/ | |
mkdir dist/win32/libs/ | |
cp libs/discord-rpc_x64.dll dist/windows/libs/ | |
cp libs/discord-rpc_x86.dll dist/win32/libs/ | |
- name: Unpack and fuse LOVE 11.5 AppImage and then re-package | |
run: | | |
./love-11.5-x86_64.AppImage --appimage-extract | |
sed -i 's/Exec=love/Exec=cambridge/g' squashfs-root/love.desktop | |
sed -i 's/Icon=love/Icon=cambridge_icon/g' squashfs-root/love.desktop | |
sed -i 's/Name=LÖVE/Name=Cambridge/g' squashfs-root/love.desktop | |
sed -i 's/Comment=The unquestionably awesome 2D game engine/Comment=The Open Source Arcade Block Stacker!/g' squashfs-root/love.desktop | |
sed -i 's/#FUSE_PATH="$APPDIR\/my_game"/FUSE_PATH="$APPDIR\/bin\/cambridge"/g' squashfs-root/AppRun | |
mv squashfs-root/love.desktop squashfs-root/cambridge.desktop | |
cat squashfs-root/bin/love cambridge.love > squashfs-root/bin/cambridge | |
chmod +x squashfs-root/bin/cambridge | |
cp res/img/cambridge_icon.png squashfs-root/ | |
mkdir squashfs-root/bin/libs | |
cp libs/discord-rpc.so squashfs-root/bin/libs | |
sudo add-apt-repository universe | |
sudo apt install libfuse2 | |
./appimagetool-x86_64.AppImage squashfs-root cambridge_linux_x64.AppImage | |
rm -rf ./squashfs-root/ | |
- name: Unpack and fuse LOVE 12.0 AppImage and then re-package | |
run: | | |
./love-12.0-x86_64-dev_ci.AppImage --appimage-extract | |
sed -i 's/Exec=love/Exec=cambridge/g' squashfs-root/love.desktop | |
sed -i 's/Icon=love/Icon=cambridge_icon/g' squashfs-root/love.desktop | |
sed -i 's/Name=LÖVE/Name=Cambridge/g' squashfs-root/love.desktop | |
sed -i 's/Comment=The unquestionably awesome 2D game engine/Comment=The Open Source Arcade Block Stacker!/g' squashfs-root/love.desktop | |
sed -i 's/#FUSE_PATH="$APPDIR\/my_game"/FUSE_PATH="$APPDIR\/bin\/cambridge"/g' squashfs-root/AppRun | |
mv squashfs-root/love.desktop squashfs-root/cambridge.desktop | |
cat squashfs-root/bin/love cambridge.love > squashfs-root/bin/cambridge | |
chmod +x squashfs-root/bin/cambridge | |
cp res/img/cambridge_icon.png squashfs-root/ | |
mkdir squashfs-root/bin/libs | |
cp libs/discord-rpc.so squashfs-root/bin/libs | |
sudo add-apt-repository universe | |
sudo apt install libfuse2 | |
./appimagetool-x86_64.AppImage squashfs-root cambridge_linux_experimental.AppImage | |
rm -rf ./squashfs-root/ | |
- name: Upload Windows x86 artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cambridge_windows_x86 | |
path: | | |
dist/win32/* | |
!dist/win32/love.exe | |
- name: Upload Windows x86-64 artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cambridge_windows_x64 | |
path: | | |
dist/windows/* | |
!dist/windows/love.exe | |
- name: Upload experimental Windows AArch64 artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cambridge_windows_aarch64_experimental | |
path: | | |
dist/win_aarch64/* | |
!dist/win_aarch64/love.exe | |
- name: Upload other OS artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cambridge_other | |
path: | | |
cambridge.love | |
libs/discord-rpc* | |
SOURCES.md | |
LICENSE.md | |
- name: Upload Linux AppImage artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cambridge_linux_x64 | |
path: | | |
cambridge_linux_x64.AppImage | |
SOURCES.md | |
LICENSE.md | |
- name: Upload experimental Linux AppImage artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cambridge_linux_experimental | |
path: | | |
cambridge_linux_experimental.AppImage | |
SOURCES.md | |
LICENSE.md | |
- name: "Cleanup" | |
run: | | |
rm -f cambridge.love | |
rm -f dist/windows/cambridge.exe | |
rm -f dist/windows/SOURCES.md | |
rm -f dist/windows/LICENSE.md | |
rm -rf dist/windows/libs | |
rm -f dist/win32/cambridge.exe | |
rm -f dist/win32/SOURCES.md | |
rm -f dist/win32/LICENSE.md | |
rm -rf dist/win32/libs | |
rm -f cambridge_linux_experimental.AppImage | |
rm -rf squashfs-root/ | |
release-upload: | |
runs-on: ubuntu-latest | |
needs: assembly | |
steps: | |
- name: "Grab Artifacts" | |
uses: actions/download-artifact@v3 | |
with: | |
path: dist/ | |
- name: Re-package the artifacts | |
run: | | |
(cd ./cambridge_other && zip -r9 ../cambridge_other.zip .) | |
(cd ./cambridge_windows_x64 && zip -r9 ../cambridge_windows_x64.zip .) | |
(cd ./cambridge_windows_x86 && zip -r9 ../cambridge_windows_x86.zip .) | |
(cd ./cambridge_linux_x64 && zip -r9 ../cambridge_linux_x64.zip .) | |
(cd ./cambridge_linux_experimental && zip -r9 ../cambridge_linux_experimental.zip .) | |
(cd ./cambridge_windows_aarch64_experimental && zip -r9 ../cambridge_windows_aarch64_experimental.zip .) | |
working-directory: dist/ | |
- name: "Release" | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
generate_release_notes: true | |
files: dist/cambridge_* |