Skip to content

Commit c30a475

Browse files
committed
Merge remote-tracking branch 'origin/staging' into josh/fixes
2 parents 9a87cfd + f2ec69f commit c30a475

8 files changed

Lines changed: 371 additions & 4 deletions

.github/workflows/build-ci-image.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ jobs:
4040
cache-from: type=gha
4141
cache-to: type=gha,mode=max
4242

43+
- name: Build and push android image
44+
uses: docker/build-push-action@v7
45+
with:
46+
context: .
47+
target: android
48+
push: true
49+
tags: ${{ env.GHCR_IMAGE }}:android
50+
cache-from: type=gha
51+
cache-to: type=gha,mode=max
52+
4353
- name: Build and push test image
4454
uses: docker/build-push-action@v7
4555
with:

.github/workflows/build.yaml

Lines changed: 205 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
contents: read
103103
packages: read
104104
container:
105-
image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:latest
105+
image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:android
106106
credentials:
107107
username: ${{ github.actor }}
108108
password: ${{ github.token }}
@@ -190,6 +190,12 @@ jobs:
190190
- name: Build APKs
191191
run: flutter build apk --split-per-abi --release
192192

193+
- name: Clean intermediates before AAB
194+
run: |
195+
rm -rf build/app/intermediates
196+
rm -rf build/app/tmp
197+
find build -name '*.o' -delete 2>/dev/null || true
198+
193199
- name: Build AAB
194200
run: flutter build appbundle --release
195201

@@ -484,9 +490,205 @@ jobs:
484490
name: stack_wallet-ios-aarch64-${{ steps.ver.outputs.version }}
485491
path: stack_wallet-ios-aarch64-${{ steps.ver.outputs.version }}.ipa
486492

