Skip to content

Commit

Permalink
Merge pull request #23 from SatoshiPortal/develop
Browse files Browse the repository at this point in the history
Prepare publication on pub.dev
  • Loading branch information
ethicnology authored Jan 13, 2025
2 parents 9acb66e + c15c75f commit 5501a4e
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 16 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/precompiled_binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
push:
branches: [ trunk ]

name: Precompile Binaries
jobs:
Precompile:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- macOS-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1

- name: Install GTK
if: (matrix.os == 'ubuntu-latest')
run: sudo apt-get update && sudo apt-get install libgtk-3-dev
- name: Set up Android SDK
if: (matrix.os == 'ubuntu-20.04')
uses: android-actions/setup-android@v2

- name: Install Specific NDK
if: (matrix.os == 'ubuntu-20.04')
run: sdkmanager --install "ndk;24.0.8215888"
- name: Precompile
if: (matrix.os == 'macOS-latest') || (matrix.os == 'windows-latest')
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=SatoshiPortal/boltz-dart
working-directory: cargokit/build_tool
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
PRIVATE_KEY: ${{ secrets.RELEASE_PRIVATE_KEY }}

- name: Precompile (with Android)
if: (matrix.os == 'ubuntu-latest')
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=SatoshiPortal/boltz-dart --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=24.0.8215888 --android-min-sdk-version=23
working-directory: cargokit/build_tool
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
PRIVATE_KEY: ${{ secrets.RELEASE_PRIVATE_KEY }}
4 changes: 2 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ linter:

analyzer:
exclude:
- lib/src/generated/bindings.dart
- lib/src/generated/bridge_definitions.dart
- cargokit/
- lib/src/generated/
- README.md
5 changes: 4 additions & 1 deletion cargokit/build_tool/lib/src/options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,10 @@ class CargokitUserOptions {
}
userProjectDir = userProjectDir.parent;
}
return CargokitUserOptions._();
return CargokitUserOptions(
usePrecompiledBinaries: true,
verboseLogging: false,
);
}

final bool usePrecompiledBinaries;
Expand Down
8 changes: 8 additions & 0 deletions cargokit_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Enables verbose logging of cargokit during build
verbose_logging: false

# Opts out of using precompiled binaries. If crate has configured
# and deployed precompiled binaries, these will be by default used whenever Rustup
# is not installed. With `use_precompiled_binaries` set to false, the build will
# instead be aborted prompting user to install Rustup.
use_precompiled_binaries: true
2 changes: 2 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- boltz (0.0.1)
- boltz (0.1.6)
- Flutter (1.0.0)

DEPENDENCIES:
Expand All @@ -13,9 +13,9 @@ EXTERNAL SOURCES:
:path: Flutter

SPEC CHECKSUMS:
boltz: bcf0b514037c50afbba8a67ea01317a6f34cd145
boltz: 6388ec2412f3753b63a9e65c97f87ea26f43bddc
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7

PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Flutter
import UIKit

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Future test() async {
const boltzUrl = 'https://api.testnet.boltz.exchange/v2';
// const amount = 100000;
final fees = await const bltz.Fees(boltzUrl: boltzUrl).chain();
print('FEES:${fees}');
print('FEES:$fees');
} catch (e) {
print('\n\nERRRR: ' + e.toString() + '\n\n');
print('\n\nERRRR: $e\n\n');
}
}
File renamed without changes.
6 changes: 0 additions & 6 deletions lib/src/types/swap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ extension SwapStatusX on SwapStatus {

case SwapStatus.minerfeePaid:
return 'minerfee.paid';

default:
throw ArgumentError('Invalid SwapStatus: $this');
}
}

Expand Down Expand Up @@ -157,9 +154,6 @@ extension SwapStatusX on SwapStatus {

case SwapStatus.minerfeePaid:
return 'Minerfee paid';

default:
throw ArgumentError('Invalid SwapStatus: $this');
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
flutter_rust_bridge: 2.0.0
flutter_rust_bridge: ^2.0.0
ffi: ^2.0.1
meta: ^1.8.0
uuid: ^4.1.0
Expand Down
13 changes: 13 additions & 0 deletions rust/cargokit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cargo:
debug:
toolchain: stable
release:
toolchain: nightly
extra_flags:
- -Z
- build-std=panic_abort,std
precompiled_binaries:
# Uri prefix used when downloading precompiled binaries.
url_prefix: https://github.com/SatoshiPortal/boltz-dart/releases/download/precompiled_
# Public key for verifying downloaded precompiled binaries.
public_key: 496885349368a850fa21668c1d0af5f9aa0748415be20a11545695383ef7851b

0 comments on commit 5501a4e

Please sign in to comment.