From 8e44e2c39ece57bf6517467fe851169af7409a31 Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Thu, 21 May 2026 20:37:21 -0700 Subject: [PATCH 1/6] Add flatpak build job to CI --- .github/workflows/build.yaml | 70 ++++++++++++++++++- flatpak/com.cypherstack.stackwallet.desktop | 7 ++ .../com.cypherstack.stackwallet.metainfo.xml | 17 +++++ flatpak/com.cypherstack.stackwallet.yaml | 35 ++++++++++ flatpak/stack_wallet.sh | 2 + 5 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 flatpak/com.cypherstack.stackwallet.desktop create mode 100644 flatpak/com.cypherstack.stackwallet.metainfo.xml create mode 100644 flatpak/com.cypherstack.stackwallet.yaml create mode 100644 flatpak/stack_wallet.sh diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e9dd3ed29..6a92ed681 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -484,9 +484,75 @@ 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 \ + "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 @@ -503,7 +569,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 diff --git a/flatpak/com.cypherstack.stackwallet.desktop b/flatpak/com.cypherstack.stackwallet.desktop new file mode 100644 index 000000000..d5b7d55d2 --- /dev/null +++ b/flatpak/com.cypherstack.stackwallet.desktop @@ -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; diff --git a/flatpak/com.cypherstack.stackwallet.metainfo.xml b/flatpak/com.cypherstack.stackwallet.metainfo.xml new file mode 100644 index 000000000..abf3b19c9 --- /dev/null +++ b/flatpak/com.cypherstack.stackwallet.metainfo.xml @@ -0,0 +1,17 @@ + + + com.cypherstack.stackwallet + CC0-1.0 + GPL-3.0-only + Stack Wallet + Open-source non-custodial cryptocurrency wallet + +

+ Stack Wallet is an open-source, non-custodial, privacy-focused + cryptocurrency wallet supporting multiple coins. +