493+
build-campfire-linux:
494+
runs-on: ubuntu-24.04
495+
permissions:
496+
contents: read
497+
packages: read
498+
container:
499+
image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:latest
500+
credentials:
501+
username: ${{ github.actor }}
502+
password: ${{ github.token }}
503+
steps:
504+
- uses: actions/checkout@v6
505+
with:
506+
fetch-depth: 0
507+
submodules: recursive
508+
509+
- name: Set version
510+
id: ver
511+
run: |
512+
if [ "${{ github.ref_type }}" = "tag" ]; then
513+
VERSION="${{ github.ref_name }}"
514+
VERSION="${VERSION#v}"
515+
BUILD_NUMBER="${{ github.run_number }}"
516+
elif [ -n "${{ inputs.version }}" ]; then
517+
VERSION="${{ inputs.version }}"
518+
BUILD_NUMBER="${{ inputs.build_number }}"
519+
else
520+
VERSION="0.0.0-staging.${{ github.run_number }}"
521+
BUILD_NUMBER="${{ github.run_number }}"
522+
fi
523+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
524+
echo "build_number=${BUILD_NUMBER}" >> $GITHUB_OUTPUT
525+
526+
- name: Configure app
527+
run: |
528+
cd scripts
529+
echo "yes" | ./build_app.sh \
530+
-v "${{ steps.ver.outputs.version }}" \
531+
-b "${{ steps.ver.outputs.build_number }}" \
532+
-p linux -a campfire -d -s
533+
534+
- name: Get dependencies
535+
run: flutter pub get
536+
537+
- name: Decode secrets
538+
env:
539+
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
540+
run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart
541+
542+
- name: Build
543+
env:
544+
USE_SYSTEM_SECURE_STORAGE_DEPS: "1"
545+
run: flutter build linux --release --verbose
546+
547+
- name: Package
548+
run: |
549+
tar -czf "campfire-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz" \
550+
-C build/linux/x64/release bundle
551+
552+
- uses: actions/upload-artifact@v4
553+
with:
554+
name: campfire-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz
555+
path: campfire-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz
556+
557+
build-stack-duo-linux:
558+
runs-on: ubuntu-24.04
559+
permissions:
560+
contents: read
561+
packages: read
562+
container:
563+
image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:latest
564+
credentials:
565+
username: ${{ github.actor }}
566+
password: ${{ github.token }}
567+
steps:
568+
- uses: actions/checkout@v6
569+
with:
570+
fetch-depth: 0
571+
submodules: recursive
572+
573+
- name: Set version
574+
id: ver
575+
run: |
576+
if [ "${{ github.ref_type }}" = "tag" ]; then
577+
VERSION="${{ github.ref_name }}"
578+
VERSION="${VERSION#v}"
579+
BUILD_NUMBER="${{ github.run_number }}"
580+
elif [ -n "${{ inputs.version }}" ]; then
581+
VERSION="${{ inputs.version }}"
582+
BUILD_NUMBER="${{ inputs.build_number }}"
583+
else
584+
VERSION="0.0.0-staging.${{ github.run_number }}"
585+
BUILD_NUMBER="${{ github.run_number }}"
586+
fi
587+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
588+
echo "build_number=${BUILD_NUMBER}" >> $GITHUB_OUTPUT
589+
590+
- name: Configure app
591+
run: |
592+
cd scripts
593+
echo "yes" | ./build_app.sh \
594+
-v "${{ steps.ver.outputs.version }}" \
595+
-b "${{ steps.ver.outputs.build_number }}" \
596+
-p linux -a stack_duo -d -s
597+
598+
- name: Get dependencies
599+
run: flutter pub get
600+
601+
- name: Decode secrets
602+
env:
603+
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
604+
run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart
605+
606+
- name: Build
607+
env:
608+
USE_SYSTEM_SECURE_STORAGE_DEPS: "1"
609+
run: flutter build linux --release --verbose
610+
611+
- name: Package
612+
run: |
613+
tar -czf "stack_duo-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz" \
614+
-C build/linux/x64/release bundle
615+
616+
- uses: actions/upload-artifact@v4
617+
with:
618+
name: stack_duo-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz
619+
path: stack_duo-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz
620+
621+
622+
build-flatpak:
623+
runs-on: ubuntu-24.04
624+
needs: build-linux
625+
steps:
626+
- uses: actions/checkout@v6
627+
628+
- name: Set version
629+
id: ver
630+
run: |
631+
if [ "${{ github.ref_type }}" = "tag" ]; then
632+
VERSION="${{ github.ref_name }}"
633+
VERSION="${VERSION#v}"
634+
elif [ -n "${{ inputs.version }}" ]; then
635+
VERSION="${{ inputs.version }}"
636+
else
637+
VERSION="0.0.0-staging.${{ github.run_number }}"
638+
fi
639+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
640+
641+
- name: Download Linux bundle
642+
uses: actions/download-artifact@v4
643+
with:
644+
name: stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }}
645+
646+
- name: Stage bundle and icon
647+
run: |
648+
tar -xzf "stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }}.tar.gz" -C flatpak/
649+
cp asset_sources/icon/stack_wallet/icon.png flatpak/com.cypherstack.stackwallet.png
650+
651+
- name: Install Flatpak tools
652+
run: |
653+
sudo apt-get update -q
654+
sudo apt-get install -y flatpak flatpak-builder
655+
656+
- name: Set up Flathub remote
657+
run: flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
658+
659+
- name: Cache Flatpak SDK
660+
uses: actions/cache@v4
661+
with:
662+
path: ~/.local/share/flatpak
663+
key: flatpak-freedesktop-24.08-v1
664+
665+
- name: Install Flatpak SDK
666+
run: |
667+
flatpak install --user --noninteractive flathub \
668+
org.freedesktop.Platform//24.08 \
669+
org.freedesktop.Sdk//24.08
670+
671+
- name: Build Flatpak
672+
run: |
673+
flatpak-builder --user --force-clean \
674+
--repo=flatpak-repo \
675+
build-flatpak flatpak/com.cypherstack.stackwallet.yaml
676+
677+
- name: Bundle Flatpak
678+
run: |
679+
flatpak build-bundle flatpak-repo \
680+
--runtime-repo=https://flathub.org/repo/flathub.flatpakrepo \
681+
"stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }}.flatpak" \
682+
com.cypherstack.stackwallet
683+
684+
- uses: actions/upload-artifact@v4
685+
with:
686+
name: stack_wallet-flatpak-x86_64-${{ steps.ver.outputs.version }}
687+
path: stack_wallet-linux-x86_64-${{ steps.ver.outputs.version }}.flatpak
688+
487689
release:
488690
if: github.ref_type == 'tag'
489-
needs: [build-linux, build-android, build-windows, build-macos, build-ios]
691+
needs: [build-linux, build-android, build-windows, build-macos, build-ios, build-flatpak]
490692
runs-on: ubuntu-latest
491693
permissions:
492694
contents: write
@@ -503,7 +705,7 @@ jobs:
503705
name=$(basename "$dir")
504706
(cd "$dir" && zip -r "../../release-files/${name}.zip" .)
505707
done
506-
find artifacts/ \( -name "*.tar.gz" -o -name "*.zip" -o -name "*.ipa" \) -mindepth 2 -exec mv {} release-files/ \;
708+
find artifacts/ \( -name "*.tar.gz" -o -name "*.zip" -o -name "*.ipa" -o -name "*.flatpak" \) -mindepth 2 -exec mv {} release-files/ \;
507709
find artifacts/ -name "*.apk" -mindepth 2 -exec mv {} release-files/ \;
508710
509711
- uses: softprops/action-gh-release@v2

