diff --git a/.flutter-version b/.flutter-version new file mode 100644 index 000000000..2624404f7 --- /dev/null +++ b/.flutter-version @@ -0,0 +1 @@ +3.41.2 \ No newline at end of file diff --git a/.github/actions/android/action.yml b/.github/actions/android/action.yml index 542de7eba..7b6a752f4 100644 --- a/.github/actions/android/action.yml +++ b/.github/actions/android/action.yml @@ -36,7 +36,7 @@ runs: uses: subosito/flutter-action@v2 with: cache: true - flutter-version-file: pubspec.yaml + flutter-version-file: .flutter-version - name: Build Android APK/AAB shell: bash diff --git a/.github/actions/common/action.yml b/.github/actions/common/action.yml index ba6349e2f..89f70bdfc 100644 --- a/.github/actions/common/action.yml +++ b/.github/actions/common/action.yml @@ -8,7 +8,7 @@ runs: uses: subosito/flutter-action@v2 with: cache: true - flutter-version-file: pubspec.yaml + flutter-version-file: .flutter-version - name: Fetch Flutter Dependencies shell: bash diff --git a/.github/actions/ios/action.yml b/.github/actions/ios/action.yml index 52deb0e14..e8bd990e2 100644 --- a/.github/actions/ios/action.yml +++ b/.github/actions/ios/action.yml @@ -17,7 +17,7 @@ runs: uses: subosito/flutter-action@v2 with: cache: false # TODO set to after https://github.com/actions/runner/issues/449 is fixed - flutter-version-file: pubspec.yaml + flutter-version-file: .flutter-version - name: Update Podfile shell: bash diff --git a/.github/actions/linux-arm64/action.yml b/.github/actions/linux-arm64/action.yml index 872033584..7926355a8 100644 --- a/.github/actions/linux-arm64/action.yml +++ b/.github/actions/linux-arm64/action.yml @@ -2,13 +2,14 @@ name: "Linux ARM64 Workflow" inputs: VERSION_NAME: - description: 'Version Name to be used for build' + description: "Version Name to be used for build" required: false - default: '1.0.0' + default: "1.0.0" + VERSION_CODE: - description: 'Version Code to be used for build' + description: "Version Code to be used for build" required: true - default: '1' + default: "1" runs: using: "composite" @@ -16,45 +17,49 @@ runs: - name: Install dependencies from Apt shell: bash run: | - sudo apt-get update -y; - sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev yq + sudo apt-get update -y + sudo apt-get install -y \ + curl git unzip xz-utils zip libglu1-mesa clang cmake ninja-build \ + pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev - - name: Clone Flutter + - name: Read Flutter version shell: bash run: | - # get Flutter version from pubspec.yaml - FLUTTER_VERSION="$(yq -r '.environment.flutter' pubspec.yaml)" + FLUTTER_VERSION=$(cat .flutter-version) + echo "Using Flutter version: $FLUTTER_VERSION" + echo "FLUTTER_VERSION=$FLUTTER_VERSION" >> $GITHUB_ENV - # Shallow-clone Flutter to reduce download size - git clone --depth 1 --branch $FLUTTER_VERSION https://github.com/flutter/flutter.git $RUNNER_TEMP/flutter - - # Add Flutter to PATH - echo "$RUNNER_TEMP/flutter/bin" >> $GITHUB_PATH + - name: Clone Flutter + shell: bash + run: | + git clone --depth 1 --branch "$FLUTTER_VERSION" https://github.com/flutter/flutter.git "$RUNNER_TEMP/flutter" + echo "$RUNNER_TEMP/flutter/bin" >> "$GITHUB_PATH" - name: Install Flutter shell: bash - # Running "flutter doctor" will download Flutter's dependencies run: flutter doctor - + - name: Build Linux App shell: bash run: | flutter config --enable-linux-desktop source linux/prep.sh - flutter build linux --build-name ${{ inputs.VERSION_NAME }} --build-number ${{ inputs.VERSION_CODE }} + flutter build linux \ + --build-name "${{ inputs.VERSION_NAME }}" \ + --build-number "${{ inputs.VERSION_CODE }}" - name: Install fpm shell: bash run: | sudo apt-get install -y ruby ruby-dev build-essential sudo gem install --no-document fpm - + - name: Build .deb package shell: bash run: | fpm -s dir -t deb \ -n pslab \ - -v ${{ inputs.VERSION_NAME }} \ + -v "${{ inputs.VERSION_NAME }}" \ --prefix=/ \ --depends libusb-1.0-0 \ build/linux/arm64/release/bundle/bin/=/usr/bin \ @@ -69,7 +74,7 @@ runs: run: | fpm -s dir -t rpm \ -n pslab \ - -v ${{ inputs.VERSION_NAME }} \ + -v "${{ inputs.VERSION_NAME }}" \ --prefix=/ \ --depends libusb1 \ build/linux/arm64/release/bundle/bin/=/usr/bin \ @@ -83,4 +88,6 @@ runs: uses: actions/upload-artifact@v4 with: name: linux-packages-arm64 - path: "*.deb\n*.rpm" + path: | + *.deb + *.rpm \ No newline at end of file diff --git a/.github/actions/linux/action.yml b/.github/actions/linux/action.yml index 471d8af10..34ab5783b 100644 --- a/.github/actions/linux/action.yml +++ b/.github/actions/linux/action.yml @@ -17,7 +17,7 @@ runs: uses: subosito/flutter-action@v2 with: cache: true - flutter-version-file: pubspec.yaml + flutter-version-file: .flutter-version - name: Install dependencies shell: bash diff --git a/.github/actions/macos/action.yml b/.github/actions/macos/action.yml index 937ded2d8..dc535a139 100644 --- a/.github/actions/macos/action.yml +++ b/.github/actions/macos/action.yml @@ -17,7 +17,7 @@ runs: uses: subosito/flutter-action@v2 with: cache: false # TODO set to after https://github.com/actions/runner/issues/449 is fixed - flutter-version-file: pubspec.yaml + flutter-version-file: .flutter-version - name: Update Podfile shell: bash diff --git a/.github/actions/screenshot-android/action.yml b/.github/actions/screenshot-android/action.yml index 0e13c7f2d..9d0ea99c3 100644 --- a/.github/actions/screenshot-android/action.yml +++ b/.github/actions/screenshot-android/action.yml @@ -53,7 +53,7 @@ runs: uses: subosito/flutter-action@v2 with: cache: true - flutter-version-file: pubspec.yaml + flutter-version-file: .flutter-version - name: Create Android Screenshots uses: reactivecircus/android-emulator-runner@v2 @@ -91,7 +91,7 @@ runs: git push --force origin fastlane-android - name: Upload Screenshots - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: Android Screenshots path: screenshots/* diff --git a/.github/actions/screenshot-ipad/action.yml b/.github/actions/screenshot-ipad/action.yml index 00ba258f5..321411119 100644 --- a/.github/actions/screenshot-ipad/action.yml +++ b/.github/actions/screenshot-ipad/action.yml @@ -13,7 +13,7 @@ runs: uses: subosito/flutter-action@v2 with: cache: false # TODO set to after https://github.com/actions/runner/issues/449 is fixed - flutter-version-file: pubspec.yaml + flutter-version-file: .flutter-version - name: Update Podfile shell: bash diff --git a/.github/actions/screenshot-iphone/action.yml b/.github/actions/screenshot-iphone/action.yml index fceeb250d..7a5b77d73 100644 --- a/.github/actions/screenshot-iphone/action.yml +++ b/.github/actions/screenshot-iphone/action.yml @@ -13,7 +13,7 @@ runs: uses: subosito/flutter-action@v2 with: cache: false # TODO set to after https://github.com/actions/runner/issues/449 is fixed - flutter-version-file: pubspec.yaml + flutter-version-file: .flutter-version - name: Update Podfile shell: bash diff --git a/.github/actions/windows/action.yml b/.github/actions/windows/action.yml index d6a3ca5af..44cde5162 100644 --- a/.github/actions/windows/action.yml +++ b/.github/actions/windows/action.yml @@ -17,7 +17,7 @@ runs: uses: subosito/flutter-action@v2 with: cache: true - flutter-version-file: pubspec.yaml + flutter-version-file: .flutter-version - name: Build Windows App shell: pwsh diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f27299660..f3cc02b6f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -18,4 +18,4 @@ updates: - "/.github/actions/ios" - "/.github/actions/screenshot-android" schedule: - interval: "daily" \ No newline at end of file + interval: "daily" diff --git a/.github/workflows/flutter_upgrade.yml b/.github/workflows/flutter_upgrade.yml index aa2addb99..7ffd2e78c 100644 --- a/.github/workflows/flutter_upgrade.yml +++ b/.github/workflows/flutter_upgrade.yml @@ -13,48 +13,56 @@ jobs: - name: Checkout repository uses: actions/checkout@v5 - - name: Read Flutter version from pubspec.yaml + - name: Read current Flutter version id: read-version + shell: bash run: | - FLUTTER_VERSION=$(yq '.environment.flutter' pubspec.yaml) + FLUTTER_VERSION=$(cat .flutter-version) echo "Current Flutter version: $FLUTTER_VERSION" - echo "flutter_version=$FLUTTER_VERSION" >> $GITHUB_ENV + echo "FLUTTER_VERSION=$FLUTTER_VERSION" >> $GITHUB_ENV - name: Get latest stable Flutter version id: check-latest + shell: bash run: | - LATEST_VERSION=$(curl -s https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json | jq -r '.releases[] | select(.channel == "stable") | .version' | head -n 1) + LATEST_VERSION=$(curl -s https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json \ + | jq -r '.releases[] | select(.channel == "stable") | .version' \ + | head -n 1) echo "Latest stable Flutter version: $LATEST_VERSION" - echo "latest_flutter_version=$LATEST_VERSION" >> $GITHUB_ENV + echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_ENV - - name: Compare versions and update pubspec.yaml if needed + - name: Compare versions and update .flutter-version id: update-version + shell: bash run: | - if [ "$flutter_version" != "$latest_flutter_version" ]; then - echo "Updating Flutter version in pubspec.yaml..." - sed -i "s/flutter:\s*'${flutter_version}'/flutter: '${latest_flutter_version}'/" pubspec.yaml + if [ "$FLUTTER_VERSION" != "$LATEST_VERSION" ]; then + echo "Updating Flutter version..." + echo "$LATEST_VERSION" > .flutter-version git --no-pager diff - echo "update_needed=true" >> $GITHUB_ENV + echo "UPDATE_NEEDED=true" >> $GITHUB_ENV else - echo "Flutter is up to date." - echo "update_needed=false" >> $GITHUB_ENV + echo "Flutter is already up to date." + echo "UPDATE_NEEDED=false" >> $GITHUB_ENV fi - name: Commit and create PR if update is needed - if: env.update_needed == 'true' + if: env.UPDATE_NEEDED == 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git config --global user.name "dependabot[bot]" - git config --global user.email "49699333+dependabot[bot]@users.noreply.github.com" - - BRANCH_NAME="flutter-upgrade-${{ env.latest_flutter_version }}" - git checkout -b $BRANCH_NAME - git add pubspec.yaml - git commit -m "chore: Upgrade Flutter to ${{ env.latest_flutter_version }}" - git push origin -f $BRANCH_NAME - - PR_URL=$(gh pr create --title "chore(deps): upgrade Flutter to ${{ env.latest_flutter_version }}" \ - --body "This PR updates Flutter version in pubspec.yaml to the latest stable release." \ - --base flutter \ - --head $BRANCH_NAME) + shell: bash + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + BRANCH_NAME="flutter-upgrade-${LATEST_VERSION}" + + git checkout -b "$BRANCH_NAME" + git add .flutter-version + git commit -m "chore: upgrade Flutter to ${LATEST_VERSION}" + git push origin "$BRANCH_NAME" + + gh pr create \ + --title "chore(deps): upgrade Flutter to ${LATEST_VERSION}" \ + --body "This PR updates the Flutter SDK version in .flutter-version to the latest stable release." \ + --base flutter \ + --head "$BRANCH_NAME" \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 3544dca22..b5547c64d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,6 @@ version: 1.0.0+1 environment: sdk: ^3.5.4 - flutter: '3.41.2' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -40,7 +39,7 @@ dependencies: cupertino_icons: ^1.0.8 flutter_svg: ^2.2.0 google_fonts: ^8.0.2 - fl_chart: ^1.1.0 + fl_chart: ^1.0.0 provider: ^6.1.5 usb_serial: ^0.5.0 get_it: ^9.2.1 @@ -162,4 +161,4 @@ flutter_launcher_icons: adaptive_icon_background: "#FFFFFF" adaptive_icon_foreground: "assets/icons/icon.png" adaptive_icon_monochrome: "assets/icons/icon.png" - adaptive_icon_foreground_inset: 22 \ No newline at end of file + adaptive_icon_foreground_inset: 22