Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu (deb) packaging, version bump #47

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 36 additions & 8 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 All @@ -41,7 +41,6 @@ jobs:
rustflags: "-C target-cpu=skylake"
runs-on: ${{ matrix.build.os }}
env:
PRODUCTION_TARGET: target/${{ matrix.build.target }}/production
RUSTFLAGS: ${{ matrix.build.rustflags }}

steps:
Expand Down Expand Up @@ -87,6 +86,7 @@ jobs:
run: |
Move-Item "C:\Program Files\Git\usr\notbin" "C:\Program Files\Git\usr\bin"
Move-Item "C:\Program Files\Git\notbin" "C:\Program Files\Git\bin"
if: runner.os == 'Windows'

# On macOS, we need a proper Clang version, not Apple's custom version without wasm32 support
# TODO: on macOS, the consensus/domain runtime build is not compatible with LLVM 15.0.7 and
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/${{ matrix.build.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/${{ matrix.build.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
Loading