Compare commits

..

81 commits

Author SHA1 Message Date
Vadim
c40bcf51f5 increased jvm heap 2025-01-21 19:20:37 +01:00
Vadim
368b143674 fixed inputs naming 2025-01-21 15:50:38 +01:00
Vadim
110bf425ca added build checks to PR checks 2025-01-21 15:38:18 +01:00
Vadim
f9ceb61350 allow to skip release to one of the stores 2025-01-21 12:31:34 +01:00
Vadim
752b231447 Merge branch 'main' of https://github.com/vodemn/m3_lightmeter into cd 2025-01-21 12:14:58 +01:00
Vadim
9cf8be55fa build apk with latest macos runner 2024-07-28 18:45:31 +02:00
Vadim
3e5e409121 Merge branch 'main' of https://github.com/vodemn/m3_lightmeter into cd 2024-07-28 18:43:28 +02:00
Vadim
078312c03f reduce integration tests timeout 2024-03-17 19:58:14 +01:00
Vadim
e3306ab3ba fixed integration tests 2024-03-17 18:58:47 +01:00
Vadim
17c454e4c6 delete all artifacts after the run 2024-03-17 17:00:08 +01:00
Vadim
bffa598493 delete ipa after upload 2024-03-17 16:55:01 +01:00
Vadim
e376391529 increased integration tests timeout 2024-03-17 16:43:27 +01:00
Vadim
411ec927a9 fixed integration tests 2024-03-17 15:24:16 +01:00
Vadim
8e03d3e400 disable pre-release integration tests by default 2024-03-17 13:23:10 +01:00
Vadim
a01924ab19 typo 2024-03-17 10:19:57 +01:00
Vadim
667f95662e reverted temporary settings 2024-03-17 10:18:07 +01:00
Vadim
2e6495d2db auth with username + password 2024-03-17 09:44:55 +01:00
Vadim
4874dd3368 Update create_release.yml 2024-03-16 23:03:51 +01:00
Vadim
be456a9a8f decode to repo 2024-03-16 21:10:15 +01:00
Vadim
7870138bfd switched to ubuntu for upload 2024-03-16 20:37:57 +01:00
Vadim
58565162eb try manual ipa upload 2024-03-16 20:09:40 +01:00
Vadim
ba0ed69d18 removed flavor from ipa artefact name 2024-03-16 18:12:00 +01:00
Vadim
4c46cc444c try to force ipa upload 2024-03-16 17:43:10 +01:00
Vadim
b61ed93a88 typo 2024-03-16 11:30:24 +01:00
Vadim
1dbcf27cf9 test ipa upload 2024-03-16 11:29:07 +01:00
Vadim
2fb3bdb970 upload ipa to app store 2024-03-16 11:27:46 +01:00
Vadim
257403455c increment build number for ios 2024-03-16 11:27:36 +01:00
Vadim
7fa781f4ca enabled releases 2024-03-15 08:34:19 +01:00
Vadim
f05be2ff39 fixed android folders... 2024-03-14 21:47:47 +01:00
Vadim
d98b2a62ff added option to skip integration tests 2024-03-14 20:54:56 +01:00
Vadim
846a2b2254 enabled integration tests 2024-03-14 20:41:13 +01:00
Vadim
e701d65c4b fixed android keystore path 2024-03-14 20:36:28 +01:00
Vadim
5a8eee10a4 simplified release workflow tree 2024-03-14 20:36:02 +01:00
Vadim
aad833b266 fixed invalid workflow 2024-03-14 20:32:31 +01:00
Vadim
1674d7192e separated android and ios builds 2024-03-14 20:29:36 +01:00
Vadim
14ba91edba style 2024-03-14 20:13:41 +01:00
Vadim
fb94f88401 Restore firebase_app_id_file.json 2024-03-14 20:12:59 +01:00
Vadim
60343d3974 Restore GoogleService-Info.plist 2024-03-14 19:39:08 +01:00
Vadim
ef1a28c1e7 incremented macos runner version 2024-03-14 19:02:38 +01:00
Vadim
e56a8d2500 checkout actions 2024-03-14 17:17:00 +01:00
Vadim
1e84f0dffa typo 2024-03-14 17:15:46 +01:00
Vadim
6ee8e21693 temporary skip tests 2024-03-14 17:14:38 +01:00
Vadim
a690ccfc26 [ios] use distribution profile for release builds 2024-03-14 16:00:15 +01:00
Vadim
ff36f37faa temporeraly skip release jobs 2024-03-14 15:54:34 +01:00
Vadim
682658a283 reuse Build iOS workflow 2024-03-14 15:19:15 +01:00
Vadim
6f0efe4b39 added stage backend option 2024-03-14 15:15:08 +01:00
Vadim
4ed3d4efb9 reuse Build Android workflow 2024-03-14 15:10:18 +01:00
Vadim
f314102c4b run integration tests before build 2024-03-14 15:09:21 +01:00
Vadim
ba9d011fbe Merge branch 'main' of https://github.com/vodemn/m3_lightmeter into cd 2024-03-14 15:08:43 +01:00
Vadim
c852af2855 Merge branch 'main' of https://github.com/vodemn/m3_lightmeter into cd 2024-02-21 13:30:10 +01:00
Vadim
973e8d0426 check PR number 2023-09-20 11:53:30 +02:00
Vadim
8f491de27b depend on step conclusion 2023-09-20 11:47:40 +02:00
Vadim
4493685903 updated stub script to work with tags 2023-09-20 11:40:36 +02:00
Vadim
a46bd98329 Merge branch 'main' of https://github.com/vodemn/m3_lightmeter into cd 2023-09-20 11:37:25 +02:00
Vadim
7b84225f65 stub 2023-09-02 12:29:38 +02:00
Vadim
0b9b72011e fixed iap repo 2023-09-02 12:25:51 +02:00
Vadim
a0d09abcc1 Update increment_build_number.sh 2023-09-02 12:20:12 +02:00
Vadim
5e16dca13a increment build number by script 2023-09-02 12:18:01 +02:00
Vadim
dfb5b55bb6 checkout first 2023-09-02 11:50:48 +02:00
Vadim
3b8a79e25e added comment to stub_iap.sh 2023-09-02 11:50:11 +02:00
Vadim
c2aa7d714b removed working dir 2023-09-02 11:49:01 +02:00
Vadim
8fff0d259f typo 2023-09-02 11:47:03 +02:00
Vadim
5c09ec77d0 typo 2023-09-02 11:44:09 +02:00
Vadim
4248b6d897 typo 2023-09-02 11:40:17 +02:00
Vadim
deedafa236 try using script for iap stub 2023-09-02 11:39:48 +02:00
Vadim
f96572030d Merge branch 'main' of https://github.com/vodemn/m3_lightmeter into cd 2023-09-02 11:36:41 +02:00
Vadim
f8a40af36a renamed other flows 2023-08-05 20:52:57 +02:00
Vadim
515bfcb2da Replaced "Build ..." flow with "Create release" 2023-08-05 20:49:27 +02:00
Vadim
be98e8cf9e Delete no longer used artifacts 2023-08-05 15:41:53 +02:00
Vadim
283bba6ec2 More descriptive run name 2023-08-05 15:33:00 +02:00
Vadim
a7a8fe2a2e Extract merged native libraries 2023-08-04 13:18:10 +02:00
Vadim
2712df4856 Merge branch 'main' of https://github.com/vodemn/m3_lightmeter into cd 2023-08-04 13:17:55 +02:00
Vadim
d8e07bc3c3 Update ci.yml 2023-07-25 17:30:38 +02:00
Vadim
e33db3a600 Build -> Development 2023-07-25 17:29:38 +02:00
Vadim
11aed522a1 Added readable name to ci workflow 2023-07-25 17:26:24 +02:00
Vadim
eed3da320f Update .gitignore 2023-07-25 17:24:04 +02:00
Vadim
fa6bcb3740 Removed rm 2023-07-25 17:20:20 +02:00
Vadim
52d88a4e58 Fixed rm 2023-07-25 17:18:19 +02:00
Vadim
c69f196e1c Added stub DefaultFirebaseOptions 2023-07-25 17:14:51 +02:00
Vadim
6aad6050fc Set exact Flutter version for workflows 2023-07-25 17:09:28 +02:00
Vadim
b6473d10c5 Update README.md 2023-07-25 17:09:03 +02:00
12 changed files with 164 additions and 72 deletions

