Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/actions/cache-cocoapods/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Cache CocoaPods'
description: 'Cache CocoaPods dependencies for sample_app iOS builds'
inputs:
key-suffix:
description: 'Cache key suffix (e.g. runner.os or iOS version from matrix)'
required: true
runs:
using: "composite"
steps:
- uses: actions/cache@v6
with:
path: |
sample_app/ios/Pods
sample_app/ios/Podfile.lock
~/Library/Caches/CocoaPods
key: pods-${{ inputs.key-suffix }}-${{ hashFiles('sample_app/pubspec.lock', 'sample_app/ios/Podfile') }}
restore-keys: pods-${{ inputs.key-suffix }}-
13 changes: 13 additions & 0 deletions .github/actions/cache-gradle/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Cache Gradle'
description: 'Cache Gradle dependencies for sample_app Android builds'
runs:
using: "composite"
steps:
- uses: actions/cache@v6
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
sample_app/android/.gradle
key: gradle-${{ runner.os }}-${{ hashFiles('sample_app/android/gradle/wrapper/gradle-wrapper.properties', 'sample_app/android/app/build.gradle', 'sample_app/android/build.gradle', 'sample_app/android/settings.gradle', '**/pubspec.lock') }}
restore-keys: gradle-${{ runner.os }}-
25 changes: 25 additions & 0 deletions .github/actions/cache-xcode-cas/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Cache Xcode CAS'
description: 'Persist Xcode compilation cache (LLVM CAS) across CI runs'
inputs:
key-suffix:
description: 'Cache key suffix (e.g. runner.os or iOS version from matrix)'
required: true
xcode-version:
description: 'Xcode version for the cache key'
required: false
default: '26.2'
runs:
using: "composite"
steps:
- shell: bash
run: |
echo "FLUTTER_XCODE_COMPILATION_CACHE_ENABLE_CACHING=YES" >> "$GITHUB_ENV"
echo "FLUTTER_XCODE_SWIFT_ENABLE_COMPILE_CACHE=YES" >> "$GITHUB_ENV"
echo "FLUTTER_XCODE_CLANG_ENABLE_COMPILE_CACHE=YES" >> "$GITHUB_ENV"
echo "FLUTTER_XCODE_COMPILATION_CACHE_CAS_PATH=$HOME/xcode-cas" >> "$GITHUB_ENV"
mkdir -p "$HOME/xcode-cas"
- uses: actions/cache@v6
with:
path: ~/xcode-cas
key: xcode-cas-${{ inputs.xcode-version }}-${{ inputs.key-suffix }}-${{ hashFiles('sample_app/pubspec.lock', 'sample_app/ios/Podfile', 'sample_app/ios/Runner.xcodeproj/project.pbxproj') }}
restore-keys: xcode-cas-${{ inputs.xcode-version }}-${{ inputs.key-suffix }}-
11 changes: 11 additions & 0 deletions .github/actions/enable-kvm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'Enable KVM'
description: 'Configure KVM permissions for Android emulator on Linux runners'
runs:
using: "composite"
steps:
- name: Enable KVM
shell: bash
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
1 change: 1 addition & 0 deletions .github/actions/package_analysis/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Package Analysis
description: Package Analysis

runs:
using: "composite"
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/pana/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Pana Workflow
description: 'Run pana package analysis and verify the score meets the minimum threshold'

inputs:
min_score:
Expand Down Expand Up @@ -28,7 +29,7 @@ runs:
yq eval '.dependencies.stream_chat = {"path": "../stream_chat"}' -i packages/stream_chat_flutter_core/pubspec.yaml
yq eval '.dependencies.stream_chat_flutter_core = {"path": "../stream_chat_flutter_core"}' -i packages/stream_chat_flutter/pubspec.yaml
yq eval '.dependencies.stream_chat = {"path": "../stream_chat"}' -i packages/stream_chat_persistence/pubspec.yaml

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
Expand Down
12 changes: 12 additions & 0 deletions .github/actions/setup-flutter/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Setup Flutter'
description: 'Install Flutter with dependency caching'
runs:
using: "composite"
steps:
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.x"
channel: stable
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:"
pub-cache-key: "flutter-pub-:os:-${{ hashFiles('melos.yaml', '**/pubspec.yaml') }}"
46 changes: 46 additions & 0 deletions .github/actions/setup-ios-runtime/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Setup iOS Runtime
description: Download and install a requested iOS simulator runtime
inputs:
version:
description: iOS runtime version (e.g. 17.5)
required: true
device:
description: Simulator device type (e.g. iPhone 15 Pro)
required: true
runs:
using: composite
steps:
- name: Install ipsw
shell: bash
run: |
IPSW_VERSION=3.1.592
FILE="ipsw_${IPSW_VERSION}_macOS_universal.tar.gz"
if ! command -v ipsw >/dev/null; then
wget -q "https://github.com/blacktop/ipsw/releases/download/v${IPSW_VERSION}/${FILE}"
tar -xzf "$FILE"
chmod +x ipsw
sudo mv ipsw /usr/local/bin/
rm -f "$FILE"
fi

