Skip to content

Commit f077ac1

Browse files
authored
Release 1.8.0 #71
#71
2 parents ad7d4de + eb9c5d2 commit f077ac1

File tree

15 files changed

+208
-110
lines changed

15 files changed

+208
-110
lines changed

.github/workflows/ci.yaml

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
test-ios:
15-
runs-on: macos-13
15+
runs-on: macos-14
1616
defaults:
1717
run:
1818
working-directory: "./example"
@@ -21,11 +21,14 @@ jobs:
2121
- uses: actions/setup-node@v4
2222
with:
2323
node-version-file: "./.tool-versions"
24-
- run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
24+
# Xcode_16.2.app is available, but it does not have any simulator pre-installed.
25+
# So it is not really usable.
26+
# Let's use Xcode_16.1.app instead.
27+
- run: sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer
2528
- uses: subosito/flutter-action@v2
2629
with:
2730
# This has to be kept in sync with .tool-versions
28-
flutter-version: '3.24.2'
31+
flutter-version: '3.27.1'
2932
channel: 'stable'
3033
# This action takes 1m30s to finish. Enable cache to make it shorter.
3134
cache: true
@@ -36,7 +39,7 @@ jobs:
3639
- run: flutter build ipa --no-codesign
3740

3841
test-android:
39-
runs-on: macos-13
42+
runs-on: macos-14
4043
defaults:
4144
run:
4245
working-directory: "./example"
@@ -45,14 +48,14 @@ jobs:
4548
- uses: actions/setup-node@v4
4649
with:
4750
node-version-file: "./.tool-versions"
48-
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#java
51+
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md#java
4952
- name: Set java version
5053
run: |
51-
echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
54+
echo "JAVA_HOME=$JAVA_HOME_21_arm64" >> $GITHUB_ENV
5255
- uses: subosito/flutter-action@v2
5356
with:
5457
# This has to be kept in sync with .tool-versions
55-
flutter-version: '3.24.2'
58+
flutter-version: '3.27.1'
5659
channel: 'stable'
5760
# This action takes 1m30s to finish. Enable cache to make it shorter.
5861
cache: true
@@ -71,7 +74,7 @@ jobs:
7174
- uses: subosito/flutter-action@v2
7275
with:
7376
# This has to be kept in sync with .tool-versions
74-
flutter-version: '3.24.2'
77+
flutter-version: '3.27.1'
7578
channel: 'stable'
7679
# This action takes 1m30s to finish. Enable cache to make it shorter.
7780
cache: true
@@ -93,9 +96,10 @@ jobs:
9396
publish_dir: ./doc/api
9497

9598
deploy-ios:
96-
runs-on: macos-13
99+
runs-on: macos-14
97100
needs: ["test-ios"]
98-
if: ${{ github.ref == 'refs/heads/main' }}
101+
# We cannot build in PRs because secrets are not available in PRs.
102+
if: ${{ github.repository == 'authgear/authgear-sdk-flutter' && github.ref == 'refs/heads/main' }}
99103
defaults:
100104
run:
101105
working-directory: "./example"
@@ -104,12 +108,15 @@ jobs:
104108
- uses: actions/setup-node@v4
105109
with:
106110
node-version-file: "./.tool-versions"
107-
- run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
111+
# Xcode_16.2.app is available, but it does not have any simulator pre-installed.
112+
# So it is not really usable.
113+
# Let's use Xcode_16.1.app instead.
114+
- run: sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer
108115
- run: npm install -g appcenter-cli
109116
- uses: subosito/flutter-action@v2
110117
with:
111118
# This has to be kept in sync with .tool-versions
112-
flutter-version: '3.24.2'
119+
flutter-version: '3.27.1'
113120
channel: 'stable'
114121
# This action takes 1m30s to finish. Enable cache to make it shorter.
115122
cache: true
@@ -119,23 +126,31 @@ jobs:
119126
- run: dart format --set-exit-if-changed lib
120127
- name: Prepare certificate and provisioning profile
121128
env:
129+
IOS_CERTIFICATE_PASSWORD: ${{ secrets.IOS_CERTIFICATE_PASSWORD }}
122130
IOS_CERTIFICATE_BASE64: ${{ secrets.IOS_CERTIFICATE_BASE64 }}
123131
IOS_PROVISIONING_PROFILE_BASE64: ${{ secrets.IOS_PROVISIONING_PROFILE_BASE64 }}
132+
IOS_KEYCHAIN_PASSWORD: ${{ secrets.IOS_KEYCHAIN_PASSWORD }}
124133
run: |
125134
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
126135
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
127136
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
128137
138+
# import certificate and provisioning profile from secrets
129139
echo -n "$IOS_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
140+
130141
echo -n "$IOS_PROVISIONING_PROFILE_BASE64" | base64 --decode -o $PP_PATH
131142
132-
security create-keychain -p "" $KEYCHAIN_PATH
133-
security set-keychain-settings $KEYCHAIN_PATH
134-
security unlock-keychain -p "" $KEYCHAIN_PATH
143+
# create temporary keychain
144+
security create-keychain -p "$IOS_KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
145+
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
146+
security unlock-keychain -p "$IOS_KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
135147
136-
security import $CERTIFICATE_PATH -P "" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
148+
# import certificate to keychain
149+
security import $CERTIFICATE_PATH -P "$IOS_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
150+
security set-key-partition-list -S apple-tool:,apple: -k "$IOS_KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
137151
security list-keychain -d user -s $KEYCHAIN_PATH
138152
153+
# apply provisioning profile
139154
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
140155
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
141156
- name: Build .ipa
@@ -148,9 +163,10 @@ jobs:
148163
run: appcenter distribute release --debug --silent --file "./build/ios/ipa/Authgear Flutter.ipa" --store "App Store Connect Users" --app "Oursky/Authgear-Demo-Flutter-iOS" --release-notes "no release notes"
149164