View file

@ -115,7 +115,7 @@ jobs:
- name: Download release notes
continue-on-error: true
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }}
path: ${{ env.RELEASE_NOTES_PATH }}
@ -136,7 +136,7 @@ jobs:
run: flutter build ${{ inputs.binary-type }} $BUILD_ARGS
- name: Upload ${{ inputs.binary-type }} to artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: m3_lightmeter_${{ inputs.binary-type }}
path: ${{ inputs.binary-type == 'apk' && env.BUILD_APK_PATH || env.BUILD_AAB_PATH }}

View file

@ -108,7 +108,7 @@ jobs:
- name: Download release notes
continue-on-error: true
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }}
path: ${{ env.RELEASE_NOTES_PATH }}
@ -135,7 +135,7 @@ jobs:
--export-options-plist=ios/Runner/ExportOptions.plist
- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: m3_lightmeter_ipa
path: build/ios/ipa/lightmeter.ipa

View file

@ -69,7 +69,7 @@ jobs:
echo ${{ inputs.release-notes }} > ${{ env.RELEASE_NOTES_FILE }}
perl -i -pe 's/\s{1}(-{1})/\n$1/g' ${{ env.RELEASE_NOTES_FILE }}
- name: Upload merged_native_libs.zip to artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }}
path: ${{ env.RELEASE_NOTES_FILE }}
@ -112,24 +112,24 @@ jobs:
submodules: recursive
- name: Download apk
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: m3_lightmeter_apk
- name: Increment build number & replace version number
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
- name: Download release notes
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }}
path: ${{ env.RELEASE_NOTES_PATH }}
- name: Increment build number & replace version number
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
- name: Commit changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add --all -- ":!app-prod-release.apk"
git add -A
git commit -m "Release v${{ inputs.version }}"
- name: Push to main
@ -161,7 +161,7 @@ jobs:
submodules: recursive
- name: Download app bundle
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: m3_lightmeter_appbundle
@ -171,7 +171,7 @@ jobs:
(cd base/lib && zip -r "$OLDPWD/merged_native_libs.zip" .)
- name: Download release notes
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }}
@ -213,7 +213,7 @@ jobs:
submodules: recursive
- name: Download ipa
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: m3_lightmeter_ipa

