Skip to content

Commit 12e207d

Browse files
Merge branch 'staging' into feat/shopinbit
2 parents ad92606 + 778e2bd commit 12e207d

15 files changed

Lines changed: 370 additions & 52 deletions

File tree

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

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,43 @@ on:
99
workflow_dispatch:
1010

1111
env:
12-
IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/stackwallet-ci
12+
GHCR_IMAGE: ghcr.io/${{ github.repository_owner }}/stackwallet-ci
1313

1414
jobs:
1515
build:
1616
runs-on: ubuntu-24.04
17+
permissions:
18+
contents: read
19+
packages: write
1720
steps:
1821
- uses: actions/checkout@v6
1922

2023
- uses: docker/setup-buildx-action@v4
2124

2225
- uses: docker/login-action@v4
2326
with:
24-
username: ${{ secrets.DOCKERHUB_USERNAME }}
25-
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
2630

27-
- name: Build and push
31+
- name: Build and push full image
2832
uses: docker/build-push-action@v7
2933
with:
3034
context: .
35+
target: full
3136
push: true
3237
tags: |
33-
${{ env.IMAGE }}:latest
34-
${{ env.IMAGE }}:${{ github.sha }}
38+
${{ env.GHCR_IMAGE }}:latest
39+
${{ env.GHCR_IMAGE }}:${{ github.sha }}
40+
cache-from: type=gha
41+
cache-to: type=gha,mode=max
42+
43+
- name: Build and push test image
44+
uses: docker/build-push-action@v7
45+
with:
46+
context: .
47+
target: test
48+
push: true
49+
tags: ${{ env.GHCR_IMAGE }}:test
3550
cache-from: type=gha
3651
cache-to: type=gha,mode=max

.github/workflows/build.yaml

Lines changed: 228 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,242 @@ jobs:
183183
android-artifacts/stack_wallet-android-armeabi-v7a-${VERSION}.apk
184184
cp build/app/outputs/flutter-apk/app-x86_64-release.apk \
185185
android-artifacts/stack_wallet-android-x86_64-${VERSION}.apk
186-
cp build/app/outputs/bundle/release/app-release.aab \
187-
android-artifacts/stack_wallet-android-${VERSION}.aab
188186
189187
- uses: actions/upload-artifact@v4
190188
with:
191189
name: stack_wallet-android-${{ steps.ver.outputs.version }}
192190
path: android-artifacts/
193191

