Skip to content

Commit 538ae70

Browse files
Merge branch 'staging' into claude/review-branch-quality-WssvC
2 parents b8f6685 + a521b2a commit 538ae70

50 files changed

Lines changed: 2697 additions & 1380 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.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: 257 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ jobs:
1919

2020
build-linux:
2121
runs-on: ubuntu-24.04
22+
permissions:
23+
contents: read
24+
packages: read
2225
container:
23-
image: stackwallet/stackwallet-ci:latest
26+
image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:latest
2427
credentials:
25-
username: ${{ secrets.DOCKERHUB_USERNAME }}
26-
password: ${{ secrets.DOCKERHUB_TOKEN }}
28+
username: ${{ github.actor }}
29+
password: ${{ github.token }}
2730
steps:
2831
- uses: actions/checkout@v6
2932
with:
@@ -73,11 +76,10 @@ jobs:
7376
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
7477
run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart
7578

76-
- name: Generate app config
77-
run: dart run build_runner build --delete-conflicting-outputs
78-
7979
- name: Build
80-
run: flutter build linux --release
80+
env:
81+
USE_SYSTEM_SECURE_STORAGE_DEPS: "1"
82+
run: flutter build linux --release --verbose
8183

8284
- name: Package
8385
run: |
@@ -91,11 +93,14 @@ jobs:
9193

9294
build-android:
9395
runs-on: ubuntu-24.04
96+
permissions:
97+
contents: read
98+
packages: read
9499
container:
95-
image: stackwallet/stackwallet-ci:latest
100+
image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:latest
96101
credentials:
97-
username: ${{ secrets.DOCKERHUB_USERNAME }}
98-
password: ${{ secrets.DOCKERHUB_TOKEN }}
102+
username: ${{ github.actor }}
103+
password: ${{ github.token }}
99104
steps:
100105
- uses: actions/checkout@v6
101106
with:
@@ -145,9 +150,6 @@ jobs:
145150
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
146151
run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart
147152

148-
- name: Generate app config
149-
run: dart run build_runner build --delete-conflicting-outputs
150-
151153
- name: Set up Android local.properties
152154
run: |
153155
cat > android/local.properties <<EOF
@@ -183,17 +185,256 @@ jobs:
183185
android-artifacts/stack_wallet-android-armeabi-v7a-${VERSION}.apk
184186
cp build/app/outputs/flutter-apk/app-x86_64-release.apk \
185187
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
188188
189189
- uses: actions/upload-artifact@v4
190190
with:
191191
name: stack_wallet-android-${{ steps.ver.outputs.version }}
192192
path: android-artifacts/
193193

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

0 commit comments

Comments
 (0)