- name: Setup iOS simulator runtime
shell: bash
run: sudo rm -rfv ~/Library/Developer/CoreSimulator/* || true

- name: Install iOS runtime
shell: bash
working-directory: sample_app/ios
run: bundle exec fastlane install_runtime ios:${{ inputs.version }}

- name: Cleanup iOS runtime install artifacts
shell: bash
run: |
sudo rm -rfv sample_app/*.dmg || true
xcrun simctl list runtimes

- name: Create custom iOS simulator
shell: bash
run: |
ios_version_dash=$(echo "${{ inputs.version }}" | tr '.' '-')
xcrun simctl create custom-test-device "${{ inputs.device }}" "com.apple.CoreSimulator.SimRuntime.iOS-${ios_version_dash}"
xcrun simctl list devices "${{ inputs.version }}"
9 changes: 9 additions & 0 deletions .github/actions/setup-java/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'Setup Java'
description: 'Install Java'
runs:
using: "composite"
steps:
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
10 changes: 10 additions & 0 deletions .github/actions/setup-ruby/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Setup Ruby'
description: 'Install Ruby and Cache Gems'
runs:
using: "composite"
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
working-directory: sample_app
34 changes: 7 additions & 27 deletions .github/workflows/distribute_external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ on:
- ios
- both

env:
FLUTTER_VERSION: '3.x'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -37,19 +35,19 @@ jobs:
run: |
# Is this a release?
is_release="${{ github.event_name == 'release' }}"

# If it's a release event, build both platforms
if [[ "$is_release" == "true" ]]; then
echo "Building all platforms due to release"
echo "run_ios=true" >> $GITHUB_OUTPUT
echo "run_android=true" >> $GITHUB_OUTPUT
exit 0
fi

# For manual workflow dispatch, store platform in a variable
platform="${{ github.event.inputs.platform }}"
echo "Selected platform: $platform"

# Set outputs only if they should be true
[[ "$platform" == "ios" || "$platform" == "both" ]] && echo "run_ios=true" >> $GITHUB_OUTPUT || true
[[ "$platform" == "android" || "$platform" == "both" ]] && echo "run_android=true" >> $GITHUB_OUTPUT || true
Expand All @@ -69,18 +67,9 @@ jobs:
with:
fetch-depth: 0

- name: "Install Flutter"
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- uses: ./.github/actions/setup-flutter

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: sample_app/android
- uses: ./.github/actions/setup-ruby

- name: Distribute to S3
working-directory: sample_app/android
Expand Down Expand Up @@ -110,21 +99,12 @@ jobs:
with:
xcode-version: '26.3'

- name: "Install Flutter"
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- uses: ./.github/actions/setup-flutter

- name: "Disable Swift Package Manager"
run: flutter config --no-enable-swift-package-manager

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: sample_app/ios
- uses: ./.github/actions/setup-ruby

- name: Distribute to TestFlight
working-directory: sample_app/ios
Expand Down
47 changes: 9 additions & 38 deletions .github/workflows/distribute_internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ on:
- ios
- both

env:
FLUTTER_VERSION: '3.x'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -40,19 +38,19 @@ jobs:
run: |
# Is this a branch push?
is_branch_push="${{ github.event_name == 'push' }}"

# If it's a branch push, build both platforms
if [[ "$is_branch_push" == "true" ]]; then
echo "Building all platforms due to branch push"
echo "run_ios=true" >> $GITHUB_OUTPUT
echo "run_android=true" >> $GITHUB_OUTPUT
exit 0
fi

# For manual workflow dispatch, store platform in a variable
platform="${{ github.event.inputs.platform }}"
echo "Selected platform: $platform"

Comment thread
testableapple marked this conversation as resolved.
# Set outputs only if they should be true
[[ "$platform" == "ios" || "$platform" == "both" ]] && echo "run_ios=true" >> $GITHUB_OUTPUT || true
[[ "$platform" == "android" || "$platform" == "both" ]] && echo "run_android=true" >> $GITHUB_OUTPUT || true
Expand All @@ -73,24 +71,15 @@ jobs:
with:
fetch-depth: 0

- name: "Install Flutter"
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- uses: ./.github/actions/setup-flutter

- name: "Install Tools"
run: flutter pub global activate melos

- name: "Bootstrap Workspace"
run: melos bootstrap

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: sample_app/android
- uses: ./.github/actions/setup-ruby

- name: Setup Firebase Service Account'
working-directory: sample_app/android
Expand Down Expand Up @@ -120,12 +109,7 @@ jobs:
with:
xcode-version: '26.3'

- name: "Install Flutter"
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- uses: ./.github/actions/setup-flutter

- name: "Disable Swift Package Manager"
run: flutter config --no-enable-swift-package-manager
Expand All @@ -136,11 +120,7 @@ jobs:
- name: "Bootstrap Workspace"
run: melos bootstrap

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: sample_app/ios
- uses: ./.github/actions/setup-ruby

- name: Setup Firebase Service Account
working-directory: sample_app/ios
Expand Down Expand Up @@ -173,12 +153,7 @@ jobs:
with:
xcode-version: '26.3'

- name: "Install Flutter"
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- uses: ./.github/actions/setup-flutter

- name: "Disable Swift Package Manager"
run: flutter config --no-enable-swift-package-manager
Expand All @@ -189,11 +164,7 @@ jobs:
- name: "Bootstrap Workspace"
run: melos bootstrap

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: sample_app/ios
- uses: ./.github/actions/setup-ruby

- name: Distribute to TestFlight Internal
working-directory: sample_app/ios
Expand Down
Loading
Loading