diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9f966c7..71de48ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,8 +47,9 @@ jobs: - name: Checkout uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v3.1.0 - - name: Install GTK4 (Ubuntu) - run: sudo apt-get install --no-install-recommends -y libgtk-4-dev + - name: Install GTK4 and libfuse2 (Linux) + # libfuse2 is needed for AppImage to run + run: sudo apt-get install --no-install-recommends -y libgtk-4-dev libfuse2 if: runner.os == 'Linux' - name: Configure GTK4 cache (Windows) @@ -200,7 +201,24 @@ jobs: - name: Package (Linux) run: | + # Build Debian package cargo deb --target ${{ matrix.build.target }} --profile production --no-build --no-strip + + # And build AppImage as well + wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage + wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/3b67a1d1c1b0c8268f57f2bce40fe2d33d409cea/linuxdeploy-plugin-gtk.sh + chmod +x linuxdeploy*.AppImage linuxdeploy-plugin-gtk.sh + NO_STRIP=1 ./linuxdeploy-x86_64.AppImage \ + --appdir AppDir \ + --plugin gtk \ + --executable target/${{ matrix.build.target }}/production/space-acres \ + --desktop-file res/linux/space-acres.desktop \ + --icon-file res/linux/space-acres.png \ + --output appimage + + # Rename AppImage to be consistent with other files + version=$(grep -Po 'version = "\K.*?(?=")' -m 1 Cargo.toml) + mv Space_Acres-x86_64.AppImage space-acres-$version-x86_64.AppImage if: runner.os == 'Linux' - name: Upload installer to artifacts (Linux) @@ -208,6 +226,7 @@ jobs: with: name: installer-${{ matrix.build.suffix }} path: | + space-acres-*.AppImage target/${{ matrix.build.target }}/debian/*.deb if-no-files-found: error if: runner.os == 'Linux' @@ -217,5 +236,5 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} with: - asset_paths: '["target/${{ matrix.build.target }}/debian/*.deb"]' + asset_paths: '["space-acres-*.AppImage", "target/${{ matrix.build.target }}/debian/*.deb"]' if: runner.os == 'Linux' && github.event_name == 'push' && github.ref_type == 'tag' diff --git a/Cargo.toml b/Cargo.toml index c8f3ff66..f913225c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ assets = [ ["res/linux/space-acres-autostart.desktop", "/etc/xdg/autostart/space-acres.desktop", "644"], ["target/release/space-acres", "/usr/bin/space-acres", "755"], ["res/linux/space-acres.desktop", "/usr/share/applications/space-acres.desktop", "644"], - ["res/linux/space-acres.png", "/usr/share/icons/hicolor/apps/space-acres.png", "644"], + ["res/linux/space-acres.png", "/usr/share/pixmaps/space-acres.png", "644"], ] # TODO: Menu shortcut will not be generated automatically in case of re-init: https://github.com/volks73/cargo-wix/issues/141 diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index 357b9d85..175a1e0c 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -59,6 +59,12 @@ for your architecture (most likely X64). ## Linux +Currently, there are two ways to get Space Acres on Linux: +* by installing `.deb` package on Ubuntu +* by running `.AppImage` bundle directly on any modern Linux distribution (including Ubuntu if you want to) + +### Ubuntu + For **Ubuntu 22.04 or newer** (older versions not supported) go to [the latest release](https://github.com/nazar-pc/space-acres/releases/latest) and download attached file with `.deb` extension for your architecture (most likely `amd64`). @@ -72,9 +78,25 @@ Replace `Downloads` with correct name of downloads directory if you have non-Eng downloaded file into a custom location. In case you have multiple versions of Space Acres downloaded, you might want to replace `space-acres*.deb` with a full name of the file you've downloaded. -There are no official packages for other Linux distributions yet and if you build from source you hopefully know what +### Other Linux + +For other distributions AppImage is available too, go to [the latest release](https://github.com/nazar-pc/space-acres/releases/latest) and download attached +file with `.AppImage` extension for your architecture (most likely `x86_64`). + +Then open terminal and run following commands to switch to downloads directory and make it executable: +```bash +cd Downloads +chmod +x space-acres-*.AppImage +``` + +After this either use `./space-acres-*.AppImage` in the terminal or double-click on the file in the file manager to open +the app. You may need to install FUSE library if you don't have it installed yet. In case you have multiple versions of +Space Acres downloaded, you might want to replace `space-acres-*.AppImage` with a full name of the file you've +downloaded. + +There are no other Linux packages at the moment and if you build from source you hopefully know what you are doing. -Consider [contributing to Linux packaging](https://github.com/nazar-pc/space-acres/issues/6) though! +Consider contributing to Linux packaging though! ## macOS diff --git a/res/linux/space-acres-autostart.desktop b/res/linux/space-acres-autostart.desktop index 045fd522..fc3537a1 100644 --- a/res/linux/space-acres-autostart.desktop +++ b/res/linux/space-acres-autostart.desktop @@ -2,5 +2,5 @@ Type=Application Name=Space Acres Comment=Space Acres is an opinionated unofficial GUI application for farming on Subspace Network -Icon=/usr/share/icons/hicolor/apps/space-acres.png +Icon=space-acres Exec=space-acres --startup diff --git a/res/linux/space-acres.desktop b/res/linux/space-acres.desktop index 92e0d90b..46ca8ae7 100644 --- a/res/linux/space-acres.desktop +++ b/res/linux/space-acres.desktop @@ -5,7 +5,7 @@ Categories=Network GenericName=Subspace Network Farming Software Comment=Space Acres is an opinionated unofficial GUI application for farming on Subspace Network Keywords=subspace;farmer;farming -Icon=/usr/share/icons/hicolor/apps/space-acres.png +Icon=space-acres Exec=space-acres Terminal=false StartupNotify=false