Skip to content
1 change: 1 addition & 0 deletions .flutter-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.41.5
2 changes: 1 addition & 1 deletion .github/actions/android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/common/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/ios/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
uses: subosito/flutter-action@v2
with:
cache: false # TODO set to <true> 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
Expand Down
49 changes: 28 additions & 21 deletions .github/actions/linux-arm64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,64 @@ 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"
steps:
- 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 \
Expand All @@ -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 \
Expand All @@ -83,4 +88,6 @@ runs:
uses: actions/upload-artifact@v4
with:
name: linux-packages-arm64
path: "*.deb\n*.rpm"
path: |
*.deb
*.rpm
2 changes: 1 addition & 1 deletion .github/actions/linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
uses: subosito/flutter-action@v2
with:
cache: false # TODO set to <true> 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
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/screenshot-android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/screenshot-ipad/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
uses: subosito/flutter-action@v2
with:
cache: false # TODO set to <true> 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
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/screenshot-iphone/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
uses: subosito/flutter-action@v2
with:
cache: false # TODO set to <true> 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
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ updates:
- "/.github/actions/ios"
- "/.github/actions/screenshot-android"
schedule:
interval: "daily"
interval: "daily"
62 changes: 35 additions & 27 deletions .github/workflows/flutter_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading