From 94b1a7b3a6628375a89ed7e16422af56f2426034 Mon Sep 17 00:00:00 2001 From: Codefarmer Date: Mon, 23 Sep 2024 11:19:20 +0100 Subject: [PATCH 1/4] chore: set screen util to 5.9.1 --- packages/catalog/lib/main.dart | 14 ++++++++++++++ packages/catalog/pubspec.lock | 4 ++-- packages/cave/pubspec.yaml | 2 +- packages/conferenceapp/pubspec.lock | 4 ++-- packages/volunteerapp/pubspec.lock | 4 ++-- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/packages/catalog/lib/main.dart b/packages/catalog/lib/main.dart index beedfc3..6947284 100644 --- a/packages/catalog/lib/main.dart +++ b/packages/catalog/lib/main.dart @@ -17,6 +17,20 @@ class WidgetbookApp extends StatelessWidget { return Widgetbook.material( directories: directories, addons: [ + BuilderAddon( + name: 'ScreenUtil', + builder: (context, child) { + return ScreenUtilInit( + designSize: const Size(430, 956), + minTextAdapt: true, + splitScreenMode: true, + // This is needed to use the workbench [MediaQuery] + useInheritedMediaQuery: true, + builder: (context, child) => child!, + child: child, + ); + }, + ), DeviceFrameAddon( devices: [ DeviceInfo.genericPhone( diff --git a/packages/catalog/pubspec.lock b/packages/catalog/pubspec.lock index d74b896..23a4e35 100644 --- a/packages/catalog/pubspec.lock +++ b/packages/catalog/pubspec.lock @@ -270,10 +270,10 @@ packages: dependency: transitive description: name: flutter_screenutil - sha256: "8239210dd68bee6b0577aa4a090890342d04a136ce1c81f98ee513fc0ce891de" + sha256: b372c35a772a1dc84142a3b9c5ee89a390834bd258e5e6a450d9b975b985d1c9 url: "https://pub.dev" source: hosted - version: "5.9.3" + version: "5.9.1" flutter_shaders: dependency: transitive description: diff --git a/packages/cave/pubspec.yaml b/packages/cave/pubspec.yaml index bc38b33..cf6873d 100644 --- a/packages/cave/pubspec.yaml +++ b/packages/cave/pubspec.yaml @@ -14,7 +14,7 @@ dependencies: flutter: sdk: flutter flutter_animate: ^4.5.0 - flutter_screenutil: ^5.9.3 + flutter_screenutil: 5.9.1 flutter_svg: ^2.0.10+1 dev_dependencies: diff --git a/packages/conferenceapp/pubspec.lock b/packages/conferenceapp/pubspec.lock index 396d877..1696d33 100644 --- a/packages/conferenceapp/pubspec.lock +++ b/packages/conferenceapp/pubspec.lock @@ -177,10 +177,10 @@ packages: dependency: transitive description: name: flutter_screenutil - sha256: "8239210dd68bee6b0577aa4a090890342d04a136ce1c81f98ee513fc0ce891de" + sha256: b372c35a772a1dc84142a3b9c5ee89a390834bd258e5e6a450d9b975b985d1c9 url: "https://pub.dev" source: hosted - version: "5.9.3" + version: "5.9.1" flutter_shaders: dependency: transitive description: diff --git a/packages/volunteerapp/pubspec.lock b/packages/volunteerapp/pubspec.lock index c977381..66226eb 100644 --- a/packages/volunteerapp/pubspec.lock +++ b/packages/volunteerapp/pubspec.lock @@ -161,10 +161,10 @@ packages: dependency: transitive description: name: flutter_screenutil - sha256: "8239210dd68bee6b0577aa4a090890342d04a136ce1c81f98ee513fc0ce891de" + sha256: b372c35a772a1dc84142a3b9c5ee89a390834bd258e5e6a450d9b975b985d1c9 url: "https://pub.dev" source: hosted - version: "5.9.3" + version: "5.9.1" flutter_shaders: dependency: transitive description: From e3e1335f359387d8aa01e304f4fa379404e340d9 Mon Sep 17 00:00:00 2001 From: Codefarmer Date: Mon, 23 Sep 2024 11:19:45 +0100 Subject: [PATCH 2/4] chore: disable ios ci --- .github/workflows/conferenceapp.yaml | 22 ++-- .github/workflows/shared-workflow.yaml | 154 ++++++++++++++++++++----- .github/workflows/volunteerapp.yaml | 22 ++-- 3 files changed, 154 insertions(+), 44 deletions(-) diff --git a/.github/workflows/conferenceapp.yaml b/.github/workflows/conferenceapp.yaml index 0c5fa10..bf4220f 100644 --- a/.github/workflows/conferenceapp.yaml +++ b/.github/workflows/conferenceapp.yaml @@ -11,6 +11,12 @@ on: changelog: description: 'Changelog for this release' required: true + build-version: + description: 'Version number for the release' + required: true + build-number: + description: 'Build number for the release' + required: true jobs: check-formatting: @@ -26,14 +32,16 @@ jobs: package-name: conferenceapp android-build: true changelog: ${{ github.event.inputs.changelog }} + build-number: ${{ github.event.inputs.build-number }} + build-version: ${{ github.event.inputs.build-version }} secrets: FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} - ios-build: - if: github.event_name == 'workflow_dispatch' - uses: ./.github/workflows/shared-workflow.yaml - with: - package-name: conferenceapp - ios-build: true - changelog: ${{ github.event.inputs.changelog }} + # ios-build: + # if: github.event_name == 'workflow_dispatch' + # uses: ./.github/workflows/shared-workflow.yaml + # with: + # package-name: conferenceapp + # ios-build: true + # changelog: ${{ github.event.inputs.changelog }} diff --git a/.github/workflows/shared-workflow.yaml b/.github/workflows/shared-workflow.yaml index fdaaa3e..e18ff7b 100644 --- a/.github/workflows/shared-workflow.yaml +++ b/.github/workflows/shared-workflow.yaml @@ -21,11 +21,31 @@ on: description: 'Changelog for the release' required: false type: string + build-version: + description: 'Version number for the release' + required: false + default: '1.0.0' + type: string + build-number: + description: 'Build number for the release' + required: false + default: '1' + type: string secrets: - FIREBASE_TOKEN: + CREDENTIAL_FILE_CONTENT: required: false FIREBASE_APP_ID: required: false + # APP_STORE_CONNECT_ISSUER_ID: + # required: false + # APP_STORE_CONNECT_KEY_IDENTIFIER: + # required: false + # APP_STORE_CONNECT_PRIVATE_KEY: + # required: false + # CERTIFICATE_PRIVATE_KEY: + # required: false + # SSH_PRIVATE_KEY: + # required: false jobs: check-formatting: @@ -39,13 +59,15 @@ jobs: with: flutter-version: '3.24.3' - - name: Cache dependencies - uses: actions/cache@v3 + - name: Cache Flutter dependencies + uses: actions/cache@v4 with: path: | ~/.pub-cache packages/${{ inputs['package-name'] }}/.dart_tool key: ${{ runner.os }}-pub-${{ hashFiles('packages/${{ inputs["package-name"] }}/pubspec.yaml') }} + restore-keys: | + ${{ runner.os }}-pub- - name: Install dependencies run: flutter pub get @@ -65,6 +87,32 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + + - name: Setup Java 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'temurin' + + - name: Cache Flutter dependencies + uses: actions/cache@v4 + with: + path: | + ~/.pub-cache + packages/${{ inputs['package-name'] }}/.dart_tool + key: ${{ runner.os }}-pub-${{ hashFiles('packages/${{ inputs["package-name"] }}/pubspec.yaml') }} + restore-keys: | + ${{ runner.os }}-pub- + + - name: Cache Gradle dependencies + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- - name: Set up Flutter uses: subosito/flutter-action@v2 @@ -76,40 +124,86 @@ jobs: working-directory: packages/${{ inputs['package-name'] }} - name: Build Android - run: flutter build apk --release + run: flutter build apk --release --build-name=${{ inputs.build-version }} --build-number=${{ inputs.build-number }} working-directory: packages/${{ inputs['package-name'] }} - name: Deploy Android to Firebase uses: wzieba/Firebase-Distribution-Github-Action@v1 with: appId: ${{ secrets.FIREBASE_APP_ID }} - token: ${{ secrets.FIREBASE_TOKEN }} + serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} groups: testers file: packages/${{ inputs['package-name'] }}/build/app/outputs/flutter-apk/app-release.apk releaseNotes: ${{ inputs.changelog }} - ios-build: - if: inputs.ios-build == 'true' - runs-on: macos-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - flutter-version: '3.24.3' - - - name: Install dependencies - run: flutter pub get - working-directory: packages/${{ inputs['package-name'] }} - - - name: Build iOS - run: flutter build ios --release - working-directory: packages/${{ inputs['package-name'] }} - - - name: Deploy iOS to TestFlight - uses: actions/upload-artifact@v3 - with: - path: packages/${{ inputs['package-name'] }}/build/ios/ipa/*.ipa - releaseNotes: ${{ inputs.changelog }} + # ios-build: + # if: inputs.ios-build == 'true' + # runs-on: macos-latest + # steps: + # - name: Checkout repository + # uses: actions/checkout@v3 + + # - name: Cache CocoaPods dependencies + # uses: actions/cache@v3 + # with: + # path: | + # ~/.cocoapods + # ios/Pods + # key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} + # restore-keys: | + # ${{ runner.os }}-pods- + + # - name: Cache Flutter dependencies + # uses: actions/cache@v3 + # with: + # path: | + # ~/.pub-cache + # packages/${{ inputs['package-name'] }}/.dart_tool + # key: ${{ runner.os }}-pub-${{ hashFiles('packages/${{ inputs["package-name"] }}/pubspec.yaml') }} + # restore-keys: | + # ${{ runner.os }}-pub- + + # - name: Set up Flutter + # uses: subosito/flutter-action@v2 + # with: + # flutter-version: '3.24.3' + + # - name: Install dependencies + # run: flutter pub get + # working-directory: packages/${{ inputs['package-name'] }} + + # - name: Install Codemagic CLI tools + # run: pip install codemagic-cli-tools + # working-directory: packages/${{ inputs['package-name'] }} + + # - name: Set up keychain + # run: keychain initialize + # working-directory: packages/${{ inputs['package-name'] }} + + # - name: Fetch signing files from App Store Connect + # run: | + # app-store-connect fetch-signing-files $(xcode-project detect-bundle-id) \ + # --type IOS_APP_STORE \ + # --create + # working-directory: packages/${{ inputs['package-name'] }} + + # - name: Set up signing certificate in keychain + # run: keychain add-certificates + # working-directory: packages/${{ inputs['package-name'] }} + + # - name: Set up code signing in Xcode project + # run: xcode-project use-profiles + # working-directory: packages/${{ inputs['package-name'] }} + + # - name: Build iOS + # run: flutter build ipa --export-options-plist=$HOME/export_options.plist --build-name=${{ inputs.build-version }} --build-number=${{ inputs.build-number }} + # working-directory: packages/${{ inputs['package-name'] }} + + # - name: Deploy iOS to Firebase + # uses: wzieba/Firebase-Distribution-Github-Action@v1 + # with: + # appId: ${{ secrets.FIREBASE_APP_ID }} + # serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} + # groups: testers + # file: packages/${{ inputs['package-name'] }}/build/ios/ipa/*.ipa + # releaseNotes: ${{ inputs.changelog }} diff --git a/.github/workflows/volunteerapp.yaml b/.github/workflows/volunteerapp.yaml index 3721ad5..993653e 100644 --- a/.github/workflows/volunteerapp.yaml +++ b/.github/workflows/volunteerapp.yaml @@ -11,6 +11,12 @@ on: changelog: description: 'Changelog for this release' required: true + build-version: + description: 'Version number for the release' + required: true + build-number: + description: 'Build number for the release' + required: true jobs: check-formatting: @@ -26,14 +32,16 @@ jobs: package-name: volunteerapp android-build: true changelog: ${{ github.event.inputs.changelog }} + build-number: ${{ github.event.inputs.build-number }} + build-version: ${{ github.event.inputs.build-version }} secrets: FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} - ios-build: - if: github.event_name == 'workflow_dispatch' - uses: ./.github/workflows/shared-workflow.yaml - with: - package-name: volunteerapp - ios-build: true - changelog: ${{ github.event.inputs.changelog }} + # ios-build: + # if: github.event_name == 'workflow_dispatch' + # uses: ./.github/workflows/shared-workflow.yaml + # with: + # package-name: volunteerapp + # ios-build: true + # changelog: ${{ github.event.inputs.changelog }} From 4f9b5b48a0d0cb7412008a1a0d91522725625371 Mon Sep 17 00:00:00 2001 From: Codefarmer Date: Mon, 23 Sep 2024 11:26:17 +0100 Subject: [PATCH 3/4] fix: fix ci --- .github/workflows/conferenceapp.yaml | 2 +- .github/workflows/shared-workflow.yaml | 27 ++++++++++++++++++++++++++ .github/workflows/volunteerapp.yaml | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conferenceapp.yaml b/.github/workflows/conferenceapp.yaml index bf4220f..b4963f8 100644 --- a/.github/workflows/conferenceapp.yaml +++ b/.github/workflows/conferenceapp.yaml @@ -35,7 +35,7 @@ jobs: build-number: ${{ github.event.inputs.build-number }} build-version: ${{ github.event.inputs.build-version }} secrets: - FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} + CREDENTIAL_FILE_CONTENT: ${{ secrets.CREDENTIAL_FILE_CONTENT }} FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} # ios-build: diff --git a/.github/workflows/shared-workflow.yaml b/.github/workflows/shared-workflow.yaml index e18ff7b..c18270b 100644 --- a/.github/workflows/shared-workflow.yaml +++ b/.github/workflows/shared-workflow.yaml @@ -68,6 +68,15 @@ jobs: key: ${{ runner.os }}-pub-${{ hashFiles('packages/${{ inputs["package-name"] }}/pubspec.yaml') }} restore-keys: | ${{ runner.os }}-pub- + + - name: Enable melos + run: dart pub global activate melos + + - name: Get packages + run: melos bootstrap + + - name: Generate Files + run: melos generate - name: Install dependencies run: flutter pub get @@ -118,6 +127,15 @@ jobs: uses: subosito/flutter-action@v2 with: flutter-version: '3.24.3' + + - name: Enable melos + run: dart pub global activate melos + + - name: Get packages + run: melos bootstrap + + - name: Generate Files + run: melos generate - name: Install dependencies run: flutter pub get @@ -168,6 +186,15 @@ jobs: # with: # flutter-version: '3.24.3' + # - name: Enable melos + # run: dart pub global activate melos + + # - name: Get packages + # run: melos bootstrap + + # - name: Generate Files + # run: melos generate + # - name: Install dependencies # run: flutter pub get # working-directory: packages/${{ inputs['package-name'] }} diff --git a/.github/workflows/volunteerapp.yaml b/.github/workflows/volunteerapp.yaml index 993653e..65a0465 100644 --- a/.github/workflows/volunteerapp.yaml +++ b/.github/workflows/volunteerapp.yaml @@ -35,7 +35,7 @@ jobs: build-number: ${{ github.event.inputs.build-number }} build-version: ${{ github.event.inputs.build-version }} secrets: - FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} + CREDENTIAL_FILE_CONTENT: ${{ secrets.CREDENTIAL_FILE_CONTENT }} FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} # ios-build: From 0646797587af4f5ec92ec479e61ba534a69838a6 Mon Sep 17 00:00:00 2001 From: Codefarmer Date: Mon, 23 Sep 2024 11:29:38 +0100 Subject: [PATCH 4/4] fix: catalog ci --- .github/workflows/catalog.yaml | 11 ++++++++--- .github/workflows/shared-workflow.yaml | 8 -------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/catalog.yaml b/.github/workflows/catalog.yaml index 9c3b104..cb56ca7 100644 --- a/.github/workflows/catalog.yaml +++ b/.github/workflows/catalog.yaml @@ -30,9 +30,14 @@ jobs: packages/catalog/.dart_tool key: ${{ runner.os }}-pub-${{ hashFiles('packages/catalog/pubspec.yaml') }} - - name: Install dependencies - run: flutter pub get - working-directory: packages/catalog + - name: Enable melos + run: dart pub global activate melos + + - name: Get packages + run: melos bootstrap + + - name: Generate Files + run: melos generate - name: Build Web run: flutter build web diff --git a/.github/workflows/shared-workflow.yaml b/.github/workflows/shared-workflow.yaml index c18270b..89780e3 100644 --- a/.github/workflows/shared-workflow.yaml +++ b/.github/workflows/shared-workflow.yaml @@ -78,10 +78,6 @@ jobs: - name: Generate Files run: melos generate - - name: Install dependencies - run: flutter pub get - working-directory: packages/${{ inputs['package-name'] }} - - name: Check formatting run: dart format --set-exit-if-changed . working-directory: packages/${{ inputs['package-name'] }} @@ -137,10 +133,6 @@ jobs: - name: Generate Files run: melos generate - - name: Install dependencies - run: flutter pub get - working-directory: packages/${{ inputs['package-name'] }} - - name: Build Android run: flutter build apk --release --build-name=${{ inputs.build-version }} --build-number=${{ inputs.build-number }} working-directory: packages/${{ inputs['package-name'] }}