+
+ https://stackwallet.com + https://github.com/cypherstack/stack_wallet/issues + +
diff --git a/flatpak/com.cypherstack.stackwallet.yaml b/flatpak/com.cypherstack.stackwallet.yaml new file mode 100644 index 000000000..3707ccbba --- /dev/null +++ b/flatpak/com.cypherstack.stackwallet.yaml @@ -0,0 +1,35 @@ +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 + - --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: . diff --git a/flatpak/stack_wallet.sh b/flatpak/stack_wallet.sh new file mode 100644 index 000000000..db2f325b1 --- /dev/null +++ b/flatpak/stack_wallet.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec /app/lib/stack_wallet/stack_wallet "$@" From 60daf640556a3070154937a7aab1ee9e5731032f Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Thu, 21 May 2026 21:40:06 -0700 Subject: [PATCH 2/6] ci: embed Flathub runtime-repo in flatpak bundle --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6a92ed681..5b96e739a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -542,6 +542,7 @@ jobs: - 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 From 8b704da0f17ed963d2f6c17ca7d4950a0c1eb0cb Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Thu, 21 May 2026 22:10:27 -0700 Subject: [PATCH 3/6] flatpak: grant filesystem access to ~/.stackwallet --- flatpak/com.cypherstack.stackwallet.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/flatpak/com.cypherstack.stackwallet.yaml b/flatpak/com.cypherstack.stackwallet.yaml index 3707ccbba..f8836e6de 100644 --- a/flatpak/com.cypherstack.stackwallet.yaml +++ b/flatpak/com.cypherstack.stackwallet.yaml @@ -10,6 +10,7 @@ finish-args: - --socket=fallback-x11 - --socket=wayland - --device=dri + - --filesystem=~/.stackwallet - --talk-name=org.freedesktop.secrets - --talk-name=org.freedesktop.Notifications From fef38a867b4d29b846c3b9b215e017cb2e631bf3 Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Fri, 22 May 2026 11:21:30 -0700 Subject: [PATCH 4/6] ci: add build-campfire-linux and build-stack-duo-linux jobs --- .github/workflows/build.yaml | 130 ++++++++++++++++++++++++++++++++++- 1 file changed, 129 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5b96e739a..08b39f8d3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -484,6 +484,134 @@ jobs: name: stack_wallet-ios-aarch64-${{ steps.ver.outputs.version }} path: stack_wallet-ios-aarch64-${{ steps.ver.outputs.version }}.ipa + build-campfire-linux: + runs-on: ubuntu-24.04 + permissions: + contents: read + packages: read + container: + image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:latest + credentials: + username: ${{ github.actor }} + password: ${{ github.token }} + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: recursive + + - name: Set version + id: ver + run: | + if [ "${{ github.ref_type }}" = "tag" ]; then + VERSION="${{ github.ref_name }}" + VERSION="${VERSION#v}" + BUILD_NUMBER="${{ github.run_number }}" + elif [ -n "${{ inputs.version }}" ]; then + VERSION="${{ inputs.version }}" + BUILD_NUMBER="${{ inputs.build_number }}" + else + VERSION="0.0.0-staging.${{ github.run_number }}" + BUILD_NUMBER="${{ github.run_number }}" + fi + echo "version=${VERSION}" >> $GITHUB_OUTPUT + echo "build_number=${BUILD_NUMBER}" >> $GITHUB_OUTPUT + + - name: Configure app + run: | + cd scripts + echo "yes" | ./build_app.sh \ + -v "${{ steps.ver.outputs.version }}" \ + -b "${{ steps.ver.outputs.build_number }}" \ + -p linux -a campfire -d -s + + - name: Get dependencies + run: flutter pub get + + - name: Decode secrets + env: + CHANGE_NOW: ${{ secrets.CHANGE_NOW }} + run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart + + - name: Build + env: + USE_SYSTEM_SECURE_STORAGE_DEPS: "1" + run: flutter build linux --release --verbose + + - name: Package + run: | + tar -czf "campfire-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz" \ + -C build/linux/x64/release bundle + + - uses: actions/upload-artifact@v4 + with: + name: campfire-linux-x86_64-${{ steps.ver.outputs.version }} + path: campfire-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz + + build-stack-duo-linux: + runs-on: ubuntu-24.04 + permissions: + contents: read + packages: read + container: + image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:latest + credentials: + username: ${{ github.actor }} + password: ${{ github.token }} + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: recursive + + - name: Set version + id: ver + run: | + if [ "${{ github.ref_type }}" = "tag" ]; then + VERSION="${{ github.ref_name }}" + VERSION="${VERSION#v}" + BUILD_NUMBER="${{ github.run_number }}" + elif [ -n "${{ inputs.version }}" ]; then + VERSION="${{ inputs.version }}" + BUILD_NUMBER="${{ inputs.build_number }}" + else + VERSION="0.0.0-staging.${{ github.run_number }}" + BUILD_NUMBER="${{ github.run_number }}" + fi + echo "version=${VERSION}" >> $GITHUB_OUTPUT + echo "build_number=${BUILD_NUMBER}" >> $GITHUB_OUTPUT + + - name: Configure app + run: | + cd scripts + echo "yes" | ./build_app.sh \ + -v "${{ steps.ver.outputs.version }}" \ + -b "${{ steps.ver.outputs.build_number }}" \ + -p linux -a stack_duo -d -s + + - name: Get dependencies + run: flutter pub get + + - name: Decode secrets + env: + CHANGE_NOW: ${{ secrets.CHANGE_NOW }} + run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart + + - name: Build + env: + USE_SYSTEM_SECURE_STORAGE_DEPS: "1" + run: flutter build linux --release --verbose + + - name: Package + run: | + tar -czf "stack_duo-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz" \ + -C build/linux/x64/release bundle + + - uses: actions/upload-artifact@v4 + with: + name: stack_duo-linux-x86_64-${{ steps.ver.outputs.version }} + path: stack_duo-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz + build-flatpak: runs-on: ubuntu-24.04 needs: build-linux @@ -553,7 +681,7 @@ jobs: release: if: github.ref_type == 'tag' - needs: [build-linux, build-android, build-windows, build-macos, build-ios, build-flatpak] + needs: [build-linux, build-android, build-windows, build-macos, build-ios, build-flatpak, build-campfire-linux, build-stack-duo-linux] runs-on: ubuntu-latest permissions: contents: write From aef1e9d188a21508b41e4f583d00c351c5de285f Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Fri, 22 May 2026 11:37:44 -0700 Subject: [PATCH 5/6] Drop release workflow to keep it manual --- .github/workflows/build.yaml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 08b39f8d3..347f872a4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -679,29 +679,3 @@ jobs: 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, build-flatpak, build-campfire-linux, build-stack-duo-linux] - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Package artifacts - run: | - mkdir -p release-files - for dir in artifacts/stack_wallet-windows-*/; do - [ -d "$dir" ] || continue - name=$(basename "$dir") - (cd "$dir" && zip -r "../../release-files/${name}.zip" .) - done - 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 - with: - generate_release_notes: true - files: release-files/* From 3429b61af6ce86df0db24cf94674157ef37ce9a6 Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Fri, 22 May 2026 11:44:13 -0700 Subject: [PATCH 6/6] ci: package Windows as zip, add Android AAB, add format extensions to artifact names --- .github/workflows/build.yaml | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 347f872a4..ea994cba0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -93,7 +93,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }} + name: stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz path: stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz build-android: @@ -203,6 +203,8 @@ jobs: android-artifacts/stack_wallet-android-armeabi-v7a-${VERSION}.apk cp build/app/outputs/flutter-apk/app-x86_64-release.apk \ android-artifacts/stack_wallet-android-x86_64-${VERSION}.apk + cp build/app/outputs/bundle/release/app-release.aab \ + android-artifacts/stack_wallet-android-${VERSION}.aab - uses: actions/upload-artifact@v4 with: @@ -320,10 +322,16 @@ jobs: - name: Build run: flutter build windows --release + - name: Package + shell: pwsh + run: | + Compress-Archive -Path "build/windows/x64/runner/Release/*" ` + -DestinationPath "stack_wallet-windows-x86_64-${{ steps.ver.outputs.version }}.zip" + - uses: actions/upload-artifact@v4 with: - name: stack_wallet-windows-x86_64-${{ steps.ver.outputs.version }} - path: build/windows/x64/runner/Release/ + name: stack_wallet-windows-x86_64-${{ steps.ver.outputs.version }}.zip + path: stack_wallet-windows-x86_64-${{ steps.ver.outputs.version }}.zip build-macos: runs-on: macos-latest @@ -399,7 +407,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: stack_wallet-macos-aarch64-${{ steps.ver.outputs.version }} + name: stack_wallet-macos-aarch64-${{ steps.ver.outputs.version }}.zip path: stack_wallet-macos-aarch64-${{ steps.ver.outputs.version }}.zip build-ios: @@ -481,7 +489,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: stack_wallet-ios-aarch64-${{ steps.ver.outputs.version }} + name: stack_wallet-ios-aarch64-${{ steps.ver.outputs.version }}.ipa path: stack_wallet-ios-aarch64-${{ steps.ver.outputs.version }}.ipa build-campfire-linux: @@ -545,7 +553,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: campfire-linux-x86_64-${{ steps.ver.outputs.version }} + name: campfire-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz path: campfire-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz build-stack-duo-linux: @@ -609,7 +617,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: stack_duo-linux-x86_64-${{ steps.ver.outputs.version }} + name: stack_duo-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz path: stack_duo-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz build-flatpak: @@ -634,7 +642,7 @@ jobs: - name: Download Linux bundle uses: actions/download-artifact@v4 with: - name: stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }} + name: stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz - name: Stage bundle and icon run: | @@ -671,11 +679,11 @@ jobs: run: | flatpak build-bundle flatpak-repo \ --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo \ - "stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }}.flatpak" \ + "stack_wallet-flatpak-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 + name: stack_wallet-flatpak-x86_64-${{ steps.ver.outputs.version }}.flatpak + path: stack_wallet-flatpak-x86_64-${{ steps.ver.outputs.version }}.flatpak