Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci-dio-interceptor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI - Dio Interceptor

on:
push:
branches:
- main
paths:
- "packages/posthog_dio_interceptor/**"
- ".github/workflows/ci-dio-interceptor.yml"
pull_request:
paths:
- "packages/posthog_dio_interceptor/**"
- ".github/workflows/ci-dio-interceptor.yml"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- uses: dart-lang/setup-dart@v1
with:
sdk: stable

- name: Install dependencies
run: |
dart pub get
working-directory: ./packages/posthog_dio_interceptor

- name: Check format
run: |
dart format --set-exit-if-changed ./
working-directory: ./packages/posthog_dio_interceptor

- name: Analyze
run: |
dart analyze .
working-directory: ./packages/posthog_dio_interceptor

- name: Run tests
run: |
dart test
working-directory: ./packages/posthog_dio_interceptor
26 changes: 19 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ on:
push:
branches:
- main
paths:
- "packages/posthog_flutter/**"
- ".github/workflows/ci.yml"
- "Makefile"
- "ktlint-baseline.xml"
pull_request:
paths-ignore:
- "**/*.md"
paths:
- "packages/posthog_flutter/**"
- ".github/workflows/ci.yml"
- "Makefile"
- "ktlint-baseline.xml"

# Publish using custom workflow
jobs:
Expand Down Expand Up @@ -35,6 +43,7 @@ jobs:
flutter pub get
cd example
flutter pub get
working-directory: ./packages/posthog_flutter

- name: SDK format check
run: |
Expand All @@ -43,22 +52,25 @@ jobs:
make analyzeDart
make formatKotlin
make formatSwift
working-directory: ./packages/posthog_flutter

- name: Test
run: flutter test
run: |
flutter test
working-directory: ./packages/posthog_flutter

- name: Build iOS
working-directory: ./example
working-directory: ./packages/posthog_flutter/example
run: flutter build ios --simulator --no-codesign

- name: Build macOS
working-directory: ./example
working-directory: ./packages/posthog_flutter/example
run: flutter build macos

- name: Build Android
working-directory: ./example
working-directory: ./packages/posthog_flutter/example
run: flutter build apk

- name: Build Web
working-directory: ./example
working-directory: ./packages/posthog_flutter/example
run: flutter build web
28 changes: 28 additions & 0 deletions .github/workflows/publish-dio-interceptor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish Dio Interceptor to pub.dev

on:
push:
tags:
- 'dio-v[0-9]+.[0-9]+.[0-9]+*' # tag pattern for dio interceptor: eg 'dio-v1.0.0'

jobs:
publish:
permissions:
id-token: write # Required for authentication using OIDC
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- uses: dart-lang/setup-dart@v1
with:
sdk: stable

- name: Install dependencies
run: |
dart pub get
working-directory: ./packages/posthog_dio_interceptor

- name: Publish
run: |
dart pub publish --force
working-directory: ./packages/posthog_dio_interceptor
8 changes: 6 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
with:
channel: 'stable'
- name: Install dependencies
run: flutter pub get
run: |
flutter pub get
working-directory: ./packages/posthog_flutter
- name: Publish
run: flutter pub publish --force
run: |
flutter pub publish --force
working-directory: ./packages/posthog_flutter
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ PublishScripts/
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
**/Packages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ formatKotlin:

# swiftlint ios/Classes --fix conflicts with swiftformat
formatSwift:
swiftformat ios/Classes --swiftversion 5.3
swiftformat packages/posthog_flutter/ios/Classes --swiftversion 5.3

formatDart:
dart format .
Expand Down
7 changes: 0 additions & 7 deletions example/android/app/src/profile/AndroidManifest.xml

This file was deleted.

7 changes: 7 additions & 0 deletions packages/posthog_dio_interceptor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/

# Avoid committing pubspec.lock for library packages; see
# https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock
3 changes: 3 additions & 0 deletions packages/posthog_dio_interceptor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0

- Initial version.
39 changes: 39 additions & 0 deletions packages/posthog_dio_interceptor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.

For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/tools/pub/writing-package-pages).

For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/to/develop-packages).
-->

TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.

## Features

TODO: List what your package can do. Maybe include images, gifs, or videos.

## Getting started

TODO: List prerequisites and provide or point to information on how to
start using the package.

## Usage

TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.

```dart
const like = 'sample';
```

## Additional information

TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.
18 changes: 18 additions & 0 deletions packages/posthog_dio_interceptor/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

linter:
rules:
unnecessary_library_name: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// Support for doing something awesome.
///
/// More dartdocs go here.
library;

export 'src/dio_interceptor.dart';
Loading