Skip to content

Commit

Permalink
Ubuntu (deb) packaging, version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Dec 17, 2023
1 parent 8072f70 commit 95143b4
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 11 deletions.
42 changes: 35 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
strategy:
matrix:
build:
# TODO: Package Linux and macOS
# - os: ubuntu-22.04
# target: x86_64-unknown-linux-gnu
# suffix: ubuntu-x86_64-skylake-${{ github.ref_name }}
# rustflags: "-C target-cpu=skylake"
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
suffix: ubuntu-x86_64-skylake-${{ github.ref_name }}
rustflags: "-C target-cpu=skylake"
# TODO: Package for more Linux distributions/packaging formats/architectures and macOS
# - os: ubuntu-22.04
# target: aarch64-unknown-linux-gnu
# suffix: ubuntu-aarch64-${{ github.ref_name }}
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
Remove-Item target\wix\gtk4 -Recurse -Confirm:$false -ErrorAction SilentlyContinue
if: runner.os == 'Windows'

- name: Upload node and farmer executables to artifacts (Windows)
- name: Upload installer to artifacts (Windows)
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # @v3.1.1
with:
name: installer-${{ matrix.build.suffix }}
Expand All @@ -164,10 +164,38 @@ jobs:
if-no-files-found: error
if: runner.os == 'Windows'

- name: Upload node and farmer executables to assets (Windows)
- name: Upload installer to assets (Windows)
uses: alexellis/upload-assets@259de5111cb56966d046ced998941e93f91d2c93 # @0.4.0
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["target/wix/*.msi"]'
if: runner.os == 'Windows' && github.event_name == 'push' && github.ref_type == 'tag'

- name: Install cargo-deb (Linux)
uses: taiki-e/cache-cargo-install-action@1b76958d032c4d048c599f9fdfa48abe804d6319 # v1.2.2
with:
tool: cargo-deb
if: runner.os == 'Linux'

- name: Package (Linux)
run: |
cargo deb --target ${{ matrix.build.target }} --profile production --no-build --no-strip
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: |
target/debian/*.deb
if-no-files-found: error
if: runner.os == 'Linux'

- name: Upload installer to assets (Linux)
uses: alexellis/upload-assets@259de5111cb56966d046ced998941e93f91d2c93 # @0.4.0
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["target/debian/*.deb"]'
if: runner.os == 'Linux' && github.event_name == 'push' && github.ref_type == 'tag'
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "space-acres"
description = "Space Acres is an opinionated unofficial GUI application for farming on Subspace Network"
license = "0BSD"
version = "0.0.6"
version = "0.0.7"
authors = ["Nazar Mokrynskyi <[email protected]>"]
repository = "https://github.com/nazar-pc/space-acres"
edition = "2021"
Expand All @@ -11,6 +11,15 @@ include = [
"/Cargo.toml",
]

[package.metadata.deb]
section = "net"
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"],
]

# TODO: Menu shortcut will not be generated automatically in case of re-init: https://github.com/volks73/cargo-wix/issues/141
[package.metadata.wix]
# Custom location to keep the root of the project cleaner
Expand Down
16 changes: 15 additions & 1 deletion docs/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,21 @@ for your architecture (most likely X64).

## Linux

There are no official packages for Linux yet and if you build from source you hopefully know what you are doing.
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`).

Then open terminal and run following commands to switch to downloads directory and install an app:
```bash
cd Downloads
sudo apt install ./space-acres*.deb
```

Replace `Downloads` with correct name of downloads directory if you have non-English Ubuntu installation or if you
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
you are doing.
Consider [contributing to Linux packaging](https://github.com/nazar-pc/space-acres/issues/6) though!

## macOS
Expand Down
6 changes: 6 additions & 0 deletions res/linux/space-acres-autostart.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Desktop Entry]
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
Exec=space-acres --startup
2 changes: 1 addition & 1 deletion res/linux/space-acres.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -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=space-acres
Icon=/usr/share/icons/hicolor/apps/space-acres.png
Exec=space-acres
Terminal=false
StartupNotify=false
Expand Down

0 comments on commit 95143b4

Please sign in to comment.