Skip to content

Commit

Permalink
Merge pull request #344 from autonomys/improve-linux-packaging
Browse files Browse the repository at this point in the history
Improve linux packaging, small CI improvements
  • Loading branch information
nazar-pc authored Dec 2, 2024
2 parents 120622b + 0d2449c commit 95f26a0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
build:
- os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
suffix: ubuntu-x86_64-skylake-${{ github.ref_name }}
suffix: ubuntu-x86_64-${{ github.ref_name }}
modern-rustflags: "-C target-cpu=skylake"
rustflags: "-C target-cpu=x86-64-v2"
# TODO: Package for more Linux distributions/packaging formats/architectures and macOS
Expand All @@ -33,7 +33,7 @@ jobs:
suffix: macos-aarch64-${{ github.ref_name }}
- os: windows-2022
target: x86_64-pc-windows-msvc
suffix: windows-x86_64-skylake-${{ github.ref_name }}
suffix: windows-x86_64-${{ github.ref_name }}
modern-rustflags: "-C target-cpu=skylake"
rustflags: "-C target-cpu=x86-64-v2"
fail-fast: false
Expand Down Expand Up @@ -391,7 +391,8 @@ jobs:
run: |
# Build Debian package
cargo deb --target ${{ matrix.build.target }} --profile production --no-build --no-strip --variant=modern
mv target/${{ matrix.build.target }}/debian/*.deb .
# 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
Expand All @@ -401,7 +402,7 @@ jobs:
--plugin gtk \
--executable target/${{ matrix.build.target }}/production/space-acres \
--executable target/${{ matrix.build.target }}/production/space-acres-modern \
--desktop-file res/linux/space-acres.desktop \
--desktop-file res/linux/xyz.autonomys.space_acres.desktop \
--icon-file res/linux/space-acres.png \
--output appimage
Expand All @@ -414,7 +415,8 @@ jobs:
run: |
# Build Debian package
cargo deb --target ${{ matrix.build.target }} --profile production --no-build --no-strip
mv target/${{ matrix.build.target }}/debian/*.deb .
# 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
Expand All @@ -423,7 +425,7 @@ jobs:
--appdir AppDir \
--plugin gtk \
--executable target/${{ matrix.build.target }}/production/space-acres \
--desktop-file res/linux/space-acres.desktop \
--desktop-file res/linux/xyz.autonomys.space_acres.desktop \
--icon-file res/linux/space-acres.png \
--output appimage
Expand All @@ -435,10 +437,10 @@ jobs:
- name: Upload installer to artifacts (Linux)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.1.3
with:
name: installer-${{ matrix.build.suffix }}
name: space-acres-${{ matrix.build.suffix }}
path: |
space-acres-*.AppImage
target/${{ matrix.build.target }}/debian/*.deb
space-acres*.deb
if-no-files-found: error
if: runner.os == 'Linux'

Expand All @@ -447,7 +449,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["space-acres-*.AppImage", "target/${{ matrix.build.target }}/debian/*.deb"]'
asset_paths: '["space-acres-*.AppImage", "space-acres*.deb"]'
if: runner.os == 'Linux' && github.event_name == 'push' && github.ref_type == 'tag'

- name: Upload dmg to artifacts (macOS)
Expand All @@ -470,7 +472,7 @@ jobs:
- name: Upload installer to artifacts (Windows)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.1.3
with:
name: installer-${{ matrix.build.suffix }}
name: space-acres-${{ matrix.build.suffix }}
path: |
target/wix/*.exe
if-no-files-found: error
Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ include = [
[package.metadata.deb]
section = "net"
assets = [
["res/linux/space-acres-autostart.desktop", "/etc/xdg/autostart/space-acres.desktop", "644"],
["res/linux/space-acres-autostart.desktop", "/etc/xdg/autostart/xyz.autonomys.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"],
# Name must match application ID or else it has a strange behavior
["res/linux/xyz.autonomys.space_acres.desktop", "/usr/share/applications/xyz.autonomys.space_acres.desktop", "644"],
["res/linux/space-acres.png", "/usr/share/icons/hicolor/256x256/apps/space-acres.png", "644"],
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ Name=Space Acres
Categories=Network
GenericName=Autonomys Network Farming Software
Comment=Space Acres is an opinionated GUI application for farming on Autonomys Network
Keywords=subspace;autonomys;farmer;farming
Keywords=subspace;autonomys;farmer;farming;
Icon=space-acres
Exec=space-acres
Terminal=false
StartupNotify=false
StartupWMClass=space-acres

0 comments on commit 95f26a0

Please sign in to comment.