From 4823e22704a1c0e50e0143dae593aa50e24c801d Mon Sep 17 00:00:00 2001 From: Tetro48 <76738929+Tetro48@users.noreply.github.com> Date: Wed, 31 Jan 2024 01:42:38 +0700 Subject: [PATCH] Rewritten the workflow to combine assembly and release upload Now not using artifacts at all --- .github/workflows/main.yml | 112 +++++------------- .../linux/appimagetool-x86_64.AppImage | Bin .../linux/love-11.5-x86_64.AppImage | Bin .../linux/love-12.0-x86_64-dev_ci.AppImage | Bin 4 files changed, 30 insertions(+), 82 deletions(-) rename appimagetool-x86_64.AppImage => dist/linux/appimagetool-x86_64.AppImage (100%) rename love-11.5-x86_64.AppImage => dist/linux/love-11.5-x86_64.AppImage (100%) rename love-12.0-x86_64-dev_ci.AppImage => dist/linux/love-12.0-x86_64-dev_ci.AppImage (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a872afd..03dcaa9a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,11 +20,17 @@ jobs: 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/ + cp SOURCES.md LICENSE.md dist/linux/ 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: Install packages for appimagetool + run: | + sudo add-apt-repository universe + sudo apt install libfuse2 - name: Unpack and fuse LOVE 11.5 AppImage and then re-package + working-directory: ./dist/linux run: | ./love-11.5-x86_64.AppImage --appimage-extract sed -i 's/Exec=love/Exec=cambridge/g' squashfs-root/love.desktop @@ -33,16 +39,15 @@ jobs: 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 + 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/ + 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 + cp ../../libs/discord-rpc.so squashfs-root/bin/libs ./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 + working-directory: ./dist/linux run: | ./love-12.0-x86_64-dev_ci.AppImage --appimage-extract sed -i 's/Exec=love/Exec=cambridge/g' squashfs-root/love.desktop @@ -51,62 +56,22 @@ jobs: 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 + 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/ + 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 + cp ../../libs/discord-rpc.so squashfs-root/bin/libs ./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" + - name: Zip releases + working-directory: ./dist + run: | + (cd ./win32 && zip -r9 ../cambridge_windows_x86.zip * -x ./win32/love.exe) + (cd ./windows && zip -r9 ../cambridge_windows_x64.zip * -x ./windows/love.exe) + (cd ./win_aarch64 && zip -r9 ../cambridge_windows_aarch64_experimental.zip * -x love.exe lovec.exe) + (cd ../ && zip -r9 ./dist/cambridge_other.zip SOURCES.md LICENSE.md cambridge.love libs/discord-rpc*") + (cd ./linux && zip -r9 ../cambridge_linux_x64.zip cambridge_linux_x64.AppImage SOURCES.md LICENSE.md && zip -r9 ../cambridge_linux_experimental.zip cambridge_linux_experimental.AppImage SOURCES.md LICENSE.md) + - name: Cleanup run: | rm -f cambridge.love rm -f dist/windows/cambridge.exe @@ -116,30 +81,13 @@ jobs: rm -f dist/win32/cambridge.exe rm -f dist/win32/SOURCES.md rm -f dist/win32/LICENSE.md + rm -f dist/linux/SOURCES.md + rm -f dist/linux/LICENSE.md rm -rf dist/win32/libs + rm -f cambridge_linux_x64.AppImage 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_* \ No newline at end of file + - name: "Release" + uses: softprops/action-gh-release@v1 + with: + generate_release_notes: true + files: dist/cambridge_* \ No newline at end of file diff --git a/appimagetool-x86_64.AppImage b/dist/linux/appimagetool-x86_64.AppImage similarity index 100% rename from appimagetool-x86_64.AppImage rename to dist/linux/appimagetool-x86_64.AppImage diff --git a/love-11.5-x86_64.AppImage b/dist/linux/love-11.5-x86_64.AppImage similarity index 100% rename from love-11.5-x86_64.AppImage rename to dist/linux/love-11.5-x86_64.AppImage diff --git a/love-12.0-x86_64-dev_ci.AppImage b/dist/linux/love-12.0-x86_64-dev_ci.AppImage similarity index 100% rename from love-12.0-x86_64-dev_ci.AppImage rename to dist/linux/love-12.0-x86_64-dev_ci.AppImage