Skip to content

Commit

Permalink
Generating icons at build time instead of storing in the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
nmlynch94 committed Dec 14, 2023
1 parent dbade1b commit b5cef12
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y \
flatpak \
flatpak-builder
flatpak-builder \
icoutils
- name: Build the flatpak
run: |
ls ${{ github.workspace }}
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y \
flatpak \
flatpak-builder
flatpak-builder \
icoutils
- name: Build the flatpak bundle
run: |
chmod +x build.sh
./build.sh
flatpak build-bundle ~/.local/share/flatpak/repo ${{ steps.variables.outputs.APP_NAME }}.flatpak ${{ steps.variables.outputs.APP_NAME }}
sha256sum ${{ steps.variables.outputs.APP_NAME }}.flatpak > ${{ steps.variables.outputs.APP_NAME }}.flatpak.sha256sum
- name: Tag this branch with incremented release version
id: new-tag
run: |
Expand All @@ -49,5 +51,7 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.variables.outputs.APP_NAME }}.flatpak
files: |
${{ steps.variables.outputs.APP_NAME }}.flatpak
${{ steps.variables.outputs.APP_NAME }}.flatpak.sha256sum
tag_name: ${{ steps.variables.outputs.NEW_TAG }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ I am in no way affiliated with Jagex and running the launcher through linux is u

# Installation Methods (This is not available on Flathub due to them not allowing Wine applications)
### Release Bundle (easiest)
- Here is a one liner to make sure all dependencies are installed and also install the latest release. This will likely take several minutes if flatpak is newly installed:
- Here is a one liner to make sure all dependencies are installed and also install the latest release. This will likely take several minutes if flatpak is newly installed NOTE: First launch installs the launcher. It may appear to be doing nothing for a minute or two until it appears. It will be faster after that.
```
curl -fSsL https://raw.githubusercontent.com/nmlynch94/com.jagexlauncher.JagexLauncher/main/install-jagex-launcher.sh | bash
```
Expand Down
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/bash
cd icons
./extract_icons.sh
cd ..

flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak-builder --install-deps-from=flathub --user --install --force-clean build-dir --disable-cache "$(basename $(git rev-parse --show-toplevel)).yml"
4 changes: 2 additions & 2 deletions com.jagexlauncher.JagexLauncher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ modules:
- install jagex-install /app/bin/jagex-install
- install -Dm644 com.jagexlauncher.JagexLauncher.desktop /app/share/applications/com.jagexlauncher.JagexLauncher.desktop
- install -Dm644 com.jagexlauncher.JagexLauncher.metainfo.xml /app/share/metainfo/com.jagexlauncher.JagexLauncher.metainfo.xml
- install -Dm644 512.png /app/share/icons/hicolor/512x512/apps/com.jagexlauncher.JagexLauncher.png
- install -Dm644 256.png /app/share/icons/hicolor/256x256/apps/com.jagexlauncher.JagexLauncher.png
- install -Dm644 steamdeck-settings.properties /app/steamdeck-settings.properties
sources:
- type: file
Expand All @@ -124,7 +124,7 @@ modules:
- type: file
path: com.jagexlauncher.JagexLauncher.metainfo.xml
- type: file
path: icons/512/512.png
path: icons/256/256.png
- type: file
path: jagex-launcher-linux/resources/steamdeck-settings.properties
- name: launch-script
Expand Down
Binary file added icons/256-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/256-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/256-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/256-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/256-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/256/256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed icons/512/512.png
Binary file not shown.
16 changes: 16 additions & 0 deletions icons/extract_icons.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
INSTALLER_URL="https://cdn.jagex.com/Jagex%20Launcher%20Installer.exe"
FILE_LIST_URL="$BASE_URL/launcherinfo.json"
JAGEX_EXE_NAME="JagexLauncherInstaller.exe"

curl -L "$INSTALLER_URL" > "$JAGEX_EXE_NAME"

wrestool -x --output=icon.ico -t14 "$JAGEX_EXE_NAME"
convert icon.ico 256.png
mkdir -p 256
mv 256-0.png 256/256.png

# Cleanup
rm -f "icon.ico"
rm -f "256-*"
rm -f "$JAGEX_EXE_NAME"
3 changes: 2 additions & 1 deletion install-jagex-launcher.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y flathub --user runtime/org.freedesktop.Platform.GL.default/x86_64/23.08 runtime/org.freedesktop.Platform.GL.default/x86_64/23.08-extra runtime/org.freedesktop.Platform.GL32.default/x86_64/23.08 runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/23.08 runtime/org.freedesktop.Platform.ffmpeg_full.i386/x86_64/23.08 runtime/org.freedesktop.Platform.openh264/x86_64/2.2.0 org.freedesktop.Platform.Compat.i386//23.08 org.freedesktop.Platform.Locale//23.08 org.gtk.Gtk3theme.Breeze//3.22 org.freedesktop.Platform//23.08 org.winehq.Wine.DLLs.dxvk//stable-23.08 org.winehq.Wine.gecko//stable-23.08 org.winehq.Wine.mono//stable-23.08
wget https://github.com/nmlynch94/com.jagexlauncher.JagexLauncher/releases/latest/download/com.jagexlauncher.JagexLauncher.flatpak
curl -L https://github.com/nmlynch94/com.jagexlauncher.JagexLauncher/releases/latest/download/com.jagexlauncher.JagexLauncher.flatpak > com.jagexlauncher.JagexLauncher.flatpak
echo "Installing......."
flatpak install -y --user com.jagexlauncher.JagexLauncher.flatpak
echo "DONE"

0 comments on commit b5cef12

Please sign in to comment.