Compare commits
14 Commits
c1f2374daa
...
0046f6872b
Author | SHA1 | Date |
---|---|---|
Ian VanSchooten | 0046f6872b | |
Ian VanSchooten | c98946c5ea | |
Ian VanSchooten | 9071ce34c5 | |
Ian VanSchooten | e0788799f7 | |
Ian VanSchooten | d6f50319ef | |
Ian VanSchooten | 5be54c024f | |
Ian VanSchooten | d4a5489be5 | |
Ian VanSchooten | cf97068d7b | |
Ian VanSchooten | 9d0c3640fe | |
Ian VanSchooten | 13435757f5 | |
Ian VanSchooten | 0556ff612e | |
Ian VanSchooten | 4403fef32e | |
Ian VanSchooten | 70b344bbbd | |
Ian VanSchooten | dc99ae2e65 |
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
DIRS="lib test"
|
||||
EXIT=0
|
||||
|
||||
for DIR in $DIRS; do
|
||||
OUT="$(flutter format -l 120 --suppress-analytics "$DIR" | sed -e "s/^Formatted \(.*\)/::error file=$DIR\/\1::Not formatted/g")"
|
||||
echo "$OUT" | grep "::error" && EXIT=1
|
||||
done
|
||||
|
||||
exit $EXIT
|
|
@ -23,5 +23,5 @@ jobs:
|
|||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: flutter format
|
||||
run: $GITHUB_WORKSPACE/.github/workflows/flutterfmt.sh
|
||||
- name: Check formating
|
||||
run: dart format -l120 lib/ --set-exit-if-changed --suppress-analytics --output none
|
|
@ -19,7 +19,7 @@ jobs:
|
|||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: '11'
|
||||
java-version: '17'
|
||||
|
||||
- name: Install flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
|
|
|
@ -0,0 +1,104 @@
|
|||
# This workflow builds the iOS and Android apps, just to check they build without error
|
||||
|
||||
name: Smoke build
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build-android:
|
||||
name: Android
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Set up Go 1.22
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: "1.22"
|
||||
|
||||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: '17'
|
||||
|
||||
- name: Install flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: '3.24.1'
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: install dependencies
|
||||
env:
|
||||
TOKEN: ${{ secrets.MACHINE_USER_PAT }}
|
||||
run: |
|
||||
go install golang.org/x/mobile/cmd/gomobile@latest
|
||||
gomobile init
|
||||
flutter pub get
|
||||
touch env.sh
|
||||
|
||||
- name: Build Android debug
|
||||
run: flutter build appbundle --debug
|
||||
|
||||
build-ios:
|
||||
name: iOS
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- name: Set up Go 1.22
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: "1.22"
|
||||
|
||||
- name: Install flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: '3.24.1'
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install the appstore connect key material
|
||||
env:
|
||||
AC_API_KEY_SECRET_BASE64: ${{ secrets.AC_API_KEY_SECRET_BASE64 }}
|
||||
run: |
|
||||
AC_API_KEY_SECRET_PATH="$RUNNER_TEMP/key.p8"
|
||||
echo "APP_STORE_CONNECT_API_KEY_KEY_FILEPATH=$AC_API_KEY_SECRET_PATH" >> $GITHUB_ENV
|
||||
echo -n "$AC_API_KEY_SECRET_BASE64" | base64 --decode --output "$AC_API_KEY_SECRET_PATH"
|
||||
|
||||
- name: Place Github token for fastlane match
|
||||
env:
|
||||
TOKEN: ${{ secrets.MACHINE_USER_PAT }}
|
||||
run:
|
||||
echo "MATCH_GIT_BASIC_AUTHORIZATION=$(echo -n "defined-machine:${TOKEN}" | base64)" >> $GITHUB_ENV
|
||||
|
||||
- name: install dependencies
|
||||
env:
|
||||
TOKEN: ${{ secrets.MACHINE_USER_PAT }}
|
||||
run: |
|
||||
go install golang.org/x/mobile/cmd/gomobile@latest
|
||||
gomobile init
|
||||
flutter pub get
|
||||
touch env.sh
|
||||
|
||||
- name: Build iOS
|
||||
env:
|
||||
TOKEN: ${{ secrets.MACHINE_USER_PAT }}
|
||||
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
|
||||
run: |
|
||||
cd ios
|
||||
pod install
|
||||
fastlane checkBuild
|
||||
cd -
|
||||
|
||||
# verify that the github token didn't make it into the output
|
||||
mkdir -p build/app/test-ios
|
||||
cp ios/MobileNebula.ipa build/app/test-ios
|
||||
cd build/app/test-ios
|
||||
unzip MobileNebula.ipa
|
||||
if find . | xargs strings 2>/dev/null | grep -qF "${TOKEN}" ; then
|
||||
echo "Token found in iOS build"
|
||||
exit 1
|
||||
fi
|
|
@ -32,13 +32,16 @@ If you are having issues with iOS pods, try blowing it all away! `cd ios && rm -
|
|||
|
||||
# Formatting
|
||||
|
||||
`flutter format` can be used to format the code in `lib` and `test` but it's default is 80 char line limit, it's 2020
|
||||
`dart format` can be used to format the code in `lib` and `test`. We use a line-length of 120 characters.
|
||||
|
||||
Use:
|
||||
```sh
|
||||
flutter format lib/ test/ -l 120
|
||||
dart format lib/ test/ -l 120
|
||||
```
|
||||
|
||||
In Android Studio, set the line length using Preferences -> Editor -> Code Style -> Dart -> Line length, set it to 120. Enable auto-format with Preferences -> Languages & Frameworks -> Flutter -> Format code on save.
|
||||
|
||||
|
||||
# Release
|
||||
|
||||
Update `version` in `pubspec.yaml` to reflect this release, then
|
||||
|
@ -53,4 +56,4 @@ Upload the android bundle to the google play store https://play.google.com/apps/
|
|||
|
||||
## iOS
|
||||
|
||||
In xcode, Release -> Archive then follow the directions to upload to the app store. If you have issues, https://flutter.dev/docs/deployment/ios#create-a-build-archive
|
||||
In xcode, Release -> Archive then follow the directions to upload to the app store. If you have issues, https://flutter.dev/docs/deployment/ios#create-a-build-archive
|
|
@ -28,15 +28,6 @@ android {
|
|||
|
||||
compileSdkVersion 34
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
@ -72,6 +63,12 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(17)
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ pluginManagement {
|
|||
}
|
||||
|
||||
plugins {
|
||||
id "org.gradle.toolchains.foojay-resolver-convention" version "0.8.0"
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version '8.6.1' apply false
|
||||
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
|
||||
|
|
|
@ -18,6 +18,50 @@ default_platform(:ios)
|
|||
platform :ios do
|
||||
desc "Push a new beta build to TestFlight"
|
||||
|
||||
lane :checkBuild do
|
||||
# Do some things like setting up a temporary keystore to host secrets in CI
|
||||
setup_ci
|
||||
|
||||
# Change signing behavior to work in CI
|
||||
update_code_signing_settings(
|
||||
# Automatic signing seems to be a good thing to have on in dev but will not work in CI
|
||||
use_automatic_signing: false,
|
||||
# The default value for this is iOS Development which is not appropriate for release
|
||||
code_sign_identity: "Apple Distribution",
|
||||
)
|
||||
|
||||
# Find our signing certs and profiles, these come from a private repository and managed by `fastlane match`
|
||||
match(type: 'appstore', app_identifier: ["net.defined.mobileNebula","net.defined.mobileNebula.NebulaNetworkExtension"], readonly: true)
|
||||
|
||||
# Update our main program to have the correct provisioning profile from Apple
|
||||
update_project_provisioning(
|
||||
xcodeproj: "Runner.xcodeproj",
|
||||
target_filter: "Runner",
|
||||
# This comes from match() above
|
||||
profile:ENV["sigh_net.defined.mobileNebula_appstore_profile-path"],
|
||||
build_configuration: "Release"
|
||||
)
|
||||
|
||||
# Update our network extension to have the correct provisioning profile from Apple
|
||||
update_project_provisioning(
|
||||
xcodeproj: "Runner.xcodeproj",
|
||||
target_filter: "NebulaNetworkExtension",
|
||||
# This comes from match() above
|
||||
profile:ENV["sigh_net.defined.mobileNebula.NebulaNetworkExtension_appstore_profile-path"],
|
||||
build_configuration: "Release"
|
||||
)
|
||||
|
||||
build_app(
|
||||
output_name: "MobileNebula.ipa",
|
||||
workspace: "Runner.xcworkspace",
|
||||
scheme: "Runner",
|
||||
export_method: "app-store",
|
||||
export_options: {
|
||||
manageAppVersionAndBuildNumber: false
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
lane :build do
|
||||
# Do some things like setting up a temporary keystore to host secrets in CI
|
||||
setup_ci
|
||||
|
|
|
@ -85,44 +85,44 @@ class _AppState extends State<App> {
|
|||
return MaterialApp(
|
||||
theme: brightness == Brightness.light ? lightTheme : darkTheme,
|
||||
home: Scaffold(
|
||||
body: PlatformProvider(
|
||||
//initialPlatform: initialPlatform,
|
||||
builder: (context) => PlatformApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
localizationsDelegates: <LocalizationsDelegate<dynamic>>[
|
||||
DefaultMaterialLocalizations.delegate,
|
||||
DefaultWidgetsLocalizations.delegate,
|
||||
DefaultCupertinoLocalizations.delegate,
|
||||
],
|
||||
title: 'Nebula',
|
||||
material: (_, __) {
|
||||
return new MaterialAppData(
|
||||
themeMode: brightness == Brightness.light ? ThemeMode.light : ThemeMode.dark,
|
||||
);
|
||||
},
|
||||
cupertino: (_, __) => CupertinoAppData(
|
||||
theme: CupertinoThemeData(brightness: brightness),
|
||||
),
|
||||
onGenerateRoute: (settings) {
|
||||
if (settings.name == '/') {
|
||||
return platformPageRoute(context: context, builder: (context) => MainScreen(this.dnEnrolled));
|
||||
}
|
||||
|
||||
final uri = Uri.parse(settings.name!);
|
||||
if (uri.path == EnrollmentScreen.routeName) {
|
||||
// TODO: maybe implement this as a dialog instead of a page, you can stack multiple enrollment screens which is annoying in dev
|
||||
return platformPageRoute(
|
||||
context: context,
|
||||
builder: (context) =>
|
||||
EnrollmentScreen(code: EnrollmentScreen.parseCode(settings.name!), stream: this.dnEnrolled),
|
||||
body: PlatformProvider(
|
||||
//initialPlatform: initialPlatform,
|
||||
builder: (context) => PlatformApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
localizationsDelegates: <LocalizationsDelegate<dynamic>>[
|
||||
DefaultMaterialLocalizations.delegate,
|
||||
DefaultWidgetsLocalizations.delegate,
|
||||
DefaultCupertinoLocalizations.delegate,
|
||||
],
|
||||
title: 'Nebula',
|
||||
material: (_, __) {
|
||||
return new MaterialAppData(
|
||||
themeMode: brightness == Brightness.light ? ThemeMode.light : ThemeMode.dark,
|
||||
);
|
||||
}
|
||||
},
|
||||
cupertino: (_, __) => CupertinoAppData(
|
||||
theme: CupertinoThemeData(brightness: brightness),
|
||||
),
|
||||
onGenerateRoute: (settings) {
|
||||
if (settings.name == '/') {
|
||||
return platformPageRoute(context: context, builder: (context) => MainScreen(this.dnEnrolled));
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
final uri = Uri.parse(settings.name!);
|
||||
if (uri.path == EnrollmentScreen.routeName) {
|
||||
// TODO: maybe implement this as a dialog instead of a page, you can stack multiple enrollment screens which is annoying in dev
|
||||
return platformPageRoute(
|
||||
context: context,
|
||||
builder: (context) =>
|
||||
EnrollmentScreen(code: EnrollmentScreen.parseCode(settings.name!), stream: this.dnEnrolled),
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ clean:
|
|||
|
||||
mobileNebula.aar: *.go go.sum
|
||||
go get -d golang.org/x/mobile/cmd/gomobile
|
||||
gomobile bind -trimpath -v --target=android
|
||||
gomobile bind -trimpath -v --target=android -androidapi=26
|
||||
|
||||
MobileNebula.xcframework: *.go go.sum
|
||||
go get -d golang.org/x/mobile/cmd/gomobile
|
||||
|
|
Loading…
Reference in New Issue