From 0f3ec2198a341faab32ebff636dc8d43c1f476c6 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 14 Feb 2025 12:39:32 -0600 Subject: [PATCH] Linux package --- .github/workflows/release.yml | 26 +++++++++-- .../assets/linux/cash.harbor.harbor.desktop | 10 ++++ harbor-ui/assets/linux/cash.harbor.harbor.xml | 33 +++++++++++++ scripts/package-linux.sh | 46 +++++++++++++++++++ 4 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 harbor-ui/assets/linux/cash.harbor.harbor.desktop create mode 100644 harbor-ui/assets/linux/cash.harbor.harbor.xml create mode 100755 scripts/package-linux.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc23300..a2b211b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,10 +21,14 @@ jobs: strategy: matrix: target: - - target: macos - os: macos-latest - make: bash scripts/build-macos.sh - package: bash scripts/package-macos.sh +# - target: macos +# os: macos-latest +# make: bash scripts/build-macos.sh +# package: bash scripts/package-macos.sh + - target: linux + os: ubuntu-latest + make: bash scripts/package-linux.sh package + artifact_path: echo "ARTIFACT_PATH=$(bash scripts/package-linux.sh archive_path)" runs-on: ${{ matrix.target.os }} environment: signing steps: @@ -54,6 +58,16 @@ jobs: - name: Package DMG run: nix develop --command bash -c "${{ matrix.target.package }}" + - name: Set artifact path + if: matrix.target.target == 'linux' + run: ${{ matrix.target.artifact_path }} + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.target.target }} + path: ${{ env.ARTIFACT_PATH }} + - name: Create Release and Upload Assets uses: softprops/action-gh-release@v2 with: @@ -62,4 +76,6 @@ jobs: draft: true prerelease: false generate_release_notes: true - files: target/release/macos/harbor.dmg \ No newline at end of file + files: | + target/release/macos/harbor.dmg + ${{ env.ARTIFACT_PATH }} \ No newline at end of file diff --git a/harbor-ui/assets/linux/cash.harbor.harbor.desktop b/harbor-ui/assets/linux/cash.harbor.harbor.desktop new file mode 100644 index 0000000..83e453b --- /dev/null +++ b/harbor-ui/assets/linux/cash.harbor.harbor.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Habor +Comment=Fedimint ecash desktop wallet for better bitcoin privacy +Type=Application +Keywords=bitcoin;lightning;ecash;privacy;tor;fedimint; +Categories=Office;Finance; +Exec=harbor-ui %U +Icon=cash.harbor.harbor +StartupWMClass=cash.harbor.harbor +Terminal=false diff --git a/harbor-ui/assets/linux/cash.harbor.harbor.xml b/harbor-ui/assets/linux/cash.harbor.harbor.xml new file mode 100644 index 0000000..03cec9e --- /dev/null +++ b/harbor-ui/assets/linux/cash.harbor.harbor.xml @@ -0,0 +1,33 @@ + + + + + cash.harbor.harbor + MIT + MIT + Harbor + Harbor is an ecash desktop wallet for better bitcoin privacy. + +

+ Harbor is an ecash desktop wallet for better bitcoin privacy. Use this tool to interact with ecash mints, + moving money in and out using existing Bitcoin wallets. As you use mints, you may be able to increase the + privacy of your money. Harbor also aims to demystify ecash mints for users and make them easier to use. +

+
+ cash.harbor.harbor.desktop + Harbor.cash + https://github.com/HarborWallet/harbor/issues + + + harbor logo + + https://camo.githubusercontent.com/36432bbea8022f7f873a7e5fcf983ed4e3a84a8764be44b5eb2ab5e9056cbaf4/68747470733a2f2f626c6f672e6d7574696e7977616c6c65742e636f6d2f636f6e74656e742f696d616765732f73697a652f77323030302f323032342f30352f686172626f722d707265766965772e6a706567 + + + + Harbor Wallet Devs + + + +
\ No newline at end of file diff --git a/scripts/package-linux.sh b/scripts/package-linux.sh new file mode 100755 index 0000000..ea97d5c --- /dev/null +++ b/scripts/package-linux.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +ARCH="x86_64" +TARGET="harbor" +VERSION=$(cat VERSION) +PROFILE="release" +ASSETS_DIR="assets/linux" +RELEASE_DIR="target/$PROFILE" +BINARY="$RELEASE_DIR/$TARGET" +ARCHIVE_DIR="$RELEASE_DIR/archive" +ARCHIVE_NAME="$TARGET-$VERSION-$ARCH-linux.tar.gz" +ARCHIVE_PATH="$RELEASE_DIR/$ARCHIVE_NAME" + +build() { + cargo build --profile $PROFILE +} + +archive_name() { + echo $ARCHIVE_NAME +} + +archive_path() { + echo $ARCHIVE_PATH +} + +package() { + build + + install -Dm755 $BINARY -t $ARCHIVE_DIR/bin + install -Dm644 $ASSETS_DIR/cash.harbor.harbor.appdata.xml -t $ARCHIVE_DIR/share/metainfo + install -Dm644 $ASSETS_DIR/cash.harbor.harbor.desktop -t $ARCHIVE_DIR/share/applications + cp -r $ASSETS_DIR/icons $ARCHIVE_DIR/share/ + + tar czvf $ARCHIVE_PATH -C $ARCHIVE_DIR . + + echo "Packaged archive: $ARCHIVE_PATH" +} + +case "$1" in + "package") package;; + "archive_name") archive_name;; + "archive_path") archive_path;; + *) + echo "avaiable commands: package, archive_name, archive_path" + ;; +esac \ No newline at end of file