Skip to content

Commit

Permalink
Rewritten the workflow to combine assembly and release upload
Browse files Browse the repository at this point in the history
Now not using artifacts at all
  • Loading branch information
Tetro48 committed Jan 30, 2024
1 parent bd33b0f commit 4823e22
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 82 deletions.
112 changes: 30 additions & 82 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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_*
- name: "Release"
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: dist/cambridge_*
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4823e22

Please sign in to comment.