Skip to content

Commit

Permalink
Merge pull request #1 from landamessenger/develop
Browse files Browse the repository at this point in the history
Bump dependencies
  • Loading branch information
efraespada authored Oct 13, 2024
2 parents 4fcf6e0 + 81a2e4c commit 3879234
Show file tree
Hide file tree
Showing 9 changed files with 354 additions and 10 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/push_check_analyze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Push Analyze Check

on:
push:
branches:
- '**'
- '!master'

jobs:
push_check_analyze:

runs-on: self-hosted

steps:
- uses: actions/checkout@v4

- name: Set up Node.js 18
uses: actions/setup-node@v4
with:
node-version: '18.x'

- name: Install Landa Messenger CLI
run: npm install @landamessenger/landa-messenger-api -g

- uses: subosito/flutter-action@v1
with:
channel: 'stable'
flutter-version: '3.24.3'

- run: flutter pub get

- run: flutter analyze

- name: Handle job completion
if: always()
run: |
if [ "${{ job.status }}" == "failure" ]; then
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🔴 Analysis Failed" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/push_check_analyze.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
elif [ "${{ job.status }}" == "cancelled" ]; then
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🟠 Analysis Canceled" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/push_check_analyze.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
else
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🟢 Analysis Passed" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/push_check_analyze.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
fi
68 changes: 68 additions & 0 deletions .github/workflows/push_check_publish_dry_run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Push Publish Dry Run Check

on:
push:
branches:
- '**'
- '!master'

jobs:
push_check_publish_dry_run:

runs-on: self-hosted

steps:
- uses: actions/checkout@v4

- name: Set up Node.js 18
uses: actions/setup-node@v4
with:
node-version: '18.x'

- name: Install Landa Messenger CLI
run: npm install @landamessenger/landa-messenger-api -g

- uses: subosito/flutter-action@v1
with:
channel: 'stable'
flutter-version: '3.24.3'

- run: flutter pub get

- run: dart pub publish --dry-run

- name: Handle job completion
if: always()
run: |
if [ "${{ job.status }}" == "failure" ]; then
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🔴 Dry Publish Failed" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/push_check_publish_dry_run.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
elif [ "${{ job.status }}" == "cancelled" ]; then
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🟠 Dry Publish Canceled" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/push_check_publish_dry_run.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
else
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🟢 Dry Publish Passed" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/push_check_publish_dry_run.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
fi
74 changes: 74 additions & 0 deletions .github/workflows/push_check_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Push Test Check

on:
push:
branches:
- '**'
- '!master'

jobs:
push_check_test:

runs-on: self-hosted

steps:
- uses: actions/checkout@v4

- name: Set up Node.js 18
uses: actions/setup-node@v4
with:
node-version: '18.x'

- name: Install Landa Messenger CLI
run: npm install @landamessenger/landa-messenger-api -g

- uses: subosito/flutter-action@v1
with:
channel: 'stable'
flutter-version: '3.24.3'

- run: flutter pub get

- run: flutter test --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/lcov.info

- name: Handle job completion
if: always()
run: |
if [ "${{ job.status }}" == "failure" ]; then
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🔴 Test Failed" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/push_check_test.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
elif [ "${{ job.status }}" == "cancelled" ]; then
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🟠 Test Canceled" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/push_check.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
else
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🟢 Test Passed" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/push_check.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
fi
123 changes: 123 additions & 0 deletions .github/workflows/tag_version_and_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Tag Version and Publish on Push to Master

on:
pull_request:
types:
- closed
branches:
- master

jobs:
tag_version_and_publish:
if: github.event.pull_request.merged == true

runs-on: self-hosted

steps:
- uses: actions/checkout@v4

- name: Read version from pubspec.yml
id: read_version
run: |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create tag
id: create_tag
run: |
# Check if the tag already exists in the remote repository
if git rev-parse "v${{ env.VERSION }}" >/dev/null 2>&1; then
echo "Tag v${{ env.VERSION }} already exists."
else
# Create and push the new tag
git tag "v${{ env.VERSION }}"
git push origin "v${{ env.VERSION }}"
fi
- name: Create release
if: ${{ steps.create_tag.outcome == 'success' }}
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ env.VERSION }}"
name: "${{ github.event.pull_request.title }}"
body: "${{ github.event.pull_request.body }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Handle job completion
if: always()
run: |
if [ "${{ job.status }}" == "failure" ]; then
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🔴 Creation Tag Failed" \
--body "${{ github.repository }}: Tag v${{ env.VERSION }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/tag_version_and_publish.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
elif [ "${{ job.status }}" == "cancelled" ]; then
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🟠 Creation Tag Canceled" \
--body "${{ github.repository }}: Tag v${{ env.VERSION }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/tag_version_and_publish.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
else
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🟢 Creation Tag Passed" \
--body "${{ github.repository }}: Tag v${{ env.VERSION }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/tag_version_and_publish.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
fi
- run: flutter pub get

- run: dart pub publish --dry-run

- run: dart pub publish -f

- name: Handle publish job completion
if: always()
run: |
if [ "${{ job.status }}" == "failure" ]; then
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🔴 Pub Publish Failed" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/tag_version_and_publish.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
elif [ "${{ job.status }}" == "cancelled" ]; then
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🟠 Pub Publish Canceled" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/tag_version_and_publish.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
else
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🟢 Pub Publish Passed" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/landamessenger/firebase_cloud_firestore/actions/workflows/tag_version_and_publish.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
fi

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 5.4.4

* Bump `object` version to `1.2.6`.
* Bump `cloud_firestore` version to `5.4.4`.

## 5.4.0

* Bump `object` version to `1.1.1`.
Expand Down
8 changes: 6 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
analyzer:
errors:
dangling_library_doc_comments: ignore
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
linter:
rules:
avoid_print: false
2 changes: 1 addition & 1 deletion lib/firebase_cloud_firestore.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library firebase_cloud_firestore;
library;

export 'package:cloud_firestore/cloud_firestore.dart';
export 'package:object/object.dart';
Expand Down
8 changes: 6 additions & 2 deletions lib/src/fire/firestore_collection_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,13 @@ class FirestoreCollectionManager<T extends object.Object<T>>
* Execute callbacks
*/
if (removed.isNotEmpty) await deletionCallback?.call(removed, page);
if (changed.isNotEmpty)
if (changed.isNotEmpty) {
await callback?.call(
changed, page, collectionPages[page]?.hasMore ?? false);
changed,
page,
collectionPages[page]?.hasMore ?? false,
);
}
}

Future<void> nextCollectionPage({
Expand Down
Loading

0 comments on commit 3879234

Please sign in to comment.