Skip to content

Commit

Permalink
Build AppImage too
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Dec 23, 2023
1 parent 3721f64 commit c95d612
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 5 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -200,14 +201,32 @@ 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)
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # @v3.1.1
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'
Expand All @@ -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'
26 changes: 24 additions & 2 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`).

Expand All @@ -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

Expand Down

0 comments on commit c95d612

Please sign in to comment.