Compare commits

...

2 Commits

Author SHA1 Message Date
Ian VanSchooten 1a968bffb4
Update GitHub actions (#188)
We had some old GitHub actions that were using old node versions. This updates them, removes some that have been archived/deprecated, and fixes caching of go dependencies.
2024-10-25 11:55:16 -04:00
Ian VanSchooten 1ea8438a5d
Add Sentry for error tracking (#189) 2024-10-25 08:53:07 -04:00
9 changed files with 102 additions and 54 deletions

View File

@ -21,7 +21,9 @@ jobs:
flutter-version: '3.24.1'
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
show-progress: false
- name: Check formating
run: dart format -l120 lib/ --set-exit-if-changed --suppress-analytics --output none

View File

@ -14,15 +14,16 @@ jobs:
name: Run gofmt
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
show-progress: false
- name: Set up Go 1.22
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.22"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
cache-dependency-path: nebula/go.sum
- name: Install goimports
working-directory: nebula

View File

@ -11,12 +11,18 @@ jobs:
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
show-progress: false
- name: Set up Go 1.22
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.22"
cache-dependency-path: nebula/go.sum
- uses: actions/setup-java@v2
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
@ -26,9 +32,6 @@ jobs:
with:
flutter-version: '3.24.1'
- name: Check out code
uses: actions/checkout@v3
- name: Install the appstore connect key material
env:
AC_API_KEY_SECRET_BASE64: ${{ secrets.AC_API_KEY_SECRET_BASE64 }}
@ -95,7 +98,7 @@ jobs:
fi
- name: Collect iOS artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: MobileNebula.ipa
path: ios/MobileNebula.ipa
@ -119,7 +122,7 @@ jobs:
fi
- name: Collect Android artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: MobileNebula.aab
path: build/app/outputs/bundle/release/app-release.aab
@ -138,34 +141,26 @@ jobs:
cd android
fastlane release
- name: Create Release
- name: Rename app bundle
run: |
mv build/app/outputs/bundle/release/app-release.aab \
build/app/outputs/bundle/release/MobileNebula.aab
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
name: Release ${{ github.ref }}
draft: true
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
files: |
build/app/outputs/bundle/release/MobileNebula.aab
ios/MobileNebula.ipa
- name: Upload release Android app
uses: actions/upload-release-asset@v1.0.1
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/app/outputs/bundle/release/app-release.aab
asset_name: MobileNebula.aab
asset_content_type: text/plain
- name: Upload release iOS app
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ios/MobileNebula.ipa
asset_name: MobileNebula.ipa
asset_content_type: text/plain
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}

View File

@ -12,12 +12,18 @@ jobs:
name: Android
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
show-progress: false
- name: Set up Go 1.22
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.22"
cache-dependency-path: nebula/go.sum
- uses: actions/setup-java@v2
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
@ -27,9 +33,6 @@ jobs:
with:
flutter-version: '3.24.1'
- name: Check out code
uses: actions/checkout@v3
- name: install dependencies
env:
TOKEN: ${{ secrets.MACHINE_USER_PAT }}
@ -74,9 +77,9 @@ jobs:
unzip -p build/app/outputs/apk/debug/app-debug.apks universal.apk > build/app/outputs/apk/debug/app-debug.apk
- name: Collect debug apk
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: app-debug.apk
name: MobileNebulaDebug.apk
path: build/app/outputs/apk/debug/app-debug.apk
retention-days: 60
@ -85,19 +88,22 @@ jobs:
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
show-progress: false
- name: Set up Go 1.22
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.22"
cache-dependency-path: nebula/go.sum
- name: Install flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.1'
- name: Check out code
uses: actions/checkout@v3
- name: install dependencies
run: |
go install golang.org/x/mobile/cmd/gomobile@latest

View File

@ -60,6 +60,11 @@ PODS:
- Flutter
- FlutterMacOS
- PromisesObjC (2.4.0)
- Sentry/HybridSDK (8.36.0)
- sentry_flutter (8.9.0):
- Flutter
- FlutterMacOS
- Sentry/HybridSDK (= 8.36.0)
- share_plus (0.0.1):
- Flutter
- SwiftyJSON (5.0.2)
@ -72,6 +77,7 @@ DEPENDENCIES:
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- SwiftyJSON (~> 5.0)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
@ -90,6 +96,7 @@ SPEC REPOS:
- MLKitVision
- nanopb
- PromisesObjC
- Sentry
- SwiftyJSON
EXTERNAL SOURCES:
@ -103,6 +110,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
sentry_flutter:
:path: ".symlinks/plugins/sentry_flutter/ios"
share_plus:
:path: ".symlinks/plugins/share_plus/ios"
url_launcher_ios:
@ -126,6 +135,8 @@ SPEC CHECKSUMS:
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
Sentry: f8374b5415bc38dfb5645941b3ae31230fbeae57
sentry_flutter: 0eb93e5279eb41e2392212afe1ccd2fecb4f8cbe
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
SwiftyJSON: f5b1bf1cd8dd53cd25887ac0eabcfd92301c6a5a
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe

View File

@ -356,11 +356,13 @@
"${BUILT_PRODUCTS_DIR}/GoogleToolboxForMac/GoogleToolboxForMac.framework",
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
"${BUILT_PRODUCTS_DIR}/Sentry/Sentry.framework",
"${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework",
"${BUILT_PRODUCTS_DIR}/file_picker/file_picker.framework",
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
"${BUILT_PRODUCTS_DIR}/package_info_plus/package_info_plus.framework",
"${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework",
"${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework",
"${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework",
"${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework",
);
@ -371,11 +373,13 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleToolboxForMac.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sentry.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_picker.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info_plus.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sentry_flutter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share_plus.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework",
);

View File

@ -11,14 +11,26 @@ import 'package:mobile_nebula/screens/MainScreen.dart';
import 'package:mobile_nebula/screens/EnrollmentScreen.dart';
import 'package:mobile_nebula/services/settings.dart';
import 'package:flutter_web_plugins/url_strategy.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
Future<void> main() async {
usePathUrlStrategy();
await SentryFlutter.init(
(options) {
options.dsn = 'https://96106df405ade3f013187dfc8e4200e7@o920269.ingest.us.sentry.io/4508132321001472';
// Capture all traces. May need to adjust if overwhelming
options.tracesSampleRate = 1.0;
// For each trace, capture all profiles
options.profilesSampleRate = 1.0;
},
appRunner: () => runApp(Main()),
);
// or define SENTRY_DSN via Dart environment variable (--dart-define)
}
//TODO: EventChannel might be better than the stream controller we are using now
void main() {
usePathUrlStrategy();
runApp(Main());
}
class Main extends StatelessWidget {
// This widget is the root of your application.
@override

View File

@ -352,6 +352,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.0"
sentry:
dependency: transitive
description:
name: sentry
sha256: "033287044a6644a93498969449d57c37907e56f5cedb17b88a3ff20a882261dd"
url: "https://pub.dev"
source: hosted
version: "8.9.0"
sentry_flutter:
dependency: "direct main"
description:
name: sentry_flutter
sha256: "3780b5a0bb6afd476857cfbc6c7444d969c29a4d9bd1aa5b6960aa76c65b737a"
url: "https://pub.dev"
source: hosted
version: "8.9.0"
share_plus:
dependency: "direct main"
description:

View File

@ -33,6 +33,7 @@ dependencies:
flutter_svg: ^2.0.10+1
intl: ^0.19.0
share_plus: ^10.0.2
sentry_flutter: ^8.9.0
mobile_scanner: ^5.2.2
dev_dependencies: