Skip to content
Open
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
63 changes: 49 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,28 @@ jobs:
build:
runs-on: macos-latest

strategy:
matrix:
include:
- flutter-version: '3.27.3'
build: cocoapods
- flutter-version: '3.44.0'
build: android
- flutter-version: '3.44.0'
build: spm

env:
FLUTTER_CHANNEL: stable
FLUTTER_VERSION: 3.27.3

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: fetch submodules
- name: Fetch submodules
run: git submodule update --init --recursive

- name: Set up JDK 17
if: matrix.build != 'spm'
uses: actions/setup-java@v3
with:
java-version: 17
Expand All @@ -30,30 +40,55 @@ jobs:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
flutter-version: ${{ matrix.flutter-version }}
channel: ${{ env.FLUTTER_CHANNEL }}

- name: Install dependencies
working-directory: example
run: flutter pub get

- run: echo API_KEY=${{ secrets.TEST_API_KEY }} > example/.env
- name: Build Android
working-directory: example
run: flutter build apk --release

- name: Copy iOS
- name: Copy Confidence sources for CocoaPods
if: matrix.build == 'cocoapods'
working-directory: ios/Classes
run: cp -r confidence-sdk/Sources/Confidence .

- name: Remove the submodule
if: matrix.build == 'cocoapods'
working-directory: ios/Classes
run: rm -rf confidence-sdk

- name: Remove git submodule
if: matrix.build == 'cocoapods'
working-directory: ios/Classes
run: git rm confidence-sdk

- name: Build iOS
- name: Install dependencies
if: matrix.build != 'spm'
working-directory: example
run: flutter pub get

- run: echo API_KEY=${{ secrets.TEST_API_KEY }} > example/.env
if: matrix.build != 'spm'

- name: Build Android
if: matrix.build != 'spm'
working-directory: example
run: flutter build apk --release

- name: Build iOS (CocoaPods)
if: matrix.build == 'cocoapods'
working-directory: example
run: flutter build ios --release --no-codesign

- name: Copy Confidence sources for SPM
if: matrix.build == 'spm'
run: cp -r ios/Classes/confidence-sdk/Sources/Confidence ios/confidence_flutter_sdk/Sources/confidence_flutter_sdk/

- name: Prepare plugin without git context
if: matrix.build == 'spm'
run: |
mkdir -p /tmp/confidence_flutter_sdk
rsync -a --exclude='.git' --exclude='ios/Classes/confidence-sdk' . /tmp/confidence_flutter_sdk/

- run: echo API_KEY=dummy > /tmp/confidence_flutter_sdk/example/.env
if: matrix.build == 'spm'
- name: Build iOS (SPM)
if: matrix.build == 'spm'
working-directory: /tmp/confidence_flutter_sdk/example
run: flutter build ios --no-codesign
13 changes: 5 additions & 8 deletions ios/confidence_flutter_sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@
Pod::Spec.new do |s|
s.name = 'confidence_flutter_sdk'
s.version = '0.0.1'
s.summary = 'A new Flutter plugin project.'
s.description = <<-DESC
A new Flutter plugin project.
DESC
s.homepage = 'http://example.com'
s.summary = 'Flutter plugin for the Confidence SDK.'
s.description = 'Flutter plugin for the Confidence SDK.'
s.homepage = 'https://confidence.spotify.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.author = { 'Confidence' => 'confidence@spotify.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.source_files = 'confidence_flutter_sdk/Sources/confidence_flutter_sdk/**/*.swift', 'Classes/Confidence/**/*.swift'
s.dependency 'Flutter'
s.platform = :ios, '14.0'

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
s.swift_version = '5.0'
end
2 changes: 2 additions & 0 deletions ios/confidence_flutter_sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.build/
Package.resolved
24 changes: 24 additions & 0 deletions ios/confidence_flutter_sdk/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// swift-tools-version: 5.9

import PackageDescription

let package = Package(
name: "confidence_flutter_sdk",
platforms: [
.iOS("14.0"),
],
products: [
.library(name: "confidence-flutter-sdk", targets: ["confidence_flutter_sdk"]),
],
dependencies: [
.package(name: "FlutterFramework", path: "../FlutterFramework"),
],
targets: [
.target(
name: "confidence_flutter_sdk",
dependencies: [
.product(name: "FlutterFramework", package: "FlutterFramework"),
]
),
]
)
Loading