150165
deploy-android:
151-
runs-on: macos-13
166+
runs-on: macos-14
152167
needs: ["test-android"]
153-
if: ${{ github.ref == 'refs/heads/main' }}
168+
# We cannot build in PRs because secrets are not available in PRs.
169+
if: ${{ github.repository == 'authgear/authgear-sdk-flutter' && github.ref == 'refs/heads/main' }}
154170
defaults:
155171
run:
156172
working-directory: "./example"
@@ -159,15 +175,15 @@ jobs:
159175
- uses: actions/setup-node@v4
160176
with:
161177
node-version-file: "./.tool-versions"
162-
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#java
178+
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md#java
163179
- name: Set java version
164180
run: |
165-
echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
181+
echo "JAVA_HOME=$JAVA_HOME_21_arm64" >> $GITHUB_ENV
166182
- run: npm install -g appcenter-cli
167183
- uses: subosito/flutter-action@v2
168184
with:
169185
# This has to be kept in sync with .tool-versions
170-
flutter-version: '3.24.2'
186+
flutter-version: '3.27.1'
171187
channel: 'stable'
172188
# This action takes 1m30s to finish. Enable cache to make it shorter.
173189
cache: true

.tool-versions

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
flutter 3.24.2-stable
2-
nodejs 20.17.0
3-
ruby 3.3.3
1+
flutter 3.27.1-stable
2+
nodejs 20.18.1
3+
ruby 3.3.6

example/android/app/build.gradle

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,36 @@
1-
def localProperties = new Properties()
2-
def localPropertiesFile = rootProject.file('local.properties')
3-
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withReader('UTF-8') { reader ->
5-
localProperties.load(reader)
6-
}
7-
}
8-
9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
14-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15-
if (flutterVersionCode == null) {
16-
flutterVersionCode = '1'
17-
}
18-
19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20-
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id "dev.flutter.flutter-gradle-plugin"
226
}
237

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
288
android {
29-
compileSdkVersion flutter.compileSdkVersion
9+
namespace = "com.authgear.exampleapp.flutter"
10+
compileSdk = flutter.compileSdkVersion
11+
ndkVersion = flutter.ndkVersion
3012

3113
compileOptions {
32-
sourceCompatibility JavaVersion.VERSION_1_8
33-
targetCompatibility JavaVersion.VERSION_1_8
14+
sourceCompatibility = JavaVersion.VERSION_1_8
15+
targetCompatibility = JavaVersion.VERSION_1_8
3416
}
3517

3618
kotlinOptions {
37-
jvmTarget = '1.8'
19+
jvmTarget = JavaVersion.VERSION_1_8
3820
}
3921

4022
sourceSets {
4123
main.java.srcDirs += 'src/main/kotlin'
4224
}
4325

4426
defaultConfig {
45-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46-
applicationId "com.authgear.exampleapp.flutter"
27+
applicationId = "com.authgear.exampleapp.flutter"
4728
// minSdkVersion flutter.minSdkVersion
4829
// 21 is required to use androidx.security
49-
minSdkVersion 21
50-
targetSdkVersion flutter.targetSdkVersion
51-
versionCode flutterVersionCode.toInteger()
52-
versionName flutterVersionName
30+
minSdk = 21
31+
targetSdk = flutter.targetSdkVersion
32+
versionCode = flutter.versionCode
33+
versionName = flutter.versionName
5334
}
5435

5536
signingConfigs {
@@ -64,6 +45,7 @@ android {
6445
buildTypes {
6546
release {
6647
signingConfig signingConfigs.release
48+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
6749
}
6850
}
6951
}
@@ -73,6 +55,5 @@ flutter {
7355
}
7456

7557
dependencies {
76-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
7758
implementation "com.tencent.mm.opensdk:wechat-sdk-android:6.8.0"
7859
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# When I run `flutter build apk ...`, it refuses to build and ask me to add these rules.
2+
# So I did.
3+
-dontwarn com.google.errorprone.annotations.CanIgnoreReturnValue
4+
-dontwarn com.google.errorprone.annotations.CheckReturnValue
5+
-dontwarn com.google.errorprone.annotations.Immutable
6+
-dontwarn com.google.errorprone.annotations.RestrictedApi
7+
-dontwarn javax.annotation.Nullable
8+
-dontwarn javax.annotation.concurrent.GuardedBy
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.authgear.exampleapp.flutter">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
<application android:usesCleartextTraffic="true" />
43
</manifest>

example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.authgear.exampleapp.flutter">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
<uses-permission android:name="android.permission.INTERNET" />
43
<!-- NOTE(backup): Please search NOTE(backup) before you modify allowBackup, fullBackupContent, or dataExtractionRules -->
54
<application
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.authgear.exampleapp.flutter">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
</manifest>

example/android/build.gradle

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
buildscript {
2-
// Flutter 3.24.2 requires kotlin to be 1.7.x
3-
// As of 2024-09-06, the latest kotlin 1.7.x is 1.7.21
4-
// See https://kotlinlang.org/docs/releases.html#release-details
5-
ext.kotlin_version = '1.7.21'
6-
repositories {
7-
google()
8-
mavenCentral()
9-
}
10-
11-
dependencies {
12-
classpath 'com.android.tools.build:gradle:7.3.1'
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14-
}
15-
}
16-
171
allprojects {
182
repositories {
193
google()

example/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.gradle.jvmargs=-Xmx1536M
1+
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip

0 commit comments

Comments
 (0)