View file

@ -36,10 +36,8 @@ jobs:
if: steps.fetch-iap.conclusion != 'success'
run: bash ./.github/scripts/stub_iap.sh
- name: Restore secrets
run: |
bash .github/scripts/restore_from_base64.sh "${{ secrets.CONSTANTS }}" "lib/constants.dart"
bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart"
- name: Restore constants.dart
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.CONSTANTS }}" "lib/constants.dart"
- uses: subosito/flutter-action@v2
with:

View file

@ -27,9 +27,8 @@ jobs:
bash .github/scripts/restore_from_base64.sh "${{ secrets.CONSTANTS }}" "lib/constants.dart"
bash .github/scripts/restore_from_base64.sh "${{ secrets.GOOGLE_SERVICES_JSON_IOS }}" "ios/Runner/GoogleService-Info.plist"
bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_APP_ID_FILE }}" "ios/firebase_app_id_file.json"
bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart"
bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_JSON }}" "firebase.json"
- uses: subosito/flutter-action@v2
with:
channel: "stable"

4
.gitignore vendored
View file

@ -58,8 +58,8 @@ keystore.properties
android/app/google-services.json
ios/firebase_app_id_file.json
ios/Runner/GoogleService-Info.plist
lib/firebase_options.dart
lib/constants.dart
/lib/firebase_options.dart
/lib/constants.dart
coverage/
test/coverage_helper_test.dart

View file

@ -1 +0,0 @@
- Performance improvements and bug fixes.

67
lib/firebase_options.dart Normal file
View file

@ -0,0 +1,67 @@
// File generated by FlutterFire CLI.
// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb, TargetPlatform;
/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for web - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}
static const FirebaseOptions android = FirebaseOptions(
apiKey: '',
messagingSenderId: '',
projectId: '',
storageBucket: '',
);
static const FirebaseOptions ios = FirebaseOptions(
apiKey: '',
appId: '',
messagingSenderId: '',
projectId: '',
storageBucket: '',
iosClientId: '',
iosBundleId: '',
);
}

View file

