Skip to content

Commit

Permalink
Linux package
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Feb 19, 2025
1 parent eecfe16 commit 03f6ad6
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ 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)" >> "$GITHUB_ENV"
runs-on: ${{ matrix.target.os }}
environment: signing
steps:
Expand Down Expand Up @@ -54,6 +59,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:
Expand All @@ -62,4 +77,6 @@ jobs:
draft: true
prerelease: false
generate_release_notes: true
files: target/release/macos/harbor.dmg
files: |
target/release/macos/harbor.dmg
${{ env.ARTIFACT_PATH }}
33 changes: 33 additions & 0 deletions harbor-ui/assets/linux/cash.harbor.harbor.appdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<content_rating type="oars-1.1">
</content_rating>
<id>cash.harbor.harbor</id>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<name>Harbor</name>
<summary>Harbor is an ecash desktop wallet for better bitcoin privacy.</summary>
<description>
<p>
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.
</p>
</description>
<launchable type="desktop-id">cash.harbor.harbor.desktop</launchable>
<url type="homepage">Harbor.cash</url>
<url type="bugtracker">https://github.com/HarborWallet/harbor/issues</url>
<screenshots>
<screenshot type="default">
<caption>harbor logo</caption>
<image>
https://camo.githubusercontent.com/36432bbea8022f7f873a7e5fcf983ed4e3a84a8764be44b5eb2ab5e9056cbaf4/68747470733a2f2f626c6f672e6d7574696e7977616c6c65742e636f6d2f636f6e74656e742f696d616765732f73697a652f77323030302f323032342f30352f686172626f722d707265766965772e6a706567
</image>
</screenshot>
</screenshots>
<developer_name>Harbor Wallet Devs</developer_name>
<releases>
<release version="0.2.0"
date="2025-02-14"/>
</releases>
</component>
10 changes: 10 additions & 0 deletions harbor-ui/assets/linux/cash.harbor.harbor.desktop
Original file line number Diff line number Diff line change
@@ -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
46 changes: 46 additions & 0 deletions scripts/package-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

TARGET="harbor-ui"
ARCH="x86_64"
RELEASE_DIR="target/release"
ASSETS_DIR="harbor-ui/assets"
ARCHIVE_DIR="$RELEASE_DIR/archive"
VERSION=$(grep -m1 '^version = ' harbor-ui/Cargo.toml | cut -d '"' -f2)
ARCHIVE_NAME="$TARGET-$VERSION-$ARCH-linux.tar.gz"
ARCHIVE_PATH="$RELEASE_DIR/$ARCHIVE_NAME"


build() {
cargo build --release --target=x86_64-unknown-linux-gnu -p harbor-ui
}

archive_name() {
echo $ARCHIVE_NAME
}

archive_path() {
echo $ARCHIVE_PATH
}

package() {
build

install -Dm755 target/x86_64-unknown-linux-gnu/release/$TARGET -t $ARCHIVE_DIR/bin
install -Dm644 $ASSETS_DIR/linux/cash.harbor.harbor.appdata.xml -t $ARCHIVE_DIR/share/metainfo
install -Dm644 $ASSETS_DIR/linux/cash.harbor.harbor.desktop -t $ARCHIVE_DIR/share/applications
cp -r $ASSETS_DIR/icons $ARCHIVE_DIR/share/
cp -fp "target/x86_64-unknown-linux-gnu/release/$TARGET" "$ARCHIVE_DIR/harbor"

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 "available commands: package, archive_name, archive_path"
;;
esac

0 comments on commit 03f6ad6

Please sign in to comment.