.github/workflows/test.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,21 @@ jobs:
4343
env:
4444
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
4545
run: |
46-
echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart
46+
if [ -n "$CHANGE_NOW" ]; then
47+
echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart
48+
else
49+
cat > lib/external_api_keys.dart << 'EOF'
50+
const String kChangeNowApiKey = "";
51+
const String kSimpleSwapApiKey = "";
52+
const String kNanswapApiKey = "";
53+
const String kNanoSwapRpcApiKey = "";
54+
const String kWizSwapApiKey = "";
55+
const kShopInBitAccessKey = "";
56+
const kShopInBitPartnerSecret = "";
57+
const kCakePayApiToken = "";
58+
const kExolixApiKey = "";
59+
EOF
60+
fi
4761
4862
- name: Ensure app config for tests
4963
run: bash scripts/ensure_test_app_config.sh

Dockerfile

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,85 @@ RUN git config --system --add safe.directory '*'
8888
RUN flutter --version && rustc --version && cargo --version && node --version && go version
8989

9090

91+
# Android-only image: no Linux/Windows cross-compilers, no OpenCV/OpenCL, single Rust toolchain with android targets
92+
FROM ubuntu:24.04 AS android
93+
94+
ENV DEBIAN_FRONTEND=noninteractive \
95+
TZ=Etc/UTC \
96+
LANG=C.UTF-8 \
97+
LC_ALL=C.UTF-8
98+
99+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
100+
101+
RUN apt-get update && apt-get install -y --no-install-recommends \
102+
ca-certificates curl file git gnupg python3 sudo unzip xz-utils \
103+
build-essential cmake ninja-build pkg-config \
104+
libssl-dev zlib1g-dev \
105+
openjdk-21-jdk-headless \
106+
&& rm -rf /var/lib/apt/lists/*
107+
108+
ENV RUSTUP_HOME=/usr/local/rustup \
109+
CARGO_HOME=/usr/local/cargo \
110+
PATH=/usr/local/cargo/bin:$PATH
111+
112+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
113+
| sh -s -- -y --default-toolchain 1.89.0 --profile minimal --no-modify-path \
114+
&& rustup target add \
115+
aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android \
116+
--toolchain 1.89.0 \
117+
&& cargo install cargo-ndk \
118+
&& chmod -R a+rwX "$CARGO_HOME" "$RUSTUP_HOME"
119+
120+
ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
121+
122+
ENV ANDROID_SDK_ROOT=/opt/android-sdk \
123+
ANDROID_HOME=/opt/android-sdk \
124+
ANDROID_NDK_ROOT=/opt/android-sdk/ndk/28.2.13676358 \
125+
ANDROID_NDK_HOME=/opt/android-sdk/ndk/28.2.13676358 \
126+
PATH=/opt/android-sdk/cmdline-tools/latest/bin:/opt/android-sdk/platform-tools:$PATH
127+
128+
RUN mkdir -p "$ANDROID_SDK_ROOT/cmdline-tools" \
129+
&& curl -fsSL https://dl.google.com/android/repository/commandlinetools-linux-14742923_latest.zip \
130+
-o /tmp/cmdline-tools.zip \
131+
&& echo "48833c34b761c10cb20bcd16582129395d121b27 /tmp/cmdline-tools.zip" | sha1sum -c \
132+
&& unzip -q /tmp/cmdline-tools.zip -d "$ANDROID_SDK_ROOT/cmdline-tools" \
133+
&& mv "$ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools" "$ANDROID_SDK_ROOT/cmdline-tools/latest" \
134+
&& rm /tmp/cmdline-tools.zip \
135+
&& mkdir -p "$ANDROID_SDK_ROOT/licenses" \
136+
&& printf '\n24333f8a63b6825ea9c5514f83c2829b004d1fee\n8933bad161af4178b1185d1a37fbf41ea5269c55d7b9237478ea8ec3307c27e4' \
137+
> "$ANDROID_SDK_ROOT/licenses/android-sdk-license" \
138+
&& printf '\n84831b9409646a918e30573bab4c9c91346d8abd' \
139+
> "$ANDROID_SDK_ROOT/licenses/android-sdk-preview-license" \
140+
&& printf '\n859f317696f67ef3d7f30a50a5560e7834b43903' \
141+
> "$ANDROID_SDK_ROOT/licenses/android-sdk-arm-dbt-license" \
142+
&& sdkmanager \
143+
"platform-tools" \
144+
"build-tools;35.0.0" \
145+
"platforms;android-35" \
146+
"ndk;28.2.13676358" \
147+
&& chmod -R a+rwX "$ANDROID_SDK_ROOT"
148+
149+
ENV PATH=/usr/local/go/bin:$PATH
150+
151+
RUN curl -fsSL https://go.dev/dl/go1.24.13.linux-amd64.tar.gz -o /tmp/go.tar.gz \
152+
&& echo "1fc94b57134d51669c72173ad5d49fd62afb0f1db9bf3f798fd98ee423f8d730 /tmp/go.tar.gz" | sha256sum -c \
153+
&& tar -C /usr/local -xzf /tmp/go.tar.gz \
154+
&& rm /tmp/go.tar.gz
155+
156+
ENV FLUTTER_HOME=/opt/flutter \
157+
PATH=/opt/flutter/bin:/opt/flutter/bin/cache/dart-sdk/bin:$PATH
158+
159+
RUN git clone --depth 1 --branch 3.38.1 https://github.com/flutter/flutter.git "$FLUTTER_HOME" \
160+
&& git config --global --add safe.directory '*' \
161+
&& flutter config --no-analytics \
162+
&& flutter precache --android \
163+
&& chmod -R a+rwX "$FLUTTER_HOME"
164+
165+
RUN git config --system --add safe.directory '*'
166+
167+
RUN flutter --version && rustc --version && cargo --version && go version
168+
169+
91170
# Minimal image for flutter test (no Rust, no Android SDK, no cross-compilers)
92171
FROM ubuntu:24.04 AS test
93172

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[Desktop Entry]
2+
Name=Stack Wallet
3+
Comment=Open-source non-custodial cryptocurrency wallet
4+
Exec=stack_wallet
5+
Icon=com.cypherstack.stackwallet
6+
Type=Application
7+
Categories=Finance;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<component type="desktop-application">
3+
<id>com.cypherstack.stackwallet</id>
4+
<metadata_license>CC0-1.0</metadata_license>
5+
<project_license>GPL-3.0-only</project_license>
6+
<name>Stack Wallet</name>
7+
<summary>Open-source non-custodial cryptocurrency wallet</summary>
8+
<description>
9+
<p>
10+
Stack Wallet is an open-source, non-custodial, privacy-focused
11+
cryptocurrency wallet supporting multiple coins.
12+
</p>
13+
</description>
14+
<url type="homepage">https://stackwallet.com</url>
15+
<url type="bugtracker">https://github.com/cypherstack/stack_wallet/issues</url>
16+
<content_rating type="oars-1.1"/>
17+
</component>

0 commit comments

Comments
 (0)