@ -132,7 +132,6 @@ class CameraContainerBloc extends EvSourceBlocBase<CameraContainerEvent, CameraC
await _cameraController!.initialize();
await _cameraController!.setFlashMode(FlashMode.off);
await _cameraController!.lockCaptureOrientation(DeviceOrientation.portraitUp);
_zoomRange = await Future.wait<double>([
_cameraController!.getMinZoomLevel(),

View file

@ -0,0 +1,50 @@
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class CameraView extends StatelessWidget {
final CameraController controller;
const CameraView({required this.controller, super.key});
@override
Widget build(BuildContext context) {
final value = controller.value;
return ValueListenableBuilder<CameraValue>(
valueListenable: controller,
builder: (_, __, Widget? child) => AspectRatio(
aspectRatio: _isLandscape(value) ? value.aspectRatio : (1 / value.aspectRatio),
child: Stack(
children: [
RotatedBox(
quarterTurns: _getQuarterTurns(value),
child: controller.buildPreview(),
),
child ?? const SizedBox(),
],
),
),
);
}
bool _isLandscape(CameraValue value) {
return <DeviceOrientation>[DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]
.contains(_getApplicableOrientation(value));
}
int _getQuarterTurns(CameraValue value) {
final Map<DeviceOrientation, int> turns = <DeviceOrientation, int>{
DeviceOrientation.portraitUp: 0,
DeviceOrientation.landscapeRight: 1,
DeviceOrientation.portraitDown: 2,
DeviceOrientation.landscapeLeft: 3,
};
return turns[_getApplicableOrientation(value)]!;
}
DeviceOrientation _getApplicableOrientation(CameraValue value) {
return value.isRecordingVideo
? value.recordingOrientation!
: (value.previewPauseOrientation ?? value.lockedCaptureOrientation ?? value.deviceOrientation);
}
}

View file

@ -1,17 +1,18 @@
import 'package:camera/camera.dart' as camera;
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:lightmeter/data/models/camera_feature.dart';
import 'package:lightmeter/platform_config.dart';
import 'package:lightmeter/providers/user_preferences_provider.dart';
import 'package:lightmeter/res/dimens.dart';
import 'package:lightmeter/screens/metering/components/camera_container/components/camera_preview/components/camera_spot_detector/widget_camera_spot_detector.dart';
import 'package:lightmeter/screens/metering/components/camera_container/components/camera_preview/components/camera_view/widget_camera_view.dart';
import 'package:lightmeter/screens/metering/components/camera_container/components/camera_preview/components/camera_view_placeholder/widget_placeholder_camera_view.dart';
import 'package:lightmeter/screens/metering/components/camera_container/components/camera_preview/components/histogram/widget_histogram.dart';
import 'package:lightmeter/screens/metering/components/camera_container/models/camera_error_type.dart';
import 'package:lightmeter/utils/context_utils.dart';
class CameraPreview extends StatefulWidget {
final camera.CameraController? controller;
final CameraController? controller;
final CameraErrorType? error;
final ValueChanged<Offset?> onSpotTap;
@ -52,7 +53,7 @@ class _CameraPreviewState extends State<CameraPreview> {
}
class _CameraPreviewBuilder extends StatefulWidget {
final camera.CameraController controller;
final CameraController controller;
final ValueChanged<Offset?> onSpotTap;
const _CameraPreviewBuilder({
@ -96,15 +97,29 @@ class _CameraPreviewBuilderState extends State<_CameraPreviewBuilder> {
}
return ValueListenableBuilder<bool>(
valueListenable: _initializedNotifier,
builder: (context, value, _) => value
? camera.CameraPreview(
widget.controller,
child: context.isPro
? _ProFeaturesOverlay(
controller: widget.controller,
onSpotTap: widget.onSpotTap,
)
: const SizedBox.shrink(),
builder: (context, value, child) => value
? Stack(
alignment: Alignment.bottomCenter,
children: [
CameraView(controller: widget.controller),
if (context.isPro) ...[
if (UserPreferencesProvider.cameraFeatureOf(
context,
CameraFeature.histogram,
))
Positioned(
left: Dimens.grid8,
right: Dimens.grid8,
bottom: Dimens.grid16,
child: CameraHistogram(controller: widget.controller),
),
if (UserPreferencesProvider.cameraFeatureOf(
context,
CameraFeature.spotMetering,
))
CameraSpotDetector(onSpotTap: widget.onSpotTap),
],
],
)
: const SizedBox.shrink(),
);
@ -114,38 +129,3 @@ class _CameraPreviewBuilderState extends State<_CameraPreviewBuilder> {
_initializedNotifier.value = widget.controller.value.isInitialized;
}
}
class _ProFeaturesOverlay extends StatelessWidget {
final camera.CameraController controller;
final ValueChanged<Offset?> onSpotTap;
const _ProFeaturesOverlay({
required this.controller,
required this.onSpotTap,
});
@override
Widget build(BuildContext context) {
final bool hasHistogram = UserPreferencesProvider.cameraFeatureOf(
context,
CameraFeature.histogram,
);
final bool hasSpotMetering = UserPreferencesProvider.cameraFeatureOf(
context,
CameraFeature.histogram,
);
return Stack(
alignment: Alignment.bottomCenter,
children: [
if (hasHistogram)
Positioned(
left: Dimens.grid8,
right: Dimens.grid8,
bottom: Dimens.grid16,
child: CameraHistogram(controller: controller),
),
if (hasSpotMetering) CameraSpotDetector(onSpotTap: onSpotTap),
],
);
}
}

View file

@ -1,7 +1,7 @@
name: lightmeter
description: Lightmeter app inspired by Material 3 design system.
publish_to: "none"
version: 1.0.1+56
version: 1.0.0+55
environment:
sdk: ">=3.0.0 <4.0.0"