mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-07-04 13:10:42 +00:00
Compare commits
No commits in common. "2128e7c2e96f59c591abd4aeaab6b4cf11883126" and "778755871372d4df2f98afa2ca8eec8b79ff898a" have entirely different histories.
2128e7c2e9
...
7787558713
9 changed files with 230 additions and 219 deletions
99
.github/workflows/build_apk.yml
vendored
99
.github/workflows/build_apk.yml
vendored
|
@ -3,73 +3,29 @@
|
||||||
# separate terms of service, privacy policy, and support
|
# separate terms of service, privacy policy, and support
|
||||||
# documentation.
|
# documentation.
|
||||||
|
|
||||||
name: Build Android
|
name: Build .apk
|
||||||
|
|
||||||
run-name: Build Android (${{ inputs.binary-type == 'apk' && '.apk' || '.aab' }}) v${{ inputs.version }}
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: "Version"
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
binary-type:
|
|
||||||
description: "Binary type"
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
flavor:
|
|
||||||
description: "Flavor"
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
include-iap:
|
|
||||||
type: boolean
|
|
||||||
description: Include IAP package
|
|
||||||
default: true
|
|
||||||
stage-backend:
|
|
||||||
type: boolean
|
|
||||||
description: Use stage backend
|
|
||||||
default: true
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
|
||||||
description: "Version"
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
binary-type:
|
|
||||||
description: "Binary type"
|
|
||||||
type: choice
|
|
||||||
required: true
|
|
||||||
options:
|
|
||||||
- apk
|
|
||||||
- appbundle
|
|
||||||
flavor:
|
flavor:
|
||||||
description: "Flavor"
|
description: 'Flavor'
|
||||||
type: choice
|
type: choice
|
||||||
required: true
|
required: true
|
||||||
options:
|
options:
|
||||||
- dev
|
- dev
|
||||||
- prod
|
- prod
|
||||||
default: dev
|
default: 'dev'
|
||||||
include-iap:
|
include-iap:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: Include IAP package
|
description: Include IAP package
|
||||||
default: true
|
default: true
|
||||||
stage-backend:
|
|
||||||
type: boolean
|
|
||||||
description: Use stage backend
|
|
||||||
default: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
BUILD_ARGS: --release --flavor ${{ inputs.flavor }} -t lib/main_${{ inputs.flavor }}.dart
|
|
||||||
BUILD_APK_PATH: build/app/outputs/flutter-apk/app-${{ inputs.flavor }}-release.apk
|
|
||||||
BUILD_AAB_PATH: build/app/outputs/bundle/${{ inputs.flavor }}Release/app-${{ inputs.flavor }}-release.aab
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-android:
|
build:
|
||||||
name: Build ${{ inputs.binary-type == 'apk' && '.apk' || '.aab' }}
|
name: Build .apk
|
||||||
runs-on: macos-11
|
runs-on: macos-11
|
||||||
timeout-minutes: 30
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
@ -85,35 +41,42 @@ jobs:
|
||||||
if: ${{ !inputs.include-iap }}
|
if: ${{ !inputs.include-iap }}
|
||||||
run: bash ./.github/scripts/stub_iap.sh
|
run: bash ./.github/scripts/stub_iap.sh
|
||||||
|
|
||||||
- uses: actions/setup-java@v3
|
- uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
distribution: "zulu"
|
distribution: "zulu"
|
||||||
java-version: "11"
|
java-version: "11"
|
||||||
|
|
||||||
- name: Restore Android keystore .jsk and .properties files
|
- name: Restore Android keystore .jsk and .properties files
|
||||||
|
env:
|
||||||
|
KEYSTORE: ${{ secrets.KEYSTORE }}
|
||||||
|
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
|
||||||
run: |
|
run: |
|
||||||
bash .github/scripts/restore_from_base64.sh "${{ secrets.KEYSTORE_PROPERTIES }}" "android/key.properties"
|
KEYSTORE_PATH=$RUNNER_TEMP/keystore.jks
|
||||||
bash .github/scripts/restore_from_base64.sh "${{ secrets.KEYSTORE }}" "android/app/keystore.jks"
|
echo -n "$KEYSTORE" | base64 --decode --output $KEYSTORE_PATH
|
||||||
|
cp $KEYSTORE_PATH ./android/app
|
||||||
|
KEYSTORE_PROPERTIES_PATH=$RUNNER_TEMP/key.properties
|
||||||
|
echo -n "$KEYSTORE_PROPERTIES" | base64 --decode --output $KEYSTORE_PROPERTIES_PATH
|
||||||
|
cp $KEYSTORE_PROPERTIES_PATH ./android
|
||||||
|
|
||||||
- name: Restore google-services.json
|
- name: Restore android/app/google-services.json
|
||||||
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.GOOGLE_SERVICES_JSON_ANDROID }}" "android/app/google-services.json"
|
env:
|
||||||
|
GOOGLE_SERVICES_JSON_ANDROID: ${{ secrets.GOOGLE_SERVICES_JSON_ANDROID }}
|
||||||
|
run: |
|
||||||
|
GOOGLE_SERVICES_JSON_ANDROID_PATH=$RUNNER_TEMP/google-services.json
|
||||||
|
echo -n "$GOOGLE_SERVICES_JSON_ANDROID" | base64 --decode --output $GOOGLE_SERVICES_JSON_ANDROID_PATH
|
||||||
|
cp $GOOGLE_SERVICES_JSON_ANDROID_PATH ./android/app
|
||||||
|
|
||||||
- name: Restore firebase_options.dart
|
- name: Restore firebase_options.dart
|
||||||
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart"
|
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart"
|
||||||
|
|
||||||
- name: Restore constants.dart
|
- name: Restore constants.dart
|
||||||
env:
|
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.CONSTANTS }}" "lib/constants.dart"
|
||||||
CONSTANTS: ${{inputs.stage-backend && secrets.CONSTANTS_STAGE || secrets.CONSTANTS }}
|
|
||||||
run: bash .github/scripts/restore_from_base64.sh "${{ env.CONSTANTS }}" "lib/constants.dart"
|
|
||||||
|
|
||||||
- name: Increment build number & replace version number
|
|
||||||
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
|
|
||||||
|
|
||||||
- name: Install Flutter
|
- name: Install Flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: "stable"
|
channel: "stable"
|
||||||
flutter-version: "3.10.0"
|
flutter-version: '3.10.0'
|
||||||
|
|
||||||
- name: Prepare flutter project
|
- name: Prepare flutter project
|
||||||
run: |
|
run: |
|
||||||
|
@ -121,11 +84,13 @@ jobs:
|
||||||
flutter pub get
|
flutter pub get
|
||||||
flutter pub run intl_utils:generate
|
flutter pub run intl_utils:generate
|
||||||
|
|
||||||
- name: Build ${{ inputs.binary-type }}
|
- name: Build .apk
|
||||||
run: flutter build ${{ inputs.binary-type }} $BUILD_ARGS
|
env:
|
||||||
|
FLAVOR: ${{ github.event.inputs.flavor }}
|
||||||
|
run: flutter build apk --release --flavor $FLAVOR -t lib/main_$FLAVOR.dart
|
||||||
|
|
||||||
- name: Upload ${{ inputs.binary-type }} to artifacts
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: m3_lightmeter_${{ inputs.binary-type }}
|
name: m3_lightmeter_${{ github.event.inputs.flavor }}_apk
|
||||||
path: ${{ inputs.binary-type == 'apk' && env.BUILD_APK_PATH || env.BUILD_AAB_PATH }}
|
path: build/app/outputs/flutter-apk/app-${{ github.event.inputs.flavor }}-release.apk
|
||||||
|
|
50
.github/workflows/build_ipa.yml
vendored
50
.github/workflows/build_ipa.yml
vendored
|
@ -3,39 +3,10 @@
|
||||||
# separate terms of service, privacy policy, and support
|
# separate terms of service, privacy policy, and support
|
||||||
# documentation.
|
# documentation.
|
||||||
|
|
||||||
name: Build iOS
|
name: Build Prod .ipa
|
||||||
|
|
||||||
run-name: Build iOS v${{ inputs.version }}
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: "Version"
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
include-iap:
|
|
||||||
type: boolean
|
|
||||||
description: Include IAP package
|
|
||||||
default: true
|
|
||||||
stage-backend:
|
|
||||||
type: boolean
|
|
||||||
description: Use stage backend
|
|
||||||
default: true
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: "Version"
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
include-iap:
|
|
||||||
type: boolean
|
|
||||||
description: Include IAP package
|
|
||||||
default: true
|
|
||||||
stage-backend:
|
|
||||||
type: boolean
|
|
||||||
description: Use stage backend
|
|
||||||
default: true
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FLAVOR: "prod"
|
FLAVOR: "prod"
|
||||||
|
@ -43,7 +14,7 @@ env:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build .ipa
|
name: Build .ipa
|
||||||
runs-on: macos-13
|
runs-on: macos-11
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -84,25 +55,14 @@ jobs:
|
||||||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
||||||
cp $PROVISION_PATH ~/Library/MobileDevice/Provisioning\ Profiles
|
cp $PROVISION_PATH ~/Library/MobileDevice/Provisioning\ Profiles
|
||||||
|
|
||||||
- name: Restore GoogleService-Info.plist
|
- name: Restore ios/Runner/ExportOptions.plist
|
||||||
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.GOOGLE_SERVICES_JSON_IOS }}" "ios/Runner/GoogleService-Info.plist"
|
|
||||||
|
|
||||||
- name: Restore ExportOptions.plist
|
|
||||||
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.APP_STORE_EXPORT_OPTIONS }}" "ios/Runner/ExportOptions.plist"
|
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.APP_STORE_EXPORT_OPTIONS }}" "ios/Runner/ExportOptions.plist"
|
||||||
|
|
||||||
- name: Restore firebase_app_id_file.json
|
|
||||||
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_APP_ID_FILE }}" "ios/firebase_app_id_file.json"
|
|
||||||
|
|
||||||
- name: Restore firebase_options.dart
|
- name: Restore firebase_options.dart
|
||||||
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart"
|
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart"
|
||||||
|
|
||||||
- name: Restore constants.dart
|
- name: Restore constants.dart
|
||||||
env:
|
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.CONSTANTS }}" "lib/constants.dart"
|
||||||
CONSTANTS: ${{inputs.stage-backend && secrets.CONSTANTS_STAGE || secrets.CONSTANTS }}
|
|
||||||
run: bash .github/scripts/restore_from_base64.sh "${{ env.CONSTANTS }}" "lib/constants.dart"
|
|
||||||
|
|
||||||
- name: Increment build number & replace version number
|
|
||||||
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
|
|
||||||
|
|
||||||
- name: Install Flutter
|
- name: Install Flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
|
@ -127,7 +87,7 @@ jobs:
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: m3_lightmeter_ipa
|
name: m3_lightmeter_$FLAVOR_ipa
|
||||||
path: build/ios/ipa/lightmeter.ipa
|
path: build/ios/ipa/lightmeter.ipa
|
||||||
|
|
||||||
- name: Clean up keychain and provisioning profile
|
- name: Clean up keychain and provisioning profile
|
||||||
|
|
208
.github/workflows/create_release.yml
vendored
208
.github/workflows/create_release.yml
vendored
|
@ -3,6 +3,7 @@
|
||||||
# separate terms of service, privacy policy, and support
|
# separate terms of service, privacy policy, and support
|
||||||
# documentation.
|
# documentation.
|
||||||
|
|
||||||
|
|
||||||
# This workflow uses perl regex. For better syntaxis understading see these docs:
|
# This workflow uses perl regex. For better syntaxis understading see these docs:
|
||||||
# https://perldoc.perl.org/perlrequick#Search-and-replace
|
# https://perldoc.perl.org/perlrequick#Search-and-replace
|
||||||
# https://perldoc.perl.org/perlre#Other-Modifiers
|
# https://perldoc.perl.org/perlre#Other-Modifiers
|
||||||
|
@ -22,47 +23,116 @@ on:
|
||||||
description: "Release notes"
|
description: "Release notes"
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
run-integration-tests:
|
github-release:
|
||||||
description: "Run integration tests"
|
|
||||||
required: true
|
|
||||||
type: boolean
|
type: boolean
|
||||||
|
description: Create Github release
|
||||||
|
default: true
|
||||||
|
google-play-release:
|
||||||
|
type: boolean
|
||||||
|
description: Create Google Play release
|
||||||
|
default: true
|
||||||
|
include-iap:
|
||||||
|
type: boolean
|
||||||
|
description: Include IAP package
|
||||||
default: true
|
default: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
BUILD_ARGS: --release --flavor prod -t lib/main_prod.dart
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-integration-tests:
|
build:
|
||||||
name: Run integration tests
|
name: Build .apk & .aab
|
||||||
if: ${{ inputs.run-integration-tests }}
|
if: ${{ inputs.github-release || inputs.google-play-release }}
|
||||||
uses: ./.github/workflows/run_integration_tests.yml
|
runs-on: macos-11
|
||||||
secrets: inherit
|
timeout-minutes: 30
|
||||||
|
steps:
|
||||||
build-android:
|
- uses: actions/checkout@v3
|
||||||
name: Build Android
|
|
||||||
needs: [run-integration-tests]
|
|
||||||
if: ${{ always() && !failure() && !cancelled() }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
binary-type: [apk, appbundle]
|
|
||||||
uses: ./.github/workflows/build_apk.yml
|
|
||||||
secrets: inherit
|
|
||||||
with:
|
with:
|
||||||
binary-type: ${{ matrix.binary-type }}
|
submodules: recursive
|
||||||
flavor: prod
|
|
||||||
stage-backend: false
|
|
||||||
version: ${{ inputs.version }}
|
|
||||||
|
|
||||||
build-ios:
|
- name: Connect private iap package
|
||||||
name: Build iOS
|
uses: webfactory/ssh-agent@v0.8.0
|
||||||
needs: [run-integration-tests]
|
if: ${{ inputs.include-iap }}
|
||||||
if: ${{ always() && !failure() && !cancelled() }}
|
|
||||||
uses: ./.github/workflows/build_ipa.yml
|
|
||||||
secrets: inherit
|
|
||||||
with:
|
with:
|
||||||
stage-backend: false
|
ssh-private-key: ${{ secrets.M3_LIGHTMETER_IAP_KEY }}
|
||||||
version: ${{ inputs.version }}
|
|
||||||
|
- name: Override iap package with stub
|
||||||
|
if: ${{ !inputs.include-iap }}
|
||||||
|
run: bash ./.github/scripts/stub_iap.sh
|
||||||
|
|
||||||
|
- uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
distribution: "zulu"
|
||||||
|
java-version: "11"
|
||||||
|
|
||||||
|
- name: Restore Android keystore .jsk and .properties files
|
||||||
|
env:
|
||||||
|
KEYSTORE: ${{ secrets.KEYSTORE }}
|
||||||
|
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
|
||||||
|
run: |
|
||||||
|
KEYSTORE_PATH=$RUNNER_TEMP/keystore.jks
|
||||||
|
echo -n "$KEYSTORE" | base64 --decode --output $KEYSTORE_PATH
|
||||||
|
cp $KEYSTORE_PATH ./android/app
|
||||||
|
KEYSTORE_PROPERTIES_PATH=$RUNNER_TEMP/key.properties
|
||||||
|
echo -n "$KEYSTORE_PROPERTIES" | base64 --decode --output $KEYSTORE_PROPERTIES_PATH
|
||||||
|
cp $KEYSTORE_PROPERTIES_PATH ./android
|
||||||
|
|
||||||
|
- name: Restore android/app/google-services.json
|
||||||
|
env:
|
||||||
|
GOOGLE_SERVICES_JSON_ANDROID: ${{ secrets.GOOGLE_SERVICES_JSON_ANDROID }}
|
||||||
|
run: |
|
||||||
|
GOOGLE_SERVICES_JSON_ANDROID_PATH=$RUNNER_TEMP/google-services.json
|
||||||
|
echo -n "$GOOGLE_SERVICES_JSON_ANDROID" | base64 --decode --output $GOOGLE_SERVICES_JSON_ANDROID_PATH
|
||||||
|
cp $GOOGLE_SERVICES_JSON_ANDROID_PATH ./android/app
|
||||||
|
|
||||||
|
- name: Restore firebase_options.dart
|
||||||
|
run: 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"
|
||||||
|
|
||||||
|
# This step makes sense when Github release is enabled because this release increments the build number.
|
||||||
|
# Therefore here we have to increment it as well to build an apk with the same build number.
|
||||||
|
- name: Increment build number & replace version number
|
||||||
|
if: ${{ inputs.github-release }}
|
||||||
|
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
|
||||||
|
|
||||||
|
- name: Install Flutter
|
||||||
|
uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
channel: "stable"
|
||||||
|
flutter-version: '3.10.0'
|
||||||
|
|
||||||
|
- name: Prepare flutter project
|
||||||
|
run: |
|
||||||
|
flutter --version
|
||||||
|
flutter pub get
|
||||||
|
flutter pub run intl_utils:generate
|
||||||
|
|
||||||
|
- name: Build apk
|
||||||
|
if: ${{ inputs.github-release }}
|
||||||
|
run: flutter build apk $BUILD_ARGS
|
||||||
|
|
||||||
|
- name: Upload apk to artifacts
|
||||||
|
if: ${{ inputs.github-release }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: m3_lightmeter_apk
|
||||||
|
path: build/app/outputs/flutter-apk/app-prod-release.apk
|
||||||
|
|
||||||
|
- name: Build appbundle
|
||||||
|
if: ${{ inputs.google-play-release }}
|
||||||
|
run: flutter build appbundle $BUILD_ARGS
|
||||||
|
|
||||||
|
- name: Upload app bundle to artifacts
|
||||||
|
if: ${{ inputs.google-play-release }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: m3_lightmeter_bundle
|
||||||
|
path: build/app/outputs/bundle/prodRelease/app-prod-release.aab
|
||||||
|
|
||||||
generate-release-notes:
|
generate-release-notes:
|
||||||
name: Generate release notes
|
name: Generate release notes
|
||||||
needs: [build-android, build-ios]
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Generate release notes
|
- name: Generate release notes
|
||||||
|
@ -76,22 +146,16 @@ jobs:
|
||||||
name: whatsnew-en-US
|
name: whatsnew-en-US
|
||||||
path: whatsnew-en-US.md
|
path: whatsnew-en-US.md
|
||||||
|
|
||||||
create-github-release:
|
update-version-in-repo:
|
||||||
name: Create Github release
|
name: Update repo version
|
||||||
needs: [generate-release-notes]
|
if: ${{ inputs.github-release }}
|
||||||
|
needs: [build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Download apk
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: m3_lightmeter_apk
|
|
||||||
|
|
||||||
- name: Increment build number & replace version number
|
- name: Increment build number & replace version number
|
||||||
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
|
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
|
||||||
|
|
||||||
|
@ -109,6 +173,19 @@ jobs:
|
||||||
branch: ${{ github.ref_name }}
|
branch: ${{ github.ref_name }}
|
||||||
unprotect_reviews: true
|
unprotect_reviews: true
|
||||||
|
|
||||||
|
create-github-release:
|
||||||
|
name: Create Github release
|
||||||
|
if: ${{ inputs.github-release }}
|
||||||
|
needs: [build, generate-release-notes, update-version-in-repo]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- name: Download apk
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: m3_lightmeter_apk
|
||||||
|
|
||||||
- name: Rename apk
|
- name: Rename apk
|
||||||
run: mv app-prod-release.apk m3_lightmeter.apk
|
run: mv app-prod-release.apk m3_lightmeter.apk
|
||||||
|
|
||||||
|
@ -124,9 +201,15 @@ jobs:
|
||||||
tag: "v${{ github.event.inputs.version }}"
|
tag: "v${{ github.event.inputs.version }}"
|
||||||
bodyFile: "whatsnew-en-US.md"
|
bodyFile: "whatsnew-en-US.md"
|
||||||
|
|
||||||
|
- name: Delete apk artifact
|
||||||
|
uses: geekyeggo/delete-artifact@v2
|
||||||
|
with:
|
||||||
|
name: m3_lightmeter_apk
|
||||||
|
|
||||||
create-google-play-release:
|
create-google-play-release:
|
||||||
name: Create Google Play release
|
name: Create Google Play release
|
||||||
needs: [generate-release-notes]
|
if: ${{ inputs.google-play-release }}
|
||||||
|
needs: [build, generate-release-notes]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -136,7 +219,7 @@ jobs:
|
||||||
- name: Download app bundle
|
- name: Download app bundle
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: m3_lightmeter_appbundle
|
name: m3_lightmeter_bundle
|
||||||
|
|
||||||
- name: Extract & zip merged_native_libs
|
- name: Extract & zip merged_native_libs
|
||||||
run: |
|
run: |
|
||||||
|
@ -175,36 +258,31 @@ jobs:
|
||||||
debugSymbols: merged_native_libs.zip
|
debugSymbols: merged_native_libs.zip
|
||||||
whatsNewDirectory: whatsnew
|
whatsNewDirectory: whatsnew
|
||||||
|
|
||||||
upload-to-app-store:
|
# https://docs.github.com/en/actions/learn-github-actions/expressions#failure-with-conditions
|
||||||
name: Upload to App Store
|
- name: Zip app bundle and merged_native_libs
|
||||||
needs: [generate-release-notes]
|
if: ${{ failure() && steps.create-google-play-release-step.conclusion == 'failure' }}
|
||||||
runs-on: macos-13
|
run: zip m3_lightmeter_release.zip app-prod-release.aab merged_native_libs.zip
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Download ipa
|
- name: Upload release zip to artifacts
|
||||||
uses: actions/download-artifact@v3
|
if: ${{ failure() && steps.create-google-play-release-step.conclusion == 'failure' }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: m3_lightmeter_ipa
|
name: m3_lightmeter_release
|
||||||
|
path: m3_lightmeter_release.zip
|
||||||
|
|
||||||
- name: Upload app to TestFlight
|
- name: Delete app bundle & merged native libs artifacts
|
||||||
run: xcrun altool --upload-app -f lightmeter.ipa -t ios -u ${{ secrets.APP_STORE_USERNAME }} -p ${{ secrets.APP_STORE_PASSWORD }}
|
if: ${{ always() }}
|
||||||
|
uses: geekyeggo/delete-artifact@v2
|
||||||
|
with:
|
||||||
|
name: m3_lightmeter_bundle
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
name: Cleanup
|
name: Cleanup
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
needs:
|
needs: [create-github-release, create-google-play-release]
|
||||||
[create-github-release, create-google-play-release, upload-to-app-store]
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Delete release artifacts
|
- name: Delete release notes artifact
|
||||||
uses: geekyeggo/delete-artifact@v2
|
uses: geekyeggo/delete-artifact@v2
|
||||||
with:
|
with:
|
||||||
failOnError: false
|
name: whatsnew-en-US
|
||||||
name: |
|
|
||||||
m3_lightmeter_apk
|
|
||||||
m3_lightmeter_appbundle
|
|
||||||
m3_lightmeter_ipa
|
|
||||||
whatsnew-en-US
|
|
||||||
|
|
1
.github/workflows/run_integration_tests.yml
vendored
1
.github/workflows/run_integration_tests.yml
vendored
|
@ -20,6 +20,7 @@ jobs:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Override iap package with stub
|
- name: Override iap package with stub
|
||||||
|
id: override-iap
|
||||||
run: bash ./.github/scripts/stub_iap.sh
|
run: bash ./.github/scripts/stub_iap.sh
|
||||||
|
|
||||||
- name: Restore secrets
|
- name: Restore secrets
|
||||||
|
|
|
@ -54,10 +54,10 @@ class IAPProducts extends InheritedModel<IAPProductType> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool updateShouldNotify(IAPProducts oldWidget) => true;
|
bool updateShouldNotify(IAPProducts oldWidget) => false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool updateShouldNotifyDependent(IAPProducts oldWidget, Set<IAPProductType> dependencies) => true;
|
bool updateShouldNotifyDependent(IAPProducts oldWidget, Set<IAPProductType> dependencies) => false;
|
||||||
|
|
||||||
IAPProduct? _findProduct(IAPProductType type) {
|
IAPProduct? _findProduct(IAPProductType type) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -399,9 +399,11 @@
|
||||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
CODE_SIGN_STYLE = Manual;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = 489Z6UQMGN;
|
DEVELOPMENT_TEAM = "";
|
||||||
|
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 489Z6UQMGN;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = Lightmeter;
|
INFOPLIST_KEY_CFBundleDisplayName = Lightmeter;
|
||||||
|
@ -413,6 +415,7 @@
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.vodemn.lightmeter;
|
PRODUCT_BUNDLE_IDENTIFIER = com.vodemn.lightmeter;
|
||||||
PRODUCT_NAME = Lightmeter;
|
PRODUCT_NAME = Lightmeter;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Lightmeter Development";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
@ -534,36 +537,7 @@
|
||||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
|
||||||
DEVELOPMENT_TEAM = 489Z6UQMGN;
|
|
||||||
ENABLE_BITCODE = NO;
|
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = Lightmeter;
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"@executable_path/Frameworks",
|
|
||||||
);
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.vodemn.lightmeter;
|
|
||||||
PRODUCT_NAME = Lightmeter;
|
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
|
||||||
SWIFT_VERSION = 5.0;
|
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
|
||||||
};
|
|
||||||
name = "Debug-prod";
|
|
||||||
};
|
|
||||||
97C147071CF9000F007C117D /* Release-prod */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
|
||||||
buildSettings = {
|
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-prod";
|
|
||||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
|
||||||
CLANG_ENABLE_MODULES = YES;
|
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Manual;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
|
@ -579,7 +553,39 @@
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.vodemn.lightmeter;
|
PRODUCT_BUNDLE_IDENTIFIER = com.vodemn.lightmeter;
|
||||||
PRODUCT_NAME = Lightmeter;
|
PRODUCT_NAME = Lightmeter;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Lightmeter Distribution";
|
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Lightmeter Development";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
};
|
||||||
|
name = "Debug-prod";
|
||||||
|
};
|
||||||
|
97C147071CF9000F007C117D /* Release-prod */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-prod";
|
||||||
|
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
CODE_SIGN_STYLE = Manual;
|
||||||
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
DEVELOPMENT_TEAM = "";
|
||||||
|
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 489Z6UQMGN;
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
INFOPLIST_KEY_CFBundleDisplayName = Lightmeter;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.vodemn.lightmeter;
|
||||||
|
PRODUCT_NAME = Lightmeter;
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Lightmeter Development";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
|
|
@ -20,7 +20,7 @@ import 'package:lightmeter/screens/metering/components/camera_container/state_co
|
||||||
import 'package:lightmeter/screens/metering/components/shared/ev_source_base/bloc_base_ev_source.dart';
|
import 'package:lightmeter/screens/metering/components/shared/ev_source_base/bloc_base_ev_source.dart';
|
||||||
import 'package:lightmeter/utils/ev_from_bytes.dart';
|
import 'package:lightmeter/utils/ev_from_bytes.dart';
|
||||||
|
|
||||||
part 'mock_bloc_container_camera.part.dart';
|
part 'mock_bloc_container_camera.dart';
|
||||||
|
|
||||||
class CameraContainerBloc extends EvSourceBlocBase<CameraContainerEvent, CameraContainerState> {
|
class CameraContainerBloc extends EvSourceBlocBase<CameraContainerEvent, CameraContainerState> {
|
||||||
final MeteringInteractor _meteringInteractor;
|
final MeteringInteractor _meteringInteractor;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
flutter test --coverage
|
flutter test --coverage
|
||||||
|
flutter test integration_test --flavor=dev --coverage
|
||||||
|
|
||||||
file=test/coverage_helper_test.dart
|
file=test/coverage_helper_test.dart
|
||||||
echo "// Helper file to make coverage work for all dart files\n" > $file
|
echo "// Helper file to make coverage work for all dart files\n" > $file
|
||||||
|
|
Loading…
Reference in a new issue