Skip to content

Commit

Permalink
feat: unified mnemonic package (#1)
Browse files Browse the repository at this point in the history
* use frb with separate dart and flutter package

* frb + melos script + cicd + dart tests and example

* add example code

* expose functions from bindings in flutter package

* add example code for flutter_unified_mnemonic package

* fix version in platform dependent make files and podspecs

* add gitignore file to linux folder

* fix apple binding

* add PR templates

* add breaking changes title in PR template

* fix: integration tests error because of versions

* fix: build and test run on macos-latest

* fix: on template for PR

* fix: toolchain in build action

* fix: recursion limit in github build action

* fix: recursion_limit

* fix: turn off default features of bdk

* fix: formatting of generated code

* fix: dev dependency in example for integration test

* fix: build action

* fix: exclude bridge generated files from analyzer

* fix: analyzer

* fix: try to fix actions again

* fix: analyzer errors

* fix: format exclusion of bridge generated files
  • Loading branch information
kumulynja authored Jul 23, 2023
1 parent 4984e76 commit 08282f2
Show file tree
Hide file tree
Showing 234 changed files with 7,832 additions and 1,196 deletions.
23 changes: 23 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 2
enable-beta-ecosystems: true
updates:
- package-ecosystem: pub
directory: "/packages/unified_mnemonic"
schedule:
interval: weekly
- package-ecosystem: pub
directory: "/packages/unified_mnemonic/example"
schedule:
interval: weekly
- package-ecosystem: pub
directory: "/packages/flutter_unified_mnemonic"
schedule:
interval: weekly
- package-ecosystem: pub
directory: "/packages/flutter_unified_mnemonic/example"
schedule:
interval: weekly
- package-ecosystem: cargo
directory: "/packages/unified_mnemonic/native"
schedule:
interval: weekly
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Description

What:

How:

Link to Issue (optional):

---

### Code Checklist

- [ ] tested
- [ ] documented
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build & Test

on:
pull_request:
push:
branches:
- main
schedule:
# runs the CI everyday at 10AM
- cron: "0 10 * * *"

jobs:
# General build, check, and test steps
build_and_test:
runs-on: ubuntu-latest

steps:
# Setup
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy

# Rust
- name: Check Rust format
working-directory: ./packages/unified_mnemonic/native/src
run: rustfmt --check lib.rs
- name: Rust code analysis
run: cargo clippy -- -D warnings
- name: Run Rust tests
run: cargo test
- name: Build Rust code for Dart tests
run: cargo build -r

# Dart/Flutter
- name: Check Dart format
run: melos run check-format --no-select
- name: Dart code analysis
run: melos run analyze --no-select
- name: Run Dart tests
run: melos run test
38 changes: 38 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Create Release(s)

on:
workflow_dispatch:
inputs:
version_parameters:
description: 'Parameters to pass to "melos version"'
required: true
default: " "
type: choice
options:
- "--"
- "--prerelease"
- "--graduate"

jobs:
create_release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }}
fetch-depth: 0
- name: Setup git
run: |
git config user.name "Kumulynja"
git config user.email "b@kumuly.dev"
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v2

- name: Create the new version(s)
run: melos version --yes ${{ inputs.version_parameters }}

- name: Push created version commit
run: git push
- name: Push modified tags
run: git push --tags
53 changes: 53 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish Release(s)

on:
push:
tags:
- "*"

jobs:
publish_github_release:
# macOS because we can cross-compile to all other platforms from it
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v2
- uses: goto-bus-stop/setup-zig@v2
- uses: KyleMayes/install-llvm-action@v1
with:
version: "15"
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: nttld/setup-ndk@v1
with:
ndk-version: r25b

- name: Build all library binaries
run: melos run build

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
files: platform-build/*

publish_pub_release:
needs: publish_github_release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v2
- name: Setup pub.dev credentials
run: |
mkdir -p $HOME/.config/dart
cat << EOF > $HOME/.config/dart/pub-credentials.json
${{ secrets.PUB_CRED_JSON }}
EOF
- name: Dry-run publish to pub.dev
run: melos publish -y --dry-run
- name: Publish to pub.dev
run: melos publish -y --no-dry-run
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[workspace]
members = [
"packages/unified_mnemonic/rust",
"packages/lightning_message/rust",
"packages/unified_mnemonic/native",
]

[profile.release]
Expand Down
Loading

0 comments on commit 08282f2

Please sign in to comment.