Skip to content

Commit

Permalink
Merge pull request #43 from leo-lox/dev
Browse files Browse the repository at this point in the history
test ci
  • Loading branch information
leo-lox authored Nov 7, 2024
2 parents b91c5eb + 150a8e9 commit 38b36bd
Show file tree
Hide file tree
Showing 305 changed files with 13,594 additions and 13,257 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-android-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Flutter Android CI/CD

on:
push:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.4'
channel: 'stable'

- name: Install dependencies
run: flutter pub get



- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'

- name: Install Fastlane
run: |
cd android
gem install bundler
bundle install
- name: Deploy to Test Track Play Store
env:
G_PLAY_FASTLANE_SERVICE_ACCOUNT: ${{ secrets.G_PLAY_FASTLANE_SERVICE_ACCOUNT }}
run: |
cd android
bundle exec fastlane android beta
21 changes: 21 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: flutter CI

on:
push:
branches: [ dev, main ]
pull_request:
branches: [ dev, main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
#architecture: x64 # optional, x64 or arm64
- run: flutter --version
- run: flutter test -j 1
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.buildlog/
.history
.svn/
.keys/
migrate_working_dir/

# IntelliJ related
Expand Down Expand Up @@ -49,3 +50,20 @@ app.*.map.json

#
NOTES.md

#db
default.isar
default.isar-lck
isar.dll

# fastlane specific
**/fastlane/report.xml

# deliver temporary files
**/fastlane/Preview.html

# snapshot generated screenshots
**/fastlane/screenshots

# scan temporary files
**/fastlane/test_output
34 changes: 17 additions & 17 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: f1875d570e39de09040c8f79aa13cc56baab8db1
channel: stable
revision: "80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: android
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: ios
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: linux
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: macos
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: web
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: windows
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819

# User provided section

Expand Down
41 changes: 37 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,33 @@

## What is it?

camelus is a nostr client written in flutter, it is in heavy development, feel free to test it but expect some issues and missing features.
camelus is a nostr microblogging client written in flutter, it is in heavy development. Feel free to test it, but expect some issues and missing features.
The targeted platforms are mobile clients. Camelus uses dart_ndk as its core lib.
Dart_ndk is maintained by camelus and yana, combining efforts to offer a usable nostr lib accounting for mobile constraints (battery, data). The lib also does the heavy lifting with inbox/outbox (gossip) and database optimizations.

## What is the current mission?

I want to transform camelus into a simple but usable client. If you are looking for fancy features, please look elsewhere.
## architecture
The project uses clean architecture; if you are new to this, look in `domain_layer/usecases` and `domain_layer/entities`. Entities represent data and use cases, the core business logic of camelus.

## how can I test it?
dart_ndk is therefore included as an external lib.
Because camelus and dart_ndk entities are very similar (e.g., `nostr_note`), the conversion is trivial and might raise the question, why not rely on dart_ndk entities? Right now, abstraction is not really needed, and there is a performance penalty. Still, it also offers a clear boundary to dart_ndk and allows us to deviate and experiment on camelus and dart_ndk in the future. In my opinion, this flexibility is more valuable if performance is good enough.


To initialize the code, I use riverpod provider. Combined with clean architecture, it allows me to play Lego and manage dependencies in a central location, and expose it to the presentation_layer. A good example of this is `ndk_provider.dart`.
I use the riverpod provider very similar to singeltons, but the riverpod provider provides a better way to test code.


## state of the project

Right now, camelus is unusable/experimental state. We are right in the process of integrating dart_ndk into camelus, on the way cleaning up obsolete code and refactoring widgets. The goal is to have a reliable codebase that makes it easy for other developers (you?) to contribute to the project.

## Development

To get started, link dart_ndk in `pubspec.yaml` like this:
```
dart_ndk:
path: ../dart_ndk
```

### Android

Expand All @@ -21,3 +41,16 @@ or use the [apk](https://camelus.app/), it is signed with my key so you will nee
I don't have an iOS device so I can't test it, if you have an iOS device and want to test it, you can build it yourself, I will be happy to help you.

Otherwise wait for testflight to be available.


# How to build

1. make sure flutter is installed

2. clone the repo

3. clone [dart_ndk](https://github.com/relaystr/dart_ndk) and depending on your folder structure edit pubspec.yaml to point to the correct path

4. run `flutter pub get`

5. run `flutter build apk --release` or `flutter run` to run directly on your device in debug mode
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ gradle-wrapper.jar
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
/.keys/

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
Expand Down
3 changes: 3 additions & 0 deletions android/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "fastlane"
Loading

0 comments on commit 38b36bd

Please sign in to comment.