192+
build-windows:
193+
runs-on: windows-latest
194+
defaults:
195+
run:
196+
shell: bash
197+
steps:
198+
- uses: actions/checkout@v6
199+
with:
200+
fetch-depth: 0
201+
submodules: recursive
202+
203+
- name: Set version
204+
id: ver
205+
run: |
206+
if [ "${{ github.ref_type }}" = "tag" ]; then
207+
VERSION="${{ github.ref_name }}"
208+
VERSION="${VERSION#v}"
209+
BUILD_NUMBER="${{ github.run_number }}"
210+
else
211+
VERSION="${{ inputs.version }}"
212+
BUILD_NUMBER="${{ inputs.build_number }}"
213+
fi
214+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
215+
echo "build_number=${BUILD_NUMBER}" >> $GITHUB_OUTPUT
216+
217+
- uses: subosito/flutter-action@v2
218+
with:
219+
flutter-version: '3.38.1'
220+
channel: 'stable'
221+
222+
- name: Configure app
223+
run: |
224+
cd scripts
225+
echo "yes" | ./build_app.sh \
226+
-v "${{ steps.ver.outputs.version }}" \
227+
-b "${{ steps.ver.outputs.build_number }}" \
228+
-p windows -a stack_wallet -d -s
229+
230+
- name: Get dependencies
231+
run: flutter pub get
232+
233+
- name: Create git_versions.dart stubs
234+
run: |
235+
mkdir -p crypto_plugins/flutter_libepiccash/lib
236+
mkdir -p crypto_plugins/flutter_libmwc/lib
237+
238+
EPIC_TAG=$(git -C crypto_plugins/flutter_libepiccash describe --tags --exact-match HEAD 2>/dev/null || echo "dev")
239+
MWC_TAG=$(git -C crypto_plugins/flutter_libmwc describe --tags --exact-match HEAD 2>/dev/null || echo "dev")
240+
241+
printf 'String getPluginVersion() => "%s";\n' "$EPIC_TAG" \
242+
> crypto_plugins/flutter_libepiccash/lib/git_versions.dart
243+
printf 'String getPluginVersion() => "%s";\n' "$MWC_TAG" \
244+
> crypto_plugins/flutter_libmwc/lib/git_versions.dart
245+
246+
- name: Decode secrets
247+
env:
248+
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
249+
run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart
250+
251+
- name: Generate app config
252+
run: dart run build_runner build --delete-conflicting-outputs
253+
254+
- name: Build
255+
run: flutter build windows --release
256+
257+
- name: Package
258+
shell: pwsh
259+
run: |
260+
Compress-Archive -Path build\windows\x64\runner\Release\* `
261+
-DestinationPath "stack_wallet-windows-x86_64-${{ steps.ver.outputs.version }}.zip"
262+
263+
- uses: actions/upload-artifact@v4
264+
with:
265+
name: stack_wallet-windows-x86_64-${{ steps.ver.outputs.version }}
266+
path: stack_wallet-windows-x86_64-${{ steps.ver.outputs.version }}.zip
267+
268+
build-macos:
269+
runs-on: macos-latest
270+
steps:
271+
- uses: actions/checkout@v6
272+
with:
273+
fetch-depth: 0
274+
submodules: recursive
275+
276+
- name: Set version
277+
id: ver
278+
run: |
279+
if [ "${{ github.ref_type }}" = "tag" ]; then
280+
VERSION="${{ github.ref_name }}"
281+
VERSION="${VERSION#v}"
282+
BUILD_NUMBER="${{ github.run_number }}"
283+
else
284+
VERSION="${{ inputs.version }}"
285+
BUILD_NUMBER="${{ inputs.build_number }}"
286+
fi
287+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
288+
echo "build_number=${BUILD_NUMBER}" >> $GITHUB_OUTPUT
289+
290+
- uses: subosito/flutter-action@v2
291+
with:
292+
flutter-version: '3.38.1'
293+
channel: 'stable'
294+
295+
- name: Configure app
296+
run: |
297+
cd scripts
298+
echo "yes" | ./build_app.sh \
299+
-v "${{ steps.ver.outputs.version }}" \
300+
-b "${{ steps.ver.outputs.build_number }}" \
301+
-p macos -a stack_wallet -d -s
302+
303+
- name: Get dependencies
304+
run: flutter pub get
305+
306+
- name: Create git_versions.dart stubs
307+
run: |
308+
mkdir -p crypto_plugins/flutter_libepiccash/lib
309+
mkdir -p crypto_plugins/flutter_libmwc/lib
310+
311+
EPIC_TAG=$(git -C crypto_plugins/flutter_libepiccash describe --tags --exact-match HEAD 2>/dev/null || echo "dev")
312+
MWC_TAG=$(git -C crypto_plugins/flutter_libmwc describe --tags --exact-match HEAD 2>/dev/null || echo "dev")
313+
314+
printf 'String getPluginVersion() => "%s";\n' "$EPIC_TAG" \
315+
> crypto_plugins/flutter_libepiccash/lib/git_versions.dart
316+
printf 'String getPluginVersion() => "%s";\n' "$MWC_TAG" \
317+
> crypto_plugins/flutter_libmwc/lib/git_versions.dart
318+
319+
- name: Decode secrets
320+
env:
321+
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
322+
run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart
323+
324+
- name: Generate app config
325+
run: dart run build_runner build --delete-conflicting-outputs
326+
327+
- name: Build
328+
run: flutter build macos --release
329+
330+
- name: Package
331+
run: |
332+
cd "build/macos/Build/Products/Release"
333+
zip -r "$GITHUB_WORKSPACE/stack_wallet-macos-aarch64-${{ steps.ver.outputs.version }}.zip" \
334+
"Stack Wallet.app"
335+
336+
- uses: actions/upload-artifact@v4
337+
with:
338+
name: stack_wallet-macos-aarch64-${{ steps.ver.outputs.version }}
339+
path: stack_wallet-macos-aarch64-${{ steps.ver.outputs.version }}.zip
340+
341+
build-ios:
342+
runs-on: macos-latest
343+
steps:
344+
- uses: actions/checkout@v6
345+
with:
346+
fetch-depth: 0
347+
submodules: recursive
348+
349+
- name: Set version
350+
id: ver
351+
run: |
352+
if [ "${{ github.ref_type }}" = "tag" ]; then
353+
VERSION="${{ github.ref_name }}"
354+
VERSION="${VERSION#v}"
355+
BUILD_NUMBER="${{ github.run_number }}"
356+
else
357+
VERSION="${{ inputs.version }}"
358+
BUILD_NUMBER="${{ inputs.build_number }}"
359+
fi
360+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
361+
echo "build_number=${BUILD_NUMBER}" >> $GITHUB_OUTPUT
362+
363+
- uses: dtolnay/rust-toolchain@master
364+
with:
365+
toolchain: '1.71.0'
366+
targets: aarch64-apple-ios
367+
368+
- uses: subosito/flutter-action@v2
369+
with:
370+
flutter-version: '3.38.1'
371+
channel: 'stable'
372+
373+
- name: Configure app
374+
run: |
375+
cd scripts
376+
echo "yes" | ./build_app.sh \
377+
-v "${{ steps.ver.outputs.version }}" \
378+
-b "${{ steps.ver.outputs.build_number }}" \
379+
-p ios -a stack_wallet -d -s
380+
381+
- name: Get dependencies
382+
run: flutter pub get
383+
384+
- name: Create git_versions.dart stubs
385+
run: |
386+
mkdir -p crypto_plugins/flutter_libepiccash/lib
387+
mkdir -p crypto_plugins/flutter_libmwc/lib
388+
389+
EPIC_TAG=$(git -C crypto_plugins/flutter_libepiccash describe --tags --exact-match HEAD 2>/dev/null || echo "dev")
390+
MWC_TAG=$(git -C crypto_plugins/flutter_libmwc describe --tags --exact-match HEAD 2>/dev/null || echo "dev")
391+
392+
printf 'String getPluginVersion() => "%s";\n' "$EPIC_TAG" \
393+
> crypto_plugins/flutter_libepiccash/lib/git_versions.dart
394+
printf 'String getPluginVersion() => "%s";\n' "$MWC_TAG" \
395+
> crypto_plugins/flutter_libmwc/lib/git_versions.dart
396+
397+
- name: Decode secrets
398+
env:
399+
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
400+
run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart
401+
402+
- name: Generate app config
403+
run: dart run build_runner build --delete-conflicting-outputs
404+
405+
- name: Build
406+
run: flutter build ios --release --no-codesign
407+
408+
- name: Package IPA
409+
run: |
410+
mkdir Payload
411+
cp -r build/ios/iphoneos/Runner.app Payload/
412+
zip -r "stack_wallet-ios-aarch64-${{ steps.ver.outputs.version }}.ipa" Payload/
413+
414+
- uses: actions/upload-artifact@v4
415+
with:
416+
name: stack_wallet-ios-aarch64-${{ steps.ver.outputs.version }}
417+
path: stack_wallet-ios-aarch64-${{ steps.ver.outputs.version }}.ipa
418+
194419
release:
195420
if: github.ref_type == 'tag'
196-
needs: [build-linux, build-android]
421+
needs: [build-linux, build-android, build-windows, build-macos, build-ios]
197422
runs-on: ubuntu-latest
198423
permissions:
199424
contents: write

.github/workflows/test.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ on: [pull_request]
33
jobs:
44
test:
55
runs-on: ubuntu-24.04
6+
permissions:
7+
contents: read
8+
packages: read
69
container:
7-
image: stackwallet/stackwallet-ci:latest
10+
image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:test
811
credentials:
9-
username: ${{ secrets.DOCKERHUB_USERNAME }}
10-
password: ${{ secrets.DOCKERHUB_TOKEN }}
12+
username: ${{ github.actor }}
13+
password: ${{ github.token }}
1114
steps:
1215
- name: Prepare repository
1316
uses: actions/checkout@v6

Dockerfile

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker/dockerfile:1.7
2-
FROM ubuntu:24.04
2+
FROM ubuntu:24.04 AS full
33

44
ENV DEBIAN_FRONTEND=noninteractive \
55
TZ=Etc/UTC \
@@ -15,6 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1515
clang libclang-dev llvm \
1616
libgcrypt20-dev libgirepository1.0-dev libgit2-dev libglib2.0-dev libgtk-3-dev \
1717
libjsoncpp-dev liblzma-dev libncurses5-dev libncursesw5-dev \
18+
libopencv-dev \
1819
libsecret-1-dev libssl-dev libtss2-dev \
1920
ocl-icd-opencl-dev opencl-headers valac zlib1g-dev \
2021
g++-aarch64-linux-gnu gcc-aarch64-linux-gnu \
@@ -78,3 +79,35 @@ RUN git clone --depth 1 --branch 3.38.1 https://github.com/flutter/flutter.git "
7879
RUN git config --system --add safe.directory '*'
7980

8081
RUN flutter --version && rustc --version && cargo --version && node --version
82+
83+
84+
# Minimal image for flutter test (no Rust, no Android SDK, no cross-compilers)
85+
FROM ubuntu:24.04 AS test
86+
87+
ENV DEBIAN_FRONTEND=noninteractive \
88+
TZ=Etc/UTC \
89+
LANG=C.UTF-8 \
90+
LC_ALL=C.UTF-8
91+
92+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
93+
94+
RUN apt-get update && apt-get install -y --no-install-recommends \
95+
ca-certificates curl file git unzip xz-utils \
96+
build-essential cmake ninja-build pkg-config \
97+
clang libclang-dev \
98+
libgirepository1.0-dev libglib2.0-dev libgtk-3-dev \
99+
libjsoncpp-dev liblzma-dev libsecret-1-dev libssl-dev \
100+
&& rm -rf /var/lib/apt/lists/*
101+
102+
ENV FLUTTER_HOME=/opt/flutter \
103+
PATH=/opt/flutter/bin:/opt/flutter/bin/cache/dart-sdk/bin:$PATH
104+
105+
RUN git clone --depth 1 --branch 3.38.1 https://github.com/flutter/flutter.git "$FLUTTER_HOME" \
106+
&& git config --global --add safe.directory '*' \
107+
&& flutter config --no-analytics \
108+
&& flutter precache --linux \
109+
&& chmod -R a+rwX "$FLUTTER_HOME"
110+
111+
RUN git config --system --add safe.directory '*'
112+
113+
RUN flutter --version

lib/hive_registrar.g.dart

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)