From f49130db8a657a1e25a77653ec41dd7add2624da Mon Sep 17 00:00:00 2001 From: Sivan Ratson <89018301+Sivan22@users.noreply.github.com> Date: Wed, 4 Sep 2024 20:21:18 +0300 Subject: [PATCH 01/10] Update dart.yml --- .github/workflows/dart.yml | 45 +++----------------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 3383c717..dc0d96e1 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -1,42 +1,3 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Dart - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - # Note: This workflow uses the latest stable version of the Dart SDK. - # You can specify other versions if desired, see documentation here: - # https://github.com/dart-lang/setup-dart/blob/main/README.md - # - uses: dart-lang/setup-dart@v1 - - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 - - - name: Install dependencies - run: dart pub get - - # Uncomment this step to verify the use of 'dart format' on each commit. - # - name: Verify formatting - # run: dart format --output=none --set-exit-if-changed . - - # Consider passing '--fatal-infos' for slightly stricter analysis. - - name: Analyze project source - run: dart analyze - - # Your project will need to have tests in test/ and a dependency on - # package:test for this step to succeed. Note that Flutter projects will - # want to change this to 'flutter test'. - - name: Run tests - run: dart test +- name: Flutter action + uses: subosito/flutter-action@v2.16.0 + From c148814d12971c9e9b154f047cc860d4110fe295 Mon Sep 17 00:00:00 2001 From: Sivan Ratson <89018301+Sivan22@users.noreply.github.com> Date: Wed, 4 Sep 2024 20:39:54 +0300 Subject: [PATCH 02/10] Update dart.yml --- .github/workflows/dart.yml | 124 ++++++++++++++++++++++++++++++++++++- 1 file changed, 121 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index dc0d96e1..bc5d07d5 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -1,3 +1,121 @@ -- name: Flutter action - uses: subosito/flutter-action@v2.16.0 - +name: Set up Flutter +description: Setup your runner with Flutter environment +author: Alif Rachmawadi +branding: + icon: maximize + color: blue + +inputs: + channel: + description: The Flutter build release channel + required: false + default: stable + flutter-version: + description: The Flutter version to make available on the path + required: false + default: "" + flutter-version-file: + description: The pubspec.yaml file with exact Flutter version defined + required: false + default: "" + architecture: + description: The architecture of Flutter SDK executable (x64 or arm64) + required: false + default: "${{ runner.arch }}" + cache: + description: Cache the Flutter SDK + required: false + default: "false" + cache-key: + description: Identifier for the Flutter SDK cache + required: false + default: "" + cache-path: + description: Flutter SDK cache path + required: false + default: "" + pub-cache-key: + description: Identifier for the Dart .pub-cache cache + required: false + default: "" + pub-cache-path: + description: Flutter pub cache path + required: false + default: default + dry-run: + description: If true, get outputs but do not install Flutter + required: false + default: "false" + +outputs: + CHANNEL: + value: "${{ steps.flutter-action.outputs.CHANNEL }}" + description: The selected Flutter release channel + VERSION: + value: "${{ steps.flutter-action.outputs.VERSION }}" + description: The selected Flutter version + ARCHITECTURE: + value: "${{ steps.flutter-action.outputs.ARCHITECTURE }}" + description: The selected Flutter CPU architecture + CACHE-KEY: + value: "${{ steps.flutter-action.outputs.CACHE-KEY }}" + description: Key used to cache the Flutter SDK + CACHE-PATH: + value: "${{ steps.flutter-action.outputs.CACHE-PATH }}" + description: Path to Flutter SDK + PUB-CACHE-KEY: + value: "${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}" + description: Key used to cache the pub dependencies + PUB-CACHE-PATH: + value: "${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}" + description: Path to pub cache + +runs: + using: composite + steps: + - name: Make setup script executable + run: chmod +x "$GITHUB_ACTION_PATH/setup.sh" + shell: bash + + - name: Set action inputs + id: flutter-action + shell: bash + run: | + $GITHUB_ACTION_PATH/setup.sh -p \ + -n '${{ inputs.flutter-version }}' \ + -f '${{ inputs.flutter-version-file }}' \ + -a '${{ inputs.architecture }}' \ + -k '${{ inputs.cache-key }}' \ + -c '${{ inputs.cache-path }}' \ + -l '${{ inputs.pub-cache-key }}' \ + -d '${{ inputs.pub-cache-path }}' \ + ${{ inputs.channel }} + + - name: Cache Flutter + uses: actions/cache@v4 + if: ${{ inputs.cache == 'true' }} + with: + path: ${{ steps.flutter-action.outputs.CACHE-PATH }} + key: ${{ steps.flutter-action.outputs.CACHE-KEY }} + restore-keys: | + ${{ steps.flutter-action.outputs.CACHE-KEY }} + + - name: Cache pub dependencies + uses: actions/cache@v4 + if: ${{ inputs.cache == 'true' }} + with: + path: ${{ steps.flutter-action.outputs.PUB-CACHE-PATH }} + key: ${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }} + restore-keys: | + ${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }} + ${{ steps.flutter-action.outputs.PUB-CACHE-KEY }} + + - name: Run setup script + shell: bash + if: ${{ inputs.dry-run != 'true' && inputs.dry-run != true }} + run: | + $GITHUB_ACTION_PATH/setup.sh \ + -n '${{ steps.flutter-action.outputs.VERSION }}' \ + -a '${{ steps.flutter-action.outputs.ARCHITECTURE }}' \ + -c '${{ steps.flutter-action.outputs.CACHE-PATH }}' \ + ${{ steps.flutter-action.outputs.CHANNEL }} From 25f530a9598f4a18a83d8ae4fb7700da1a9bcb11 Mon Sep 17 00:00:00 2001 From: Sivan Ratson <89018301+Sivan22@users.noreply.github.com> Date: Wed, 4 Sep 2024 20:40:26 +0300 Subject: [PATCH 03/10] Rename dart.yml to flutter.yml --- .github/workflows/{dart.yml => flutter.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{dart.yml => flutter.yml} (100%) diff --git a/.github/workflows/dart.yml b/.github/workflows/flutter.yml similarity index 100% rename from .github/workflows/dart.yml rename to .github/workflows/flutter.yml From d3b11bf7c6072e01cb34cea5700cba734bc5b1e2 Mon Sep 17 00:00:00 2001 From: Sivan Ratson <89018301+Sivan22@users.noreply.github.com> Date: Wed, 4 Sep 2024 20:45:07 +0300 Subject: [PATCH 04/10] Update flutter.yml --- .github/workflows/flutter.yml | 135 ++++------------------------------ 1 file changed, 15 insertions(+), 120 deletions(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index bc5d07d5..6a50cded 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -1,121 +1,16 @@ -name: Set up Flutter -description: Setup your runner with Flutter environment -author: Alif Rachmawadi -branding: - icon: maximize - color: blue +- name: Flutter action + uses: subosito/flutter-action@v2.16.0 -inputs: - channel: - description: The Flutter build release channel - required: false - default: stable - flutter-version: - description: The Flutter version to make available on the path - required: false - default: "" - flutter-version-file: - description: The pubspec.yaml file with exact Flutter version defined - required: false - default: "" - architecture: - description: The architecture of Flutter SDK executable (x64 or arm64) - required: false - default: "${{ runner.arch }}" - cache: - description: Cache the Flutter SDK - required: false - default: "false" - cache-key: - description: Identifier for the Flutter SDK cache - required: false - default: "" - cache-path: - description: Flutter SDK cache path - required: false - default: "" - pub-cache-key: - description: Identifier for the Dart .pub-cache cache - required: false - default: "" - pub-cache-path: - description: Flutter pub cache path - required: false - default: default - dry-run: - description: If true, get outputs but do not install Flutter - required: false - default: "false" - -outputs: - CHANNEL: - value: "${{ steps.flutter-action.outputs.CHANNEL }}" - description: The selected Flutter release channel - VERSION: - value: "${{ steps.flutter-action.outputs.VERSION }}" - description: The selected Flutter version - ARCHITECTURE: - value: "${{ steps.flutter-action.outputs.ARCHITECTURE }}" - description: The selected Flutter CPU architecture - CACHE-KEY: - value: "${{ steps.flutter-action.outputs.CACHE-KEY }}" - description: Key used to cache the Flutter SDK - CACHE-PATH: - value: "${{ steps.flutter-action.outputs.CACHE-PATH }}" - description: Path to Flutter SDK - PUB-CACHE-KEY: - value: "${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}" - description: Key used to cache the pub dependencies - PUB-CACHE-PATH: - value: "${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}" - description: Path to pub cache - -runs: - using: composite - steps: - - name: Make setup script executable - run: chmod +x "$GITHUB_ACTION_PATH/setup.sh" - shell: bash - - - name: Set action inputs - id: flutter-action - shell: bash - run: | - $GITHUB_ACTION_PATH/setup.sh -p \ - -n '${{ inputs.flutter-version }}' \ - -f '${{ inputs.flutter-version-file }}' \ - -a '${{ inputs.architecture }}' \ - -k '${{ inputs.cache-key }}' \ - -c '${{ inputs.cache-path }}' \ - -l '${{ inputs.pub-cache-key }}' \ - -d '${{ inputs.pub-cache-path }}' \ - ${{ inputs.channel }} - - - name: Cache Flutter - uses: actions/cache@v4 - if: ${{ inputs.cache == 'true' }} - with: - path: ${{ steps.flutter-action.outputs.CACHE-PATH }} - key: ${{ steps.flutter-action.outputs.CACHE-KEY }} - restore-keys: | - ${{ steps.flutter-action.outputs.CACHE-KEY }} - - - name: Cache pub dependencies - uses: actions/cache@v4 - if: ${{ inputs.cache == 'true' }} - with: - path: ${{ steps.flutter-action.outputs.PUB-CACHE-PATH }} - key: ${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }} - restore-keys: | - ${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }} - ${{ steps.flutter-action.outputs.PUB-CACHE-KEY }} - - - name: Run setup script - shell: bash - if: ${{ inputs.dry-run != 'true' && inputs.dry-run != true }} - run: | - $GITHUB_ACTION_PATH/setup.sh \ - -n '${{ steps.flutter-action.outputs.VERSION }}' \ - -a '${{ steps.flutter-action.outputs.ARCHITECTURE }}' \ - -c '${{ steps.flutter-action.outputs.CACHE-PATH }}' \ - ${{ steps.flutter-action.outputs.CHANNEL }} +jobs: + main: + runs-on: windows-latest + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + - run: flutter build windows + + From c9c1d261c7b6a3d6ab76754bec9aa4914f3bde39 Mon Sep 17 00:00:00 2001 From: Sivan Ratson <89018301+Sivan22@users.noreply.github.com> Date: Wed, 4 Sep 2024 21:08:00 +0300 Subject: [PATCH 05/10] Update flutter.yml added all the content to build for the different platforms --- .github/workflows/flutter.yml | 61 +++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 6a50cded..3abc882e 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -1,8 +1,11 @@ -- name: Flutter action - uses: subosito/flutter-action@v2.16.0 +name: 'Build for all platforms' + +on: + workflow_dispatch + jobs: - main: + build_windows: runs-on: windows-latest steps: - name: Clone repository @@ -12,5 +15,57 @@ jobs: with: channel: stable - run: flutter build windows + + build_linux: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + - run: | + sudo apt-get update -y + sudo apt-get install -y ninja-build libgtk-3-dev + - run: flutter build linux + + build_android: + runs-on: windows-latest + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + - run: flutter pub get + - run: flutter test + - run: flutter build apk + - run: flutter build appbundle + + build_macos: + runs-on: macos-latest + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + - run: flutter build macos + + build_ios: + runs-on: macos-latest + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + - run: flutter pub get + - run: flutter test + - run: flutter build ios --release --no-codesign From 8b0bb4f4b252715daa1df199c3197acf4e9410b6 Mon Sep 17 00:00:00 2001 From: Sivan Ratson <89018301+Sivan22@users.noreply.github.com> Date: Wed, 4 Sep 2024 21:25:18 +0300 Subject: [PATCH 06/10] Update flutter.yml added uploading the artifact for windows. --- .github/workflows/flutter.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 3abc882e..63bc302c 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -15,6 +15,12 @@ jobs: with: channel: stable - run: flutter build windows + - run: dart run msix:create + - name: Upload windows build + uses: actions/upload-artifact@v4 + with: + name: otzaria.msix + path: build/windows/x64/runner/release/otzaria.msix build_linux: runs-on: ubuntu-latest From 7253f1fdd05168b6b8b26f1b7b73e0d52b257622 Mon Sep 17 00:00:00 2001 From: Sivan Ratson <89018301+Sivan22@users.noreply.github.com> Date: Wed, 4 Sep 2024 21:26:59 +0300 Subject: [PATCH 07/10] temp --- .github/workflows/flutter.yml | 54 +---------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 63bc302c..f0648131 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -22,56 +22,4 @@ jobs: name: otzaria.msix path: build/windows/x64/runner/release/otzaria.msix - build_linux: - runs-on: ubuntu-latest - steps: - - name: Clone repository - uses: actions/checkout@v4 - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - channel: stable - - run: | - sudo apt-get update -y - sudo apt-get install -y ninja-build libgtk-3-dev - - run: flutter build linux - - build_android: - runs-on: windows-latest - steps: - - name: Clone repository - uses: actions/checkout@v4 - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - channel: stable - - run: flutter pub get - - run: flutter test - - run: flutter build apk - - run: flutter build appbundle - - build_macos: - runs-on: macos-latest - steps: - - name: Clone repository - uses: actions/checkout@v4 - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - channel: stable - - run: flutter build macos - - build_ios: - runs-on: macos-latest - steps: - - name: Clone repository - uses: actions/checkout@v4 - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - channel: stable - - run: flutter pub get - - run: flutter test - - run: flutter build ios --release --no-codesign - - + From c4d3ef9e791941700b494c26dc567e1c61a68b43 Mon Sep 17 00:00:00 2001 From: Sivan Ratson <89018301+Sivan22@users.noreply.github.com> Date: Wed, 4 Sep 2024 21:33:03 +0300 Subject: [PATCH 08/10] Update flutter.yml --- .github/workflows/flutter.yml | 60 +++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index f0648131..5736b0fe 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -14,6 +14,7 @@ jobs: uses: subosito/flutter-action@v2 with: channel: stable + cache: true - run: flutter build windows - run: dart run msix:create - name: Upload windows build @@ -22,4 +23,63 @@ jobs: name: otzaria.msix path: build/windows/x64/runner/release/otzaria.msix + build_linux: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + cache: true + - run: | + sudo apt-get update -y + sudo apt-get install -y ninja-build libgtk-3-dev + - run: flutter build linux + + build_android: + runs-on: windows-latest + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + cache: true + - run: flutter pub get + - run: flutter test + - run: flutter build apk + - run: flutter build appbundle + + build_macos: + runs-on: macos-latest + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + cache: true + - run: flutter build macos + + build_ios: + runs-on: macos-latest + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + cache: true + - run: flutter pub get + - run: flutter test + - run: flutter build ios --release --no-codesign + + + + From 5e773699816d0cc8a65e7b4f595f5255092cbcca Mon Sep 17 00:00:00 2001 From: Sivan Ratson <89018301+Sivan22@users.noreply.github.com> Date: Wed, 4 Sep 2024 21:34:55 +0300 Subject: [PATCH 09/10] Update flutter.yml delete run build windows --- .github/workflows/flutter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 5736b0fe..c476c14c 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -15,7 +15,6 @@ jobs: with: channel: stable cache: true - - run: flutter build windows - run: dart run msix:create - name: Upload windows build uses: actions/upload-artifact@v4 @@ -37,6 +36,7 @@ jobs: sudo apt-get update -y sudo apt-get install -y ninja-build libgtk-3-dev - run: flutter build linux + build_android: runs-on: windows-latest From a655e02b37f4bf846b4008344974dafddaa3dc79 Mon Sep 17 00:00:00 2001 From: Sivan Ratson <89018301+Sivan22@users.noreply.github.com> Date: Thu, 5 Sep 2024 06:53:42 +0300 Subject: [PATCH 10/10] Update flutter.yml --- .github/workflows/flutter.yml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index c476c14c..6d101db9 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -34,8 +34,15 @@ jobs: cache: true - run: | sudo apt-get update -y - sudo apt-get install -y ninja-build libgtk-3-dev + sudo apt-get install -y ninja-build libgtk-3-0 libblkid1 liblzma5 - run: flutter build linux + - name: zip the bundle + - run: zip -r otzaria-linux.zip build/linux/release/bundle + - name: Upload linux build + uses: actions/upload-artifact@v4 + with: + name: otzaria-linux.zip + path: otzaria-linux.zip build_android: @@ -52,6 +59,11 @@ jobs: - run: flutter test - run: flutter build apk - run: flutter build appbundle + - name: Upload apk + uses: actions/upload-artifact@v4 + with: + name: otzaria-android.apk + path: build/app/outputs/flutter-apk/app-release.apk build_macos: runs-on: macos-latest @@ -64,6 +76,13 @@ jobs: channel: stable cache: true - run: flutter build macos + - name: Upload macos build + uses: actions/upload-artifact@v4 + with: + name: otzaria-macos.app + path: build/macos/Build/Products/Release/otzaria.app + + build_ios: runs-on: macos-latest @@ -78,6 +97,15 @@ jobs: - run: flutter pub get - run: flutter test - run: flutter build ios --release --no-codesign + - name: Upload iphone build + uses: actions/upload-artifact@v4 + with: + name: otzaria-iphone.app + path: build/ios/iphoneos/Runner.app + + + +