From 2b43a85166fb1eee2544ac63e06648b7722f4d56 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 10:55:12 +0530 Subject: [PATCH 01/19] Add GitHub Actions workflow for non-code changes --- .github/workflows/non-code-changes.yml | 77 ++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/non-code-changes.yml diff --git a/.github/workflows/non-code-changes.yml b/.github/workflows/non-code-changes.yml new file mode 100644 index 000000000..fa059e016 --- /dev/null +++ b/.github/workflows/non-code-changes.yml @@ -0,0 +1,77 @@ +name: Build + +on: + pull_request: + branches: ["flutter"] + paths: + - '**.md' + - 'docs/**' + - '**.png' + - '**.jpg' + - '**.jpeg' + - '**.gif' + - '**.svg' + - '**.webp' + - '**.txt' + - '**.arb' + +jobs: + common: + name: Common Build + runs-on: ubuntu-latest + steps: + - run: echo "non-code changes." + + android: + name: Android Flutter Build + runs-on: ubuntu-latest + steps: + - run: echo "non-code changes." + + ios: + name: iOS Flutter Build + runs-on: ubuntu-latest + steps: + - run: echo "non-code changes." + + screenshots-android: + name: Screenshots (Android) + runs-on: ubuntu-latest + steps: + - run: echo "non-code changes." + + screenshots-iphone: + name: Screenshots (iPhone) + runs-on: ubuntu-latest + steps: + - run: echo "non-code changes." + + screenshots-ipad: + name: Screenshots (iPad) + runs-on: ubuntu-latest + steps: + - run: echo "non-code changes." + + windows: + name: Windows Flutter Build + runs-on: ubuntu-latest + steps: + - run: echo "non-code changes." + + linux: + name: Linux Flutter Build + runs-on: ubuntu-latest + steps: + - run: echo "non-code changes." + + linux-arm64: + name: Linux ARM64 Flutter Build + runs-on: ubuntu-latest + steps: + - run: echo "non-code changes." + + macos: + name: macOS Flutter Build + runs-on: ubuntu-latest + steps: + - run: echo "non-code changes." From 9c6be495410ec31fb37aa2da87072eee45cba2e7 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 11:53:48 +0530 Subject: [PATCH 02/19] Refactor workflow by removing unused jobs Removed common and platform-specific jobs for non-code changes. --- .github/workflows/non-code-changes.yml | 50 +------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/.github/workflows/non-code-changes.yml b/.github/workflows/non-code-changes.yml index fa059e016..9bf4d25ed 100644 --- a/.github/workflows/non-code-changes.yml +++ b/.github/workflows/non-code-changes.yml @@ -15,13 +15,7 @@ on: - '**.txt' - '**.arb' -jobs: - common: - name: Common Build - runs-on: ubuntu-latest - steps: - - run: echo "non-code changes." - +jobs: android: name: Android Flutter Build runs-on: ubuntu-latest @@ -33,45 +27,3 @@ jobs: runs-on: ubuntu-latest steps: - run: echo "non-code changes." - - screenshots-android: - name: Screenshots (Android) - runs-on: ubuntu-latest - steps: - - run: echo "non-code changes." - - screenshots-iphone: - name: Screenshots (iPhone) - runs-on: ubuntu-latest - steps: - - run: echo "non-code changes." - - screenshots-ipad: - name: Screenshots (iPad) - runs-on: ubuntu-latest - steps: - - run: echo "non-code changes." - - windows: - name: Windows Flutter Build - runs-on: ubuntu-latest - steps: - - run: echo "non-code changes." - - linux: - name: Linux Flutter Build - runs-on: ubuntu-latest - steps: - - run: echo "non-code changes." - - linux-arm64: - name: Linux ARM64 Flutter Build - runs-on: ubuntu-latest - steps: - - run: echo "non-code changes." - - macos: - name: macOS Flutter Build - runs-on: ubuntu-latest - steps: - - run: echo "non-code changes." From b07d525760c9f0c021dff25ef3cb0870c7415ac5 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 12:35:48 +0530 Subject: [PATCH 03/19] chore: ci-testing (#27) * testing Add branch policy section to README * testing2 Updated the 'How to Use' section for clarity. * Update error logging message for ScienceLab initialization * Update barometer_screen.dart * Remove common and screenshot jobs from workflow * Change dutyMin value from 0 to 10 --- README.md | 3 +++ docs/Lux meter.md | 4 ++-- lib/providers/wave_generator_state_provider.dart | 2 +- lib/view/barometer_screen.dart | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 040d7f499..9d66164b2 100644 --- a/README.md +++ b/README.md @@ -506,6 +506,9 @@ Despite any reason, follow the steps given below to squash all commits into one `$ git push -f origin ` +////////// + + ### Branch Policy We have the following branches diff --git a/docs/Lux meter.md b/docs/Lux meter.md index 1079a56f1..63b2941fb 100644 --- a/docs/Lux meter.md +++ b/docs/Lux meter.md @@ -47,7 +47,7 @@ Configure view is used to control the lux meter by changing variuos parameters. 4. Update period - The time delay between two successive sensor readings can be changed by this parameter. The range is from `100ms` to `1000ms`. -## How to Use +## How to Use it The default sensor for the lux meter is the built-in sensor. If the android device contains the ambient light sensor, immediatly the data can be observed throught the data view. When using a I2C connected lux sensor, the pin configuration for the sensor is as follows. @@ -63,4 +63,4 @@ SDA | SDA The pin configuration for the TSL-2561 is also as same as above. -Change the parameters `update period`, `high limit` and `gain range` and observe the differences. \ No newline at end of file +Change the parameters `update period`, `high limit` and `gain range` and observe the differences. diff --git a/lib/providers/wave_generator_state_provider.dart b/lib/providers/wave_generator_state_provider.dart index 41d3aba4f..b2ef1b545 100644 --- a/lib/providers/wave_generator_state_provider.dart +++ b/lib/providers/wave_generator_state_provider.dart @@ -34,7 +34,7 @@ enum WaveConst { enum WaveData { freqMin(10), - dutyMin(0), + dutyMin(10), phaseMin(0), freqMax(5000), phaseMax(360), diff --git a/lib/view/barometer_screen.dart b/lib/view/barometer_screen.dart index 4b734d499..1373f56ed 100644 --- a/lib/view/barometer_screen.dart +++ b/lib/view/barometer_screen.dart @@ -77,7 +77,7 @@ class _BarometerScreenState extends State { _i2c = I2C(_scienceLab!.mPacketHandler); } } catch (e) { - logger.e('Error initializing ScienceLab: $e'); + logger.e('Error initializing _____ScienceLab_____: $e'); } } From 75b716446a105944a48cdbb2b25ebb2b36cd53b6 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 13:03:07 +0530 Subject: [PATCH 04/19] chore: ci-tesing-2 (#28) * Increase PacketHandler timeout to 1500 ms * Increase height of InstrumentImage from 200 to 210 --- lib/communication/science_lab.dart | 2 +- lib/view/gyroscope_screen.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/communication/science_lab.dart b/lib/communication/science_lab.dart index a926dc3ee..04119ab86 100644 --- a/lib/communication/science_lab.dart +++ b/lib/communication/science_lab.dart @@ -57,7 +57,7 @@ class ScienceLab { if (isDeviceFound()) { try { await mCommunicationHandler.open(); - mPacketHandler = PacketHandler(500, mCommunicationHandler); + mPacketHandler = PacketHandler(1500, mCommunicationHandler); } catch (e) { logger.e(e); } diff --git a/lib/view/gyroscope_screen.dart b/lib/view/gyroscope_screen.dart index 8f4c211df..65dbaa058 100644 --- a/lib/view/gyroscope_screen.dart +++ b/lib/view/gyroscope_screen.dart @@ -77,7 +77,7 @@ class _GyroscopeScreenState extends State { ), const InstrumentImage( imagePath: imagePath, - height: 200.0, + height: 210.0, ), InstrumentIntroText( text: appLocalizations.gyroscopeDesc, From 6c5ed51ed0d11bd1b2f0e65f3f76c6b2375d3fbe Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 13:07:34 +0530 Subject: [PATCH 05/19] Enhance pull request workflow with code change detection Updated pull request workflow to include code change detection and conditional builds for Android, iOS, and screenshot jobs. --- .github/workflows/pull-request.yml | 76 +++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 5e8c227c2..08c3534b2 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -3,17 +3,7 @@ name: Build on: pull_request: branches: ["flutter"] - paths-ignore: - - '**.md' - - 'docs/**' - - '**.png' - - '**.jpg' - - '**.jpeg' - - '**.gif' - - '**.svg' - - '**.webp' - - '**.txt' - - '**.arb' + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -25,6 +15,28 @@ env: IPAD_DEVICE_MODEL: iPad Pro 13-inch (M4) jobs: + + changes: + name: Detect Code Changes + runs-on: ubuntu-latest + outputs: + code: ${{ steps.filter.outputs.code }} + steps: + - uses: actions/checkout@v6 + + - id: filter + uses: dorny/paths-filter@v3 + with: + filters: | + code: + - '**.dart' + - 'android/**' + - 'ios/**' + - 'lib/**' + - 'linux/**' + - 'windows/**' + - 'macos/**' + common: name: Common Build runs-on: ubuntu-latest @@ -46,31 +58,43 @@ jobs: android: name: Android Flutter Build - needs: common + needs: [common, changes] runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + - name: Skip Android build for docs + if: needs.changes.outputs.code != 'true' + run: echo "non-code changes" + - name: Android Workflow + if: needs.changes.outputs.code == 'true' uses: ./.github/actions/android ios: name: iOS Flutter Build - needs: common + needs: [common, changes] runs-on: macos-latest steps: - name: Set up Xcode uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '16.4.0' - + - uses: actions/checkout@v6 + - name: Skip iOS build for docs + if: needs.changes.outputs.code != 'true' + run: echo "non-code changes" + - name: iOS Workflow + if: needs.changes.outputs.code == 'true' uses: ./.github/actions/ios screenshots-android: name: Screenshots (Android) + needs: [changes] + if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest timeout-minutes: 30 steps: @@ -84,6 +108,8 @@ jobs: screenshots-iphone: name: Screenshots (iPhone) + needs: [changes] + if: needs.changes.outputs.code == 'true' runs-on: macos-latest timeout-minutes: 30 steps: @@ -98,9 +124,11 @@ jobs: uses: ./.github/actions/screenshot-iphone with: IPHONE_DEVICE_MODEL: ${{ env.IPHONE_DEVICE_MODEL }} - + screenshots-ipad: name: Screenshots (iPad) + needs: [changes] + if: needs.changes.outputs.code == 'true' runs-on: macos-latest timeout-minutes: 30 steps: @@ -115,20 +143,22 @@ jobs: uses: ./.github/actions/screenshot-ipad with: IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }} - + windows: name: Windows Flutter Build - needs: common + needs: [common, changes] + if: needs.changes.outputs.code == 'true' runs-on: windows-latest steps: - uses: actions/checkout@v6 - name: Windows Workflow uses: ./.github/actions/windows - + linux: name: Linux Flutter Build - needs: common + needs: [common, changes] + if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -138,7 +168,8 @@ jobs: linux-arm64: name: Linux ARM64 Flutter Build - needs: common + needs: [common, changes] + if: needs.changes.outputs.code == 'true' runs-on: ubuntu-24.04-arm steps: - uses: actions/checkout@v6 @@ -148,7 +179,8 @@ jobs: macos: name: macOS Flutter Build - needs: common + needs: [common, changes] + if: needs.changes.outputs.code == 'true' runs-on: macos-latest steps: - name: Set up Xcode @@ -159,4 +191,4 @@ jobs: - uses: actions/checkout@v6 - name: macOS Workflow - uses: ./.github/actions/macos \ No newline at end of file + uses: ./.github/actions/macos From b2fb991deec4d39fc5296521bcb779d33538a6e3 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 13:17:09 +0530 Subject: [PATCH 06/19] Refactor workflow dependencies to remove 'common' --- .github/workflows/pull-request.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 08c3534b2..6bf272596 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -23,10 +23,13 @@ jobs: code: ${{ steps.filter.outputs.code }} steps: - uses: actions/checkout@v6 + with: + fetch-depth: 0 - id: filter uses: dorny/paths-filter@v3 with: + base: ${{ github.event.pull_request.base.sha }} filters: | code: - '**.dart' @@ -39,6 +42,8 @@ jobs: common: name: Common Build + needs: changes + if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -58,7 +63,7 @@ jobs: android: name: Android Flutter Build - needs: [common, changes] + needs: changes runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -73,10 +78,11 @@ jobs: ios: name: iOS Flutter Build - needs: [common, changes] + needs: changes runs-on: macos-latest steps: - name: Set up Xcode + if: needs.changes.outputs.code == 'true' uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '16.4.0' @@ -93,7 +99,7 @@ jobs: screenshots-android: name: Screenshots (Android) - needs: [changes] + needs: changes if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest timeout-minutes: 30 @@ -108,7 +114,7 @@ jobs: screenshots-iphone: name: Screenshots (iPhone) - needs: [changes] + needs: changes if: needs.changes.outputs.code == 'true' runs-on: macos-latest timeout-minutes: 30 @@ -127,7 +133,7 @@ jobs: screenshots-ipad: name: Screenshots (iPad) - needs: [changes] + needs: changes if: needs.changes.outputs.code == 'true' runs-on: macos-latest timeout-minutes: 30 @@ -146,7 +152,7 @@ jobs: windows: name: Windows Flutter Build - needs: [common, changes] + needs: changes if: needs.changes.outputs.code == 'true' runs-on: windows-latest steps: @@ -157,7 +163,7 @@ jobs: linux: name: Linux Flutter Build - needs: [common, changes] + needs: changes if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest steps: @@ -168,7 +174,7 @@ jobs: linux-arm64: name: Linux ARM64 Flutter Build - needs: [common, changes] + needs: changes if: needs.changes.outputs.code == 'true' runs-on: ubuntu-24.04-arm steps: @@ -179,7 +185,7 @@ jobs: macos: name: macOS Flutter Build - needs: [common, changes] + needs: changes if: needs.changes.outputs.code == 'true' runs-on: macos-latest steps: From a6458840b08afc2ea6300e5601cea11b9b45adf5 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 14:09:16 +0530 Subject: [PATCH 07/19] Update pull-request.yml --- .github/workflows/pull-request.yml | 80 ++++++++---------------------- 1 file changed, 21 insertions(+), 59 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 6bf272596..4f7c841f6 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -3,7 +3,17 @@ name: Build on: pull_request: branches: ["flutter"] - + paths-ignore: + - '**.md' + - 'docs/**' + - '**.png' + - '**.jpg' + - '**.jpeg' + - '**.gif' + - '**.svg' + - '**.webp' + - '**.txt' + - '**.arb' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -15,35 +25,8 @@ env: IPAD_DEVICE_MODEL: iPad Pro 13-inch (M4) jobs: - - changes: - name: Detect Code Changes - runs-on: ubuntu-latest - outputs: - code: ${{ steps.filter.outputs.code }} - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - id: filter - uses: dorny/paths-filter@v3 - with: - base: ${{ github.event.pull_request.base.sha }} - filters: | - code: - - '**.dart' - - 'android/**' - - 'ios/**' - - 'lib/**' - - 'linux/**' - - 'windows/**' - - 'macos/**' - common: name: Common Build - needs: changes - if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -63,44 +46,31 @@ jobs: android: name: Android Flutter Build - needs: changes + needs: common runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - name: Skip Android build for docs - if: needs.changes.outputs.code != 'true' - run: echo "non-code changes" - - name: Android Workflow - if: needs.changes.outputs.code == 'true' uses: ./.github/actions/android ios: name: iOS Flutter Build - needs: changes + needs: common runs-on: macos-latest steps: - name: Set up Xcode - if: needs.changes.outputs.code == 'true' uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '16.4.0' - + - uses: actions/checkout@v6 - - name: Skip iOS build for docs - if: needs.changes.outputs.code != 'true' - run: echo "non-code changes" - - name: iOS Workflow - if: needs.changes.outputs.code == 'true' uses: ./.github/actions/ios screenshots-android: name: Screenshots (Android) - needs: changes - if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest timeout-minutes: 30 steps: @@ -114,8 +84,6 @@ jobs: screenshots-iphone: name: Screenshots (iPhone) - needs: changes - if: needs.changes.outputs.code == 'true' runs-on: macos-latest timeout-minutes: 30 steps: @@ -130,11 +98,9 @@ jobs: uses: ./.github/actions/screenshot-iphone with: IPHONE_DEVICE_MODEL: ${{ env.IPHONE_DEVICE_MODEL }} - + screenshots-ipad: name: Screenshots (iPad) - needs: changes - if: needs.changes.outputs.code == 'true' runs-on: macos-latest timeout-minutes: 30 steps: @@ -149,22 +115,20 @@ jobs: uses: ./.github/actions/screenshot-ipad with: IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }} - + windows: name: Windows Flutter Build - needs: changes - if: needs.changes.outputs.code == 'true' + needs: common runs-on: windows-latest steps: - uses: actions/checkout@v6 - name: Windows Workflow uses: ./.github/actions/windows - + linux: name: Linux Flutter Build - needs: changes - if: needs.changes.outputs.code == 'true' + needs: common runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -174,8 +138,7 @@ jobs: linux-arm64: name: Linux ARM64 Flutter Build - needs: changes - if: needs.changes.outputs.code == 'true' + needs: common runs-on: ubuntu-24.04-arm steps: - uses: actions/checkout@v6 @@ -185,8 +148,7 @@ jobs: macos: name: macOS Flutter Build - needs: changes - if: needs.changes.outputs.code == 'true' + needs: common runs-on: macos-latest steps: - name: Set up Xcode From da55a99f9cb2f0ea27b8cfe92778e0a65a1b71bc Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 14:14:10 +0530 Subject: [PATCH 08/19] Rename workflow and add docs-only check --- .github/workflows/non-code-changes.yml | 31 ++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/non-code-changes.yml b/.github/workflows/non-code-changes.yml index 9bf4d25ed..55e013cf3 100644 --- a/.github/workflows/non-code-changes.yml +++ b/.github/workflows/non-code-changes.yml @@ -1,4 +1,4 @@ -name: Build +name: Docs Bypass on: pull_request: @@ -15,15 +15,38 @@ on: - '**.txt' - '**.arb' -jobs: +jobs: + + check: + runs-on: ubuntu-latest + outputs: + docs_only: ${{ steps.check.outputs.docs_only }} + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - id: check + run: | + if git diff --name-only origin/${{ github.base_ref }} | grep -vE '\.(md|png|jpg|jpeg|gif|svg|webp|txt|arb)$'; then + echo "docs_only=false" >> $GITHUB_OUTPUT + else + echo "docs_only=true" >> $GITHUB_OUTPUT + fi + android: name: Android Flutter Build + needs: check + if: needs.check.outputs.docs_only == 'true' runs-on: ubuntu-latest steps: - - run: echo "non-code changes." + - run: echo "docs-only change" ios: name: iOS Flutter Build + needs: check + if: needs.check.outputs.docs_only == 'true' runs-on: ubuntu-latest steps: - - run: echo "non-code changes." + - run: echo "docs-only change" From 26f10024e157b851bc2040c4cbb44a8f272a24d0 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 15:10:41 +0530 Subject: [PATCH 09/19] Delete .github/workflows/non-code-changes.yml --- .github/workflows/non-code-changes.yml | 52 -------------------------- 1 file changed, 52 deletions(-) delete mode 100644 .github/workflows/non-code-changes.yml diff --git a/.github/workflows/non-code-changes.yml b/.github/workflows/non-code-changes.yml deleted file mode 100644 index 55e013cf3..000000000 --- a/.github/workflows/non-code-changes.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Docs Bypass - -on: - pull_request: - branches: ["flutter"] - paths: - - '**.md' - - 'docs/**' - - '**.png' - - '**.jpg' - - '**.jpeg' - - '**.gif' - - '**.svg' - - '**.webp' - - '**.txt' - - '**.arb' - -jobs: - - check: - runs-on: ubuntu-latest - outputs: - docs_only: ${{ steps.check.outputs.docs_only }} - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - id: check - run: | - if git diff --name-only origin/${{ github.base_ref }} | grep -vE '\.(md|png|jpg|jpeg|gif|svg|webp|txt|arb)$'; then - echo "docs_only=false" >> $GITHUB_OUTPUT - else - echo "docs_only=true" >> $GITHUB_OUTPUT - fi - - android: - name: Android Flutter Build - needs: check - if: needs.check.outputs.docs_only == 'true' - runs-on: ubuntu-latest - steps: - - run: echo "docs-only change" - - ios: - name: iOS Flutter Build - needs: check - if: needs.check.outputs.docs_only == 'true' - runs-on: ubuntu-latest - steps: - - run: echo "docs-only change" From 171ac1cb069beb8ac238b4e9eb14ffe473d190b6 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 15:13:53 +0530 Subject: [PATCH 10/19] Update pull-request.yml --- .github/workflows/pull-request.yml | 160 ++++++++++++++++++++++------- 1 file changed, 122 insertions(+), 38 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4f7c841f6..25dcc787a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -3,17 +3,7 @@ name: Build on: pull_request: branches: ["flutter"] - paths-ignore: - - '**.md' - - 'docs/**' - - '**.png' - - '**.jpg' - - '**.jpeg' - - '**.gif' - - '**.svg' - - '**.webp' - - '**.txt' - - '**.arb' + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -25,138 +15,232 @@ env: IPAD_DEVICE_MODEL: iPad Pro 13-inch (M4) jobs: + changes: + name: Detect Changes + runs-on: ubuntu-latest + outputs: + is_code: ${{ steps.filter.outputs.code }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + code: + - '**' + - '!**.md' + - '!docs/**' + - '!**.png' + - '!**.jpg' + - '!**.jpeg' + - '!**.gif' + - '!**.svg' + - '!**.webp' + - '!**.txt' + - '!**.arb' + common: name: Common Build + needs: changes runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 + if: needs.changes.outputs.is_code == 'true' - name: Common Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/common - name: Save PR number + if: needs.changes.outputs.is_code == 'true' run: | mkdir -p ./pr echo ${{ github.event.number }} > ./pr/NR - - uses: actions/upload-artifact@v7 + - uses: actions/upload-artifact@v4 + if: needs.changes.outputs.is_code == 'true' with: name: pr path: pr/ + - name: Docs Only Bypass + if: needs.changes.outputs.is_code != 'true' + run: echo "Docs-only change detected. Bypassing common tasks." + android: name: Android Flutter Build - needs: common + needs: [changes, common] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 + if: needs.changes.outputs.is_code == 'true' - name: Android Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/android + - name: Docs Only Bypass + if: needs.changes.outputs.is_code != 'true' + run: echo "Docs-only change detected. Bypassing Android build." + ios: name: iOS Flutter Build - needs: common - runs-on: macos-latest + needs: [changes, common] + runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }} steps: - name: Set up Xcode + if: needs.changes.outputs.is_code == 'true' uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '16.4.0' - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 + if: needs.changes.outputs.is_code == 'true' - name: iOS Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/ios + - name: Docs Only Bypass + if: needs.changes.outputs.is_code != 'true' + run: echo "Docs-only change detected. Bypassing iOS build." + screenshots-android: name: Screenshots (Android) + needs: changes runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 + if: needs.changes.outputs.is_code == 'true' - name: Android Screenshot Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/screenshot-android with: ANDROID_EMULATOR_API: ${{ env.ANDROID_EMULATOR_API }} ANDROID_EMULATOR_ARCH: ${{ env.ANDROID_EMULATOR_ARCH }} + - name: Docs Only Bypass + if: needs.changes.outputs.is_code != 'true' + run: echo "Docs-only change detected. Bypassing Android screenshots." + screenshots-iphone: name: Screenshots (iPhone) - runs-on: macos-latest + needs: changes + runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }} timeout-minutes: 30 steps: - name: Set up Xcode + if: needs.changes.outputs.is_code == 'true' uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '16.4.0' - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 + if: needs.changes.outputs.is_code == 'true' - name: iPhone Screenshot Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/screenshot-iphone with: IPHONE_DEVICE_MODEL: ${{ env.IPHONE_DEVICE_MODEL }} - + + - name: Docs Only Bypass + if: needs.changes.outputs.is_code != 'true' + run: echo "Docs-only change detected. Bypassing iPhone screenshots." + screenshots-ipad: name: Screenshots (iPad) - runs-on: macos-latest + needs: changes + runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }} timeout-minutes: 30 steps: - name: Set up Xcode + if: needs.changes.outputs.is_code == 'true' uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '16.4.0' - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 + if: needs.changes.outputs.is_code == 'true' - name: iPad Screenshot Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/screenshot-ipad with: IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }} - + + - name: Docs Only Bypass + if: needs.changes.outputs.is_code != 'true' + run: echo "Docs-only change detected. Bypassing iPad screenshots." + windows: name: Windows Flutter Build - needs: common - runs-on: windows-latest + needs: [changes, common] + runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'windows-latest' || 'ubuntu-latest' }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 + if: needs.changes.outputs.is_code == 'true' - name: Windows Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/windows - + + - name: Docs Only Bypass + if: needs.changes.outputs.is_code != 'true' + run: echo "Docs-only change detected. Bypassing Windows build." + linux: name: Linux Flutter Build - needs: common + needs: [changes, common] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 + if: needs.changes.outputs.is_code == 'true' - name: Linux Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/linux + - name: Docs Only Bypass + if: needs.changes.outputs.is_code != 'true' + run: echo "Docs-only change detected. Bypassing Linux build." + linux-arm64: name: Linux ARM64 Flutter Build - needs: common - runs-on: ubuntu-24.04-arm + needs: [changes, common] + runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 + if: needs.changes.outputs.is_code == 'true' - name: Linux ARM64 Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/linux-arm64 + - name: Docs Only Bypass + if: needs.changes.outputs.is_code != 'true' + run: echo "Docs-only change detected. Bypassing Linux ARM64 build." + macos: name: macOS Flutter Build - needs: common - runs-on: macos-latest + needs: [changes, common] + runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }} steps: - name: Set up Xcode + if: needs.changes.outputs.is_code == 'true' uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '16.4.0' - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 + if: needs.changes.outputs.is_code == 'true' - name: macOS Workflow - uses: ./.github/actions/macos + if: needs.changes.outputs.is_code == 'true' + uses: ./.github/actions/macos + + - name: Docs Only Bypass + if: needs.changes.outputs.is_code != 'true' + run: echo "Docs-only change detected. Bypassing macOS build." From 3239f2d79a4ecd2e2e80dbc39fcdabf4c2625fc5 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 15:39:03 +0530 Subject: [PATCH 11/19] chore: ci-testing-4 (#30) * Fix typo in Table of Contents header * Update settings_config_provider.dart * Delete .github/workflows/non-code-changes.yml * Enhance pull request workflow with change detection Refactor pull request workflow to detect code changes and bypass builds for documentation-only changes. * Fix typo in error logging for settings config --- docs/Lux meter.md | 2 +- lib/providers/settings_config_provider.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Lux meter.md b/docs/Lux meter.md index 63b2941fb..f5d470da6 100644 --- a/docs/Lux meter.md +++ b/docs/Lux meter.md @@ -1,6 +1,6 @@ # How to use Lux meter -## Table of Content +## Table of Contents 1. Introduction 2. Layout 3. Features diff --git a/lib/providers/settings_config_provider.dart b/lib/providers/settings_config_provider.dart index 90f4a8252..57bed6281 100644 --- a/lib/providers/settings_config_provider.dart +++ b/lib/providers/settings_config_provider.dart @@ -36,7 +36,7 @@ class SettingsConfigProvider extends ChangeNotifier { await prefs.setString('settings_config', json.encode(_config.toJson())); logger.d("Saved SettingsConfig: ${_config.toJson()}"); } catch (e) { - logger.e("Error saving SettingsConfig to prefs: $e"); + logger.e("EError saving SettingsConfig to prefs: $e"); } } From e571eeaf8de8a47bbdea425286d42223a6c1ac00 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 15:52:23 +0530 Subject: [PATCH 12/19] Upgrade actions/checkout and update bypass messages --- .github/workflows/pull-request.yml | 64 +++++++++++++++--------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 25dcc787a..2ae8bc96e 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -21,7 +21,7 @@ jobs: outputs: is_code: ${{ steps.filter.outputs.code }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: dorny/paths-filter@v3 id: filter with: @@ -44,7 +44,7 @@ jobs: needs: changes runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 if: needs.changes.outputs.is_code == 'true' - name: Common Workflow @@ -57,31 +57,31 @@ jobs: mkdir -p ./pr echo ${{ github.event.number }} > ./pr/NR - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 if: needs.changes.outputs.is_code == 'true' with: name: pr path: pr/ - - name: Docs Only Bypass + - name: Non-Code Change if: needs.changes.outputs.is_code != 'true' - run: echo "Docs-only change detected. Bypassing common tasks." + run: echo "Non-code change detected." android: name: Android Flutter Build needs: [changes, common] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 if: needs.changes.outputs.is_code == 'true' - name: Android Workflow if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/android - - name: Docs Only Bypass + - name: Non-Code Change if: needs.changes.outputs.is_code != 'true' - run: echo "Docs-only change detected. Bypassing Android build." + run: echo "Non-code change detected." ios: name: iOS Flutter Build @@ -94,16 +94,16 @@ jobs: with: xcode-version: '16.4.0' - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 if: needs.changes.outputs.is_code == 'true' - name: iOS Workflow if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/ios - - name: Docs Only Bypass + - name: Non-Code Change if: needs.changes.outputs.is_code != 'true' - run: echo "Docs-only change detected. Bypassing iOS build." + run: echo "Non-code change detected." screenshots-android: name: Screenshots (Android) @@ -111,7 +111,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 if: needs.changes.outputs.is_code == 'true' - name: Android Screenshot Workflow @@ -121,9 +121,9 @@ jobs: ANDROID_EMULATOR_API: ${{ env.ANDROID_EMULATOR_API }} ANDROID_EMULATOR_ARCH: ${{ env.ANDROID_EMULATOR_ARCH }} - - name: Docs Only Bypass + - name: Non-Code Change if: needs.changes.outputs.is_code != 'true' - run: echo "Docs-only change detected. Bypassing Android screenshots." + run: echo "Non-code change detected." screenshots-iphone: name: Screenshots (iPhone) @@ -137,7 +137,7 @@ jobs: with: xcode-version: '16.4.0' - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 if: needs.changes.outputs.is_code == 'true' - name: iPhone Screenshot Workflow @@ -146,9 +146,9 @@ jobs: with: IPHONE_DEVICE_MODEL: ${{ env.IPHONE_DEVICE_MODEL }} - - name: Docs Only Bypass + - name: Non-Code Change if: needs.changes.outputs.is_code != 'true' - run: echo "Docs-only change detected. Bypassing iPhone screenshots." + run: echo "Non-code change detected." screenshots-ipad: name: Screenshots (iPad) @@ -162,7 +162,7 @@ jobs: with: xcode-version: '16.4.0' - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 if: needs.changes.outputs.is_code == 'true' - name: iPad Screenshot Workflow @@ -171,57 +171,57 @@ jobs: with: IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }} - - name: Docs Only Bypass + - name: Non-Code Change if: needs.changes.outputs.is_code != 'true' - run: echo "Docs-only change detected. Bypassing iPad screenshots." + run: echo "Non-code change detected." windows: name: Windows Flutter Build needs: [changes, common] runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'windows-latest' || 'ubuntu-latest' }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 if: needs.changes.outputs.is_code == 'true' - name: Windows Workflow if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/windows - - name: Docs Only Bypass + - name: Non-Code Change if: needs.changes.outputs.is_code != 'true' - run: echo "Docs-only change detected. Bypassing Windows build." + run: echo "Non-code change detected." linux: name: Linux Flutter Build needs: [changes, common] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 if: needs.changes.outputs.is_code == 'true' - name: Linux Workflow if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/linux - - name: Docs Only Bypass + - name: Non-Code Change if: needs.changes.outputs.is_code != 'true' - run: echo "Docs-only change detected. Bypassing Linux build." + run: echo "Non-code change detected." linux-arm64: name: Linux ARM64 Flutter Build needs: [changes, common] runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 if: needs.changes.outputs.is_code == 'true' - name: Linux ARM64 Workflow if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/linux-arm64 - - name: Docs Only Bypass + - name: Non-Code Change if: needs.changes.outputs.is_code != 'true' - run: echo "Docs-only change detected. Bypassing Linux ARM64 build." + run: echo "Non-code change detected." macos: name: macOS Flutter Build @@ -234,13 +234,13 @@ jobs: with: xcode-version: '16.4.0' - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 if: needs.changes.outputs.is_code == 'true' - name: macOS Workflow if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/macos - - name: Docs Only Bypass + - name: Non-Code Change if: needs.changes.outputs.is_code != 'true' - run: echo "Docs-only change detected. Bypassing macOS build." + run: echo "Non-code change detected." From e1c7b0f77699c5ea749a9b42a0448ee01f15d659 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 16:16:41 +0530 Subject: [PATCH 13/19] Clarify reference to PSLab application (#31) Updated the reference to the PSLab android application for consistency. --- docs/Lux meter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Lux meter.md b/docs/Lux meter.md index f5d470da6..8e9d5b047 100644 --- a/docs/Lux meter.md +++ b/docs/Lux meter.md @@ -9,7 +9,7 @@ 4. How to Use ## Introduction -Pocket Science Lab contains a lux meter which can measure real time ambient light intensity. This lux meter can use either the `built-in ambient light sensor` in your android device, `BH-1750` or `TSL-2561` lux sensors. The PSLab android application communicates with the Pocket Science Lab using `I2C` bus to read the two externally connected sensors. This document will help a user on available functionalities and how to use Pocket Science Lab with PSLab android application. +Pocket Science Lab contains a lux meter which can measure real time ambient light intensity. This lux meter can use either the `built-in ambient light sensor` in your android device, `BH-1750` or `TSL-2561` lux sensors. The PSLab android application communicates with the Pocket Science Lab using `I2C` bus to read the two externally connected sensors. This document will help a user on available functionalities and how to use Pocket Science Lab with PSLab application. ## Layout From eda950b2420cb229515e88fb423d05c426458710 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 16:17:07 +0530 Subject: [PATCH 14/19] Update pull-request.yml --- .github/workflows/pull-request.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 2ae8bc96e..26614eb91 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -28,16 +28,16 @@ jobs: filters: | code: - '**' - - '!**.md' - - '!docs/**' - - '!**.png' - - '!**.jpg' - - '!**.jpeg' - - '!**.gif' - - '!**.svg' - - '!**.webp' - - '!**.txt' - - '!**.arb' + - '!**/*.md' + - '!docs/**/*' + - '!**/*.png' + - '!**/*.jpg' + - '!**/*.jpeg' + - '!**/*.gif' + - '!**/*.svg' + - '!**/*.webp' + - '!**/*.txt' + - '!**/*.arb' common: name: Common Build From d6f40c3cb49da46a16037573121838868516261d Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 16:36:21 +0530 Subject: [PATCH 15/19] Update push-event.yml --- .github/workflows/push-event.yml | 428 +++++++++---------------------- 1 file changed, 117 insertions(+), 311 deletions(-) diff --git a/.github/workflows/push-event.yml b/.github/workflows/push-event.yml index 2bc59e548..21d321c60 100644 --- a/.github/workflows/push-event.yml +++ b/.github/workflows/push-event.yml @@ -1,19 +1,12 @@ -name: Push +name: Build on: - push: + pull_request: branches: ["flutter"] - paths-ignore: - - '**.md' - - 'docs/**' - - '**.png' - - '**.jpg' - - '**.jpeg' - - '**.gif' - - '**.svg' - - '**.webp' - - '**.txt' - - '**.arb' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true env: ANDROID_EMULATOR_API: 34 @@ -22,416 +15,229 @@ env: IPAD_DEVICE_MODEL: iPad Pro 13-inch (M4) jobs: + changes: + name: Detect Changes + runs-on: ubuntu-latest + outputs: + is_code: ${{ steps.check.outputs.is_code }} + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - id: check + run: | + # Diff the actual commit SHAs. + # grep -vE removes your media/doc extensions. grep -v removes the docs folder. + # If anything is left over, it's code. If the output is empty, it's just docs. + if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -vE '\.(md|png|jpg|jpeg|gif|svg|webp|txt|arb)$' | grep -v '^docs/'; then + echo "is_code=true" >> $GITHUB_OUTPUT + else + echo "is_code=false" >> $GITHUB_OUTPUT + fi + common: name: Common Build + needs: changes runs-on: ubuntu-latest - outputs: - VERSION_NAME: ${{ steps.flutter-version.outputs.VERSION_NAME }} - VERSION_CODE: ${{ steps.flutter-version.outputs.VERSION_CODE }} steps: - uses: actions/checkout@v6 + if: needs.changes.outputs.is_code == 'true' - name: Common Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/common - - name: Hydrate and Update Version - id: flutter-version + - name: Save PR number + if: needs.changes.outputs.is_code == 'true' run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - # Get commit message - commit_message=$(git log -1 --pretty=format:"%s") - - git clone --branch=version https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} version - cd version - - # Read and increment version name - IFS='.' read -r major minor patch < versionName.txt + mkdir -p ./pr + echo ${{ github.event.number }} > ./pr/NR - if [[ "$commit_message" =~ ^feat: ]]; then - next_minor=$((minor + 1)) - next_patch=0 - else - next_minor=$((minor)) - next_patch=$((patch + 1)) - fi - next_version_name="$major.$next_minor.$next_patch" - echo "VERSION_NAME=$next_version_name" >> $GITHUB_OUTPUT - echo "$next_version_name" > versionName.txt + - uses: actions/upload-artifact@v7 + if: needs.changes.outputs.is_code == 'true' + with: + name: pr + path: pr/ - # Read and increment version code - read -r version_code < versionCode.txt - - new_version_code=$((version_code + 1)) - echo "VERSION_CODE=$new_version_code" >> $GITHUB_OUTPUT - echo "$new_version_code" > versionCode.txt - - # Force push to version branch - git checkout --orphan temporary - git add --all . - git commit -am "[Auto] Update versionName: $next_version_name & versionCode: $new_version_code ($(date +%Y-%m-%d.%H:%M:%S))" - git branch -D version - git branch -m version - git push --force origin version + - name: Non-Code Change + if: needs.changes.outputs.is_code != 'true' + run: echo "Non-code change detected." android: name: Android Flutter Build - needs: common + needs: [changes, common] runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - - name: Prepare Build Keys - if: ${{ github.repository == 'fossasia/pslab-app' }} - env: - ENCRYPTED_F10B5E0E5262_IV: ${{ secrets.ENCRYPTED_F10B5E0E5262_IV }} - ENCRYPTED_F10B5E0E5262_KEY: ${{ secrets.ENCRYPTED_F10B5E0E5262_KEY }} - run: | - bash scripts/prep-android-key.sh + if: needs.changes.outputs.is_code == 'true' - name: Android Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/android - with: - STORE_PASS: ${{ secrets.STORE_PASS }} - ALIAS: ${{ secrets.ALIAS }} - KEY_PASS: ${{ secrets.KEY_PASS }} - VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} - VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} - - - name: Upload APK - uses: actions/upload-artifact@v7 - with: - name: APK Generated - path: build/app/outputs/flutter-apk - - name: Upload AAB Release - uses: actions/upload-artifact@v7 - with: - name: AAB Generated - path: build/app/outputs/bundle - - - name: Upload APK/AAB to apk branch - if: ${{ github.repository == 'fossasia/pslab-app' }} - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - git clone --branch=apk https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk - cd apk - - branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - - echo "Removing previous files from branch" - - rm -rf pslab-$branch* - - ls - - echo "Copying new build files" - - find ../build/app/outputs/flutter-apk -type f \( -name '*release.apk' -o -name '*release.aab' \) -exec cp -v {} . \; - find ../build/app/outputs/bundle -type f \( -name '*release.apk' -o -name '*release.aab' \) -exec cp -v {} . \; - - ls - - echo "Renaming new build files" - - for file in app*; do - mv $file pslab-$branch-${file#*-} - done - - ls - - echo "Pushing to apk branch" - - git checkout --orphan temporary - git add --all . - git commit -am "[Auto] Update APK/AABs from $branch ($(date +%Y-%m-%d.%H:%M:%S))" - git branch -D apk - git branch -m apk - git push --force origin apk - - - name: Update app in Open Testing track - if: ${{ github.repository == 'fossasia/pslab-app' }} - run: | - git clone --branch=fastlane-android --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} fastlane - fastlane uploadToOpenTesting - if [[ $? -ne 0 ]]; then - exit 1 - fi + - name: Non-Code Change + if: needs.changes.outputs.is_code != 'true' + run: echo "Non-code change detected." ios: name: iOS Flutter Build - needs: common - runs-on: macos-latest + needs: [changes, common] + runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }} steps: - name: Set up Xcode + if: needs.changes.outputs.is_code == 'true' uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '16.4.0' - uses: actions/checkout@v6 - - - name: Prepare Build Keys - if: ${{ github.repository == 'fossasia/pslab-app' }} - env: - ENCRYPTED_IOS_IV: ${{ secrets.ENCRYPTED_IOS_IV }} - ENCRYPTED_IOS_KEY: ${{ secrets.ENCRYPTED_IOS_KEY }} - run: | - bash scripts/prep-ios-key.sh - - - name: Setup Certs - if: ${{ github.repository == 'fossasia/pslab-app' }} - env: - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} - run: | - cd ./iOS - git clone --branch=fastlane-ios --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} fastlane - fastlane setupCertificates - if [[ $? -ne 0 ]]; then - exit 1 - fi + if: needs.changes.outputs.is_code == 'true' - name: iOS Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/ios - with: - VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} - VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} - - name: Push app to testflight - if: ${{ github.repository == 'fossasia/pslab-app' }} - run: | - cd ./iOS - fastlane uploadToBeta - if [[ $? -ne 0 ]]; then - exit 1 - fi - - update-release: - name: Update Draft Release - needs: [ common, android, ios, windows, linux, linux-arm64, macos ] - runs-on: ubuntu-latest - steps: - - name: Run Release Drafter - uses: release-drafter/release-drafter@v7 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - version: ${{ needs.common.outputs.VERSION_NAME }} + - name: Non-Code Change + if: needs.changes.outputs.is_code != 'true' + run: echo "Non-code change detected." screenshots-android: name: Screenshots (Android) + needs: changes runs-on: ubuntu-latest timeout-minutes: 30 steps: - uses: actions/checkout@v6 + if: needs.changes.outputs.is_code == 'true' - name: Android Screenshot Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/screenshot-android with: ANDROID_EMULATOR_API: ${{ env.ANDROID_EMULATOR_API }} ANDROID_EMULATOR_ARCH: ${{ env.ANDROID_EMULATOR_ARCH }} + - name: Non-Code Change + if: needs.changes.outputs.is_code != 'true' + run: echo "Non-code change detected." + screenshots-iphone: name: Screenshots (iPhone) - runs-on: macos-latest + needs: changes + runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }} timeout-minutes: 30 steps: - name: Set up Xcode + if: needs.changes.outputs.is_code == 'true' uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '16.4.0' - uses: actions/checkout@v6 + if: needs.changes.outputs.is_code == 'true' - name: iPhone Screenshot Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/screenshot-iphone with: IPHONE_DEVICE_MODEL: ${{ env.IPHONE_DEVICE_MODEL }} - + + - name: Non-Code Change + if: needs.changes.outputs.is_code != 'true' + run: echo "Non-code change detected." + screenshots-ipad: name: Screenshots (iPad) - runs-on: macos-latest + needs: changes + runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }} timeout-minutes: 30 steps: - name: Set up Xcode + if: needs.changes.outputs.is_code == 'true' uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '16.4.0' - uses: actions/checkout@v6 + if: needs.changes.outputs.is_code == 'true' - name: iPad Screenshot Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/screenshot-ipad with: IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }} - + + - name: Non-Code Change + if: needs.changes.outputs.is_code != 'true' + run: echo "Non-code change detected." + windows: name: Windows Flutter Build - needs: common - runs-on: windows-latest + needs: [changes, common] + runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'windows-latest' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v6 + if: needs.changes.outputs.is_code == 'true' - name: Windows Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/windows - with: - VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} - VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} - - - name: Upload installer to apk branch - if: ${{ github.repository == 'fossasia/pslab-app' }} - shell: bash - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - git clone --branch=apk https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk - cd apk - - branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - echo "Removing previous files from branch" + - name: Non-Code Change + if: needs.changes.outputs.is_code != 'true' + run: echo "Non-code change detected." - rm -rf *.exe - - echo "Copying new build files" - - cp -v ../build/windows/x64/installer/Release/*.exe . - - echo "Pushing to apk branch" - - git checkout --orphan temporary - git add --all . - git commit -am "[Auto] Update Windows Installer from $branch ($(date +%Y-%m-%d.%H:%M:%S))" - git branch -D apk - git branch -m apk - git push --force origin apk - linux: name: Linux Flutter Build - needs: common + needs: [changes, common] runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + if: needs.changes.outputs.is_code == 'true' - name: Linux Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/linux - with: - VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} - VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} - - - name: Upload packages to apk branch - if: ${{ github.repository == 'fossasia/pslab-app' }} - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - git clone --branch=apk https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk - cd apk - - branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - - echo "Removing previous files from branch" - - find . -maxdepth 1 -type f -name '*.deb' ! -name '*arm64*' -delete - find . -maxdepth 1 -type f -name '*.rpm' ! -name '*aarch64*' -delete - - echo "Copying new build files" - - cp -v ../*.deb . - cp -v ../*.rpm . - echo "Pushing to apk branch" - - git checkout --orphan temporary - git add --all . - git commit -am "[Auto] Update Linux Packages from $branch ($(date +%Y-%m-%d.%H:%M:%S))" - git branch -D apk - git branch -m apk - git push --force origin apk + - name: Non-Code Change + if: needs.changes.outputs.is_code != 'true' + run: echo "Non-code change detected." linux-arm64: name: Linux ARM64 Flutter Build - needs: common - runs-on: ubuntu-24.04-arm + needs: [changes, common] + runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v6 + if: needs.changes.outputs.is_code == 'true' - name: Linux ARM64 Workflow + if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/linux-arm64 - with: - VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} - VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} - - - name: Upload packages to apk branch - if: ${{ github.repository == 'fossasia/pslab-app' }} - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - git clone --branch=apk https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk - cd apk - - branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - - echo "Removing previous files from branch" - rm -rf *arm64*.deb *aarch64*.rpm - - echo "Copying new build files" - - cp -v ../*.deb . - cp -v ../*.rpm . - - echo "Pushing to apk branch" - - git checkout --orphan temporary - git add --all . - git commit -am "[Auto] Update Linux ARM64 Packages from $branch ($(date +%Y-%m-%d.%H:%M:%S))" - git branch -D apk - git branch -m apk - git push --force origin apk + - name: Non-Code Change + if: needs.changes.outputs.is_code != 'true' + run: echo "Non-code change detected." macos: name: macOS Flutter Build - needs: common - runs-on: macos-latest + needs: [changes, common] + runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }} steps: - - uses: actions/checkout@v6 - - - name: macOS Workflow - uses: ./.github/actions/macos + - name: Set up Xcode + if: needs.changes.outputs.is_code == 'true' + uses: maxim-lobanov/setup-xcode@v1.7.0 with: - VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} - VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} - - - name: Upload dmg to apk branch - if: ${{ github.repository == 'fossasia/pslab-app' }} - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - git clone --branch=apk https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk - cd apk - - branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - - echo "Removing previous files from branch" - - rm -rf *.dmg - - echo "Copying new build files" + xcode-version: '16.4.0' - cp -v ../*.dmg . + - uses: actions/checkout@v6 + if: needs.changes.outputs.is_code == 'true' - echo "Pushing to apk branch" + - name: macOS Workflow + if: needs.changes.outputs.is_code == 'true' + uses: ./.github/actions/macos - git checkout --orphan temporary - git add --all . - git commit -am "[Auto] Update macOS DMG from $branch ($(date +%Y-%m-%d.%H:%M:%S))" - git branch -D apk - git branch -m apk - git push --force origin apk + - name: Non-Code Change + if: needs.changes.outputs.is_code != 'true' + run: echo "Non-code change detected." From 24a2e9805a2805837db1be6a0c10f29d78616e20 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 16:42:00 +0530 Subject: [PATCH 16/19] Update pull-request.yml --- .github/workflows/pull-request.yml | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 26614eb91..21d321c60 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -19,25 +19,22 @@ jobs: name: Detect Changes runs-on: ubuntu-latest outputs: - is_code: ${{ steps.filter.outputs.code }} + is_code: ${{ steps.check.outputs.is_code }} steps: - uses: actions/checkout@v6 - - uses: dorny/paths-filter@v3 - id: filter with: - filters: | - code: - - '**' - - '!**/*.md' - - '!docs/**/*' - - '!**/*.png' - - '!**/*.jpg' - - '!**/*.jpeg' - - '!**/*.gif' - - '!**/*.svg' - - '!**/*.webp' - - '!**/*.txt' - - '!**/*.arb' + fetch-depth: 0 + + - id: check + run: | + # Diff the actual commit SHAs. + # grep -vE removes your media/doc extensions. grep -v removes the docs folder. + # If anything is left over, it's code. If the output is empty, it's just docs. + if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -vE '\.(md|png|jpg|jpeg|gif|svg|webp|txt|arb)$' | grep -v '^docs/'; then + echo "is_code=true" >> $GITHUB_OUTPUT + else + echo "is_code=false" >> $GITHUB_OUTPUT + fi common: name: Common Build From 90232976e9b7aab91d657706d601f4477de7c6df Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 17:07:30 +0530 Subject: [PATCH 17/19] Update pull-request.yml From 23d82c6293cbd1616bf2aedc801d063e7d1c00c4 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 12 Apr 2026 17:11:51 +0530 Subject: [PATCH 18/19] Update push-event.yml --- .github/workflows/push-event.yml | 428 ++++++++++++++++++++++--------- 1 file changed, 311 insertions(+), 117 deletions(-) diff --git a/.github/workflows/push-event.yml b/.github/workflows/push-event.yml index 21d321c60..2bc59e548 100644 --- a/.github/workflows/push-event.yml +++ b/.github/workflows/push-event.yml @@ -1,12 +1,19 @@ -name: Build +name: Push on: - pull_request: + push: branches: ["flutter"] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + paths-ignore: + - '**.md' + - 'docs/**' + - '**.png' + - '**.jpg' + - '**.jpeg' + - '**.gif' + - '**.svg' + - '**.webp' + - '**.txt' + - '**.arb' env: ANDROID_EMULATOR_API: 34 @@ -15,229 +22,416 @@ env: IPAD_DEVICE_MODEL: iPad Pro 13-inch (M4) jobs: - changes: - name: Detect Changes - runs-on: ubuntu-latest - outputs: - is_code: ${{ steps.check.outputs.is_code }} - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - id: check - run: | - # Diff the actual commit SHAs. - # grep -vE removes your media/doc extensions. grep -v removes the docs folder. - # If anything is left over, it's code. If the output is empty, it's just docs. - if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -vE '\.(md|png|jpg|jpeg|gif|svg|webp|txt|arb)$' | grep -v '^docs/'; then - echo "is_code=true" >> $GITHUB_OUTPUT - else - echo "is_code=false" >> $GITHUB_OUTPUT - fi - common: name: Common Build - needs: changes runs-on: ubuntu-latest + outputs: + VERSION_NAME: ${{ steps.flutter-version.outputs.VERSION_NAME }} + VERSION_CODE: ${{ steps.flutter-version.outputs.VERSION_CODE }} steps: - uses: actions/checkout@v6 - if: needs.changes.outputs.is_code == 'true' - name: Common Workflow - if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/common - - name: Save PR number - if: needs.changes.outputs.is_code == 'true' + - name: Hydrate and Update Version + id: flutter-version run: | - mkdir -p ./pr - echo ${{ github.event.number }} > ./pr/NR + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + # Get commit message + commit_message=$(git log -1 --pretty=format:"%s") + + git clone --branch=version https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} version + cd version - - uses: actions/upload-artifact@v7 - if: needs.changes.outputs.is_code == 'true' - with: - name: pr - path: pr/ + # Read and increment version name + IFS='.' read -r major minor patch < versionName.txt + + if [[ "$commit_message" =~ ^feat: ]]; then + next_minor=$((minor + 1)) + next_patch=0 + else + next_minor=$((minor)) + next_patch=$((patch + 1)) + fi + next_version_name="$major.$next_minor.$next_patch" + echo "VERSION_NAME=$next_version_name" >> $GITHUB_OUTPUT + echo "$next_version_name" > versionName.txt - - name: Non-Code Change - if: needs.changes.outputs.is_code != 'true' - run: echo "Non-code change detected." + # Read and increment version code + read -r version_code < versionCode.txt + + new_version_code=$((version_code + 1)) + echo "VERSION_CODE=$new_version_code" >> $GITHUB_OUTPUT + echo "$new_version_code" > versionCode.txt + + # Force push to version branch + git checkout --orphan temporary + git add --all . + git commit -am "[Auto] Update versionName: $next_version_name & versionCode: $new_version_code ($(date +%Y-%m-%d.%H:%M:%S))" + git branch -D version + git branch -m version + git push --force origin version android: name: Android Flutter Build - needs: [changes, common] + needs: common runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - if: needs.changes.outputs.is_code == 'true' + + - name: Prepare Build Keys + if: ${{ github.repository == 'fossasia/pslab-app' }} + env: + ENCRYPTED_F10B5E0E5262_IV: ${{ secrets.ENCRYPTED_F10B5E0E5262_IV }} + ENCRYPTED_F10B5E0E5262_KEY: ${{ secrets.ENCRYPTED_F10B5E0E5262_KEY }} + run: | + bash scripts/prep-android-key.sh - name: Android Workflow - if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/android + with: + STORE_PASS: ${{ secrets.STORE_PASS }} + ALIAS: ${{ secrets.ALIAS }} + KEY_PASS: ${{ secrets.KEY_PASS }} + VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} + VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} + + - name: Upload APK + uses: actions/upload-artifact@v7 + with: + name: APK Generated + path: build/app/outputs/flutter-apk - - name: Non-Code Change - if: needs.changes.outputs.is_code != 'true' - run: echo "Non-code change detected." + - name: Upload AAB Release + uses: actions/upload-artifact@v7 + with: + name: AAB Generated + path: build/app/outputs/bundle + + - name: Upload APK/AAB to apk branch + if: ${{ github.repository == 'fossasia/pslab-app' }} + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git clone --branch=apk https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk + cd apk + + branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} + + echo "Removing previous files from branch" + + rm -rf pslab-$branch* + + ls + + echo "Copying new build files" + + find ../build/app/outputs/flutter-apk -type f \( -name '*release.apk' -o -name '*release.aab' \) -exec cp -v {} . \; + find ../build/app/outputs/bundle -type f \( -name '*release.apk' -o -name '*release.aab' \) -exec cp -v {} . \; + + ls + + echo "Renaming new build files" + + for file in app*; do + mv $file pslab-$branch-${file#*-} + done + + ls + + echo "Pushing to apk branch" + + git checkout --orphan temporary + git add --all . + git commit -am "[Auto] Update APK/AABs from $branch ($(date +%Y-%m-%d.%H:%M:%S))" + git branch -D apk + git branch -m apk + git push --force origin apk + + - name: Update app in Open Testing track + if: ${{ github.repository == 'fossasia/pslab-app' }} + run: | + git clone --branch=fastlane-android --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} fastlane + fastlane uploadToOpenTesting + if [[ $? -ne 0 ]]; then + exit 1 + fi ios: name: iOS Flutter Build - needs: [changes, common] - runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }} + needs: common + runs-on: macos-latest steps: - name: Set up Xcode - if: needs.changes.outputs.is_code == 'true' uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '16.4.0' - uses: actions/checkout@v6 - if: needs.changes.outputs.is_code == 'true' + + - name: Prepare Build Keys + if: ${{ github.repository == 'fossasia/pslab-app' }} + env: + ENCRYPTED_IOS_IV: ${{ secrets.ENCRYPTED_IOS_IV }} + ENCRYPTED_IOS_KEY: ${{ secrets.ENCRYPTED_IOS_KEY }} + run: | + bash scripts/prep-ios-key.sh + + - name: Setup Certs + if: ${{ github.repository == 'fossasia/pslab-app' }} + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} + run: | + cd ./iOS + git clone --branch=fastlane-ios --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} fastlane + fastlane setupCertificates + if [[ $? -ne 0 ]]; then + exit 1 + fi - name: iOS Workflow - if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/ios + with: + VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} + VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} - - name: Non-Code Change - if: needs.changes.outputs.is_code != 'true' - run: echo "Non-code change detected." + - name: Push app to testflight + if: ${{ github.repository == 'fossasia/pslab-app' }} + run: | + cd ./iOS + fastlane uploadToBeta + if [[ $? -ne 0 ]]; then + exit 1 + fi + + update-release: + name: Update Draft Release + needs: [ common, android, ios, windows, linux, linux-arm64, macos ] + runs-on: ubuntu-latest + steps: + - name: Run Release Drafter + uses: release-drafter/release-drafter@v7 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + version: ${{ needs.common.outputs.VERSION_NAME }} screenshots-android: name: Screenshots (Android) - needs: changes runs-on: ubuntu-latest timeout-minutes: 30 steps: - uses: actions/checkout@v6 - if: needs.changes.outputs.is_code == 'true' - name: Android Screenshot Workflow - if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/screenshot-android with: ANDROID_EMULATOR_API: ${{ env.ANDROID_EMULATOR_API }} ANDROID_EMULATOR_ARCH: ${{ env.ANDROID_EMULATOR_ARCH }} - - name: Non-Code Change - if: needs.changes.outputs.is_code != 'true' - run: echo "Non-code change detected." - screenshots-iphone: name: Screenshots (iPhone) - needs: changes - runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }} + runs-on: macos-latest timeout-minutes: 30 steps: - name: Set up Xcode - if: needs.changes.outputs.is_code == 'true' uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '16.4.0' - uses: actions/checkout@v6 - if: needs.changes.outputs.is_code == 'true' - name: iPhone Screenshot Workflow - if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/screenshot-iphone with: IPHONE_DEVICE_MODEL: ${{ env.IPHONE_DEVICE_MODEL }} - - - name: Non-Code Change - if: needs.changes.outputs.is_code != 'true' - run: echo "Non-code change detected." - + screenshots-ipad: name: Screenshots (iPad) - needs: changes - runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }} + runs-on: macos-latest timeout-minutes: 30 steps: - name: Set up Xcode - if: needs.changes.outputs.is_code == 'true' uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '16.4.0' - uses: actions/checkout@v6 - if: needs.changes.outputs.is_code == 'true' - name: iPad Screenshot Workflow - if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/screenshot-ipad with: IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }} - - - name: Non-Code Change - if: needs.changes.outputs.is_code != 'true' - run: echo "Non-code change detected." - + windows: name: Windows Flutter Build - needs: [changes, common] - runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'windows-latest' || 'ubuntu-latest' }} + needs: common + runs-on: windows-latest steps: - uses: actions/checkout@v6 - if: needs.changes.outputs.is_code == 'true' - name: Windows Workflow - if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/windows + with: + VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} + VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} + + - name: Upload installer to apk branch + if: ${{ github.repository == 'fossasia/pslab-app' }} + shell: bash + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git clone --branch=apk https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk + cd apk + + branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - - name: Non-Code Change - if: needs.changes.outputs.is_code != 'true' - run: echo "Non-code change detected." + echo "Removing previous files from branch" + rm -rf *.exe + + echo "Copying new build files" + + cp -v ../build/windows/x64/installer/Release/*.exe . + + echo "Pushing to apk branch" + + git checkout --orphan temporary + git add --all . + git commit -am "[Auto] Update Windows Installer from $branch ($(date +%Y-%m-%d.%H:%M:%S))" + git branch -D apk + git branch -m apk + git push --force origin apk + linux: name: Linux Flutter Build - needs: [changes, common] + needs: common runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - if: needs.changes.outputs.is_code == 'true' - name: Linux Workflow - if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/linux + with: + VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} + VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} + + - name: Upload packages to apk branch + if: ${{ github.repository == 'fossasia/pslab-app' }} + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git clone --branch=apk https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk + cd apk + + branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} + + echo "Removing previous files from branch" + + find . -maxdepth 1 -type f -name '*.deb' ! -name '*arm64*' -delete + find . -maxdepth 1 -type f -name '*.rpm' ! -name '*aarch64*' -delete + + echo "Copying new build files" + + cp -v ../*.deb . + cp -v ../*.rpm . - - name: Non-Code Change - if: needs.changes.outputs.is_code != 'true' - run: echo "Non-code change detected." + echo "Pushing to apk branch" + + git checkout --orphan temporary + git add --all . + git commit -am "[Auto] Update Linux Packages from $branch ($(date +%Y-%m-%d.%H:%M:%S))" + git branch -D apk + git branch -m apk + git push --force origin apk linux-arm64: name: Linux ARM64 Flutter Build - needs: [changes, common] - runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} + needs: common + runs-on: ubuntu-24.04-arm steps: - uses: actions/checkout@v6 - if: needs.changes.outputs.is_code == 'true' - name: Linux ARM64 Workflow - if: needs.changes.outputs.is_code == 'true' uses: ./.github/actions/linux-arm64 + with: + VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} + VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} + + - name: Upload packages to apk branch + if: ${{ github.repository == 'fossasia/pslab-app' }} + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git clone --branch=apk https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk + cd apk + + branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} + + echo "Removing previous files from branch" - - name: Non-Code Change - if: needs.changes.outputs.is_code != 'true' - run: echo "Non-code change detected." + rm -rf *arm64*.deb *aarch64*.rpm + + echo "Copying new build files" + + cp -v ../*.deb . + cp -v ../*.rpm . + + echo "Pushing to apk branch" + + git checkout --orphan temporary + git add --all . + git commit -am "[Auto] Update Linux ARM64 Packages from $branch ($(date +%Y-%m-%d.%H:%M:%S))" + git branch -D apk + git branch -m apk + git push --force origin apk macos: name: macOS Flutter Build - needs: [changes, common] - runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }} + needs: common + runs-on: macos-latest steps: - - name: Set up Xcode - if: needs.changes.outputs.is_code == 'true' - uses: maxim-lobanov/setup-xcode@v1.7.0 - with: - xcode-version: '16.4.0' - - uses: actions/checkout@v6 - if: needs.changes.outputs.is_code == 'true' - name: macOS Workflow - if: needs.changes.outputs.is_code == 'true' - uses: ./.github/actions/macos + uses: ./.github/actions/macos + with: + VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} + VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} + + - name: Upload dmg to apk branch + if: ${{ github.repository == 'fossasia/pslab-app' }} + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git clone --branch=apk https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk + cd apk + + branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} + + echo "Removing previous files from branch" + + rm -rf *.dmg + + echo "Copying new build files" + + cp -v ../*.dmg . + + echo "Pushing to apk branch" - - name: Non-Code Change - if: needs.changes.outputs.is_code != 'true' - run: echo "Non-code change detected." + git checkout --orphan temporary + git add --all . + git commit -am "[Auto] Update macOS DMG from $branch ($(date +%Y-%m-%d.%H:%M:%S))" + git branch -D apk + git branch -m apk + git push --force origin apk From 4d514aee4a4e9e083253129fae143e7a3a1713ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 04:14:43 +0000 Subject: [PATCH 19/19] chore: Upgrade Flutter to 3.41.9 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a1dda0b13..c2179f15f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ version: 1.0.0+1 environment: sdk: ^3.5.4 - flutter: '3.41.6' + flutter: '3.41.9' dependencies: flutter: