Skip to content
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
71 changes: 69 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,76 @@ jobs:
name: stack_wallet-ios-aarch64-${{ steps.ver.outputs.version }}
path: stack_wallet-ios-aarch64-${{ steps.ver.outputs.version }}.ipa

build-flatpak:
runs-on: ubuntu-24.04
needs: build-linux
steps:
- uses: actions/checkout@v6

- name: Set version
id: ver
run: |
if [ "${{ github.ref_type }}" = "tag" ]; then
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}"
elif [ -n "${{ inputs.version }}" ]; then
VERSION="${{ inputs.version }}"
else
VERSION="0.0.0-staging.${{ github.run_number }}"
fi
echo "version=${VERSION}" >> $GITHUB_OUTPUT

- name: Download Linux bundle
uses: actions/download-artifact@v4
with:
name: stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }}

- name: Stage bundle and icon
run: |
tar -xzf "stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz" -C flatpak/
cp asset_sources/icon/stack_wallet/icon.png flatpak/com.cypherstack.stackwallet.png

- name: Install Flatpak tools
run: |
sudo apt-get update -q
sudo apt-get install -y flatpak flatpak-builder

- name: Set up Flathub remote
run: flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

- name: Cache Flatpak SDK
uses: actions/cache@v4
with:
path: ~/.local/share/flatpak
key: flatpak-freedesktop-24.08-v1

- name: Install Flatpak SDK
run: |
flatpak install --user --noninteractive flathub \
org.freedesktop.Platform//24.08 \
org.freedesktop.Sdk//24.08

- name: Build Flatpak
run: |
flatpak-builder --user --force-clean \
--repo=flatpak-repo \
build-flatpak flatpak/com.cypherstack.stackwallet.yaml

- name: Bundle Flatpak
run: |
flatpak build-bundle flatpak-repo \
--runtime-repo=https://flathub.org/repo/flathub.flatpakrepo \
"stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }}.flatpak" \
com.cypherstack.stackwallet

- uses: actions/upload-artifact@v4
with:
name: stack_wallet-flatpak-x86_64-${{ steps.ver.outputs.version }}
path: stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }}.flatpak

release:
if: github.ref_type == 'tag'
needs: [build-linux, build-android, build-windows, build-macos, build-ios]
needs: [build-linux, build-android, build-windows, build-macos, build-ios, build-flatpak]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -503,7 +570,7 @@ jobs:
name=$(basename "$dir")
(cd "$dir" && zip -r "../../release-files/${name}.zip" .)
done
find artifacts/ \( -name "*.tar.gz" -o -name "*.zip" -o -name "*.ipa" \) -mindepth 2 -exec mv {} release-files/ \;
find artifacts/ \( -name "*.tar.gz" -o -name "*.zip" -o -name "*.ipa" -o -name "*.flatpak" \) -mindepth 2 -exec mv {} release-files/ \;
find artifacts/ -name "*.apk" -mindepth 2 -exec mv {} release-files/ \;

- uses: softprops/action-gh-release@v2
Expand Down
7 changes: 7 additions & 0 deletions flatpak/com.cypherstack.stackwallet.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Desktop Entry]
Name=Stack Wallet
Comment=Open-source non-custodial cryptocurrency wallet
Exec=stack_wallet
Icon=com.cypherstack.stackwallet
Type=Application
Categories=Finance;
17 changes: 17 additions & 0 deletions flatpak/com.cypherstack.stackwallet.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>com.cypherstack.stackwallet</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-only</project_license>
<name>Stack Wallet</name>
<summary>Open-source non-custodial cryptocurrency wallet</summary>
<description>
<p>
Stack Wallet is an open-source, non-custodial, privacy-focused
cryptocurrency wallet supporting multiple coins.
</p>
</description>
<url type="homepage">https://stackwallet.com</url>
<url type="bugtracker">https://github.com/cypherstack/stack_wallet/issues</url>
<content_rating type="oars-1.1"/>
</component>
36 changes: 36 additions & 0 deletions flatpak/com.cypherstack.stackwallet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
app-id: com.cypherstack.stackwallet
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
command: stack_wallet

finish-args:
- --share=network
- --share=ipc
- --socket=fallback-x11
- --socket=wayland
- --device=dri
- --filesystem=~/.stackwallet
- --talk-name=org.freedesktop.secrets
- --talk-name=org.freedesktop.Notifications

modules:
- name: stack_wallet
buildsystem: simple
build-commands:
# Install the pre-built Flutter bundle under /app/lib/stack_wallet/ so
# the binary's $ORIGIN/lib and $ORIGIN/data lookups resolve correctly.
- mkdir -p /app/lib/stack_wallet
- install -Dm755 bundle/stack_wallet /app/lib/stack_wallet/stack_wallet
- cp -r bundle/lib bundle/data /app/lib/stack_wallet/
# Wrapper script so the Flatpak command path resolves to the binary.
- install -Dm755 stack_wallet.sh /app/bin/stack_wallet
- install -Dm644 com.cypherstack.stackwallet.desktop
/app/share/applications/com.cypherstack.stackwallet.desktop
- install -Dm644 com.cypherstack.stackwallet.metainfo.xml
/app/share/metainfo/com.cypherstack.stackwallet.metainfo.xml
- install -Dm644 com.cypherstack.stackwallet.png
/app/share/icons/hicolor/512x512/apps/com.cypherstack.stackwallet.png
sources:
- type: dir
path: .
2 changes: 2 additions & 0 deletions flatpak/stack_wallet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec /app/lib/stack_wallet/stack_wallet "$@"
Loading