Skip to content

Commit baa2a2d

Browse files
committed
CI/CD add
1 parent 1723b08 commit baa2a2d

7 files changed

Lines changed: 156 additions & 0 deletions

File tree

.github/workflows/main.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- main
5+
- master
6+
push:
7+
branches:
8+
- main
9+
# - master // another branches
10+
# - develop
11+
name: "Build & Release"
12+
jobs:
13+
build:
14+
name: Build & Release
15+
runs-on: macos-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-java@v3
19+
with:
20+
distribution: 'zulu'
21+
java-version: '17.0.9'
22+
- uses: subosito/flutter-action@v2
23+
with:
24+
channel: 'stable'
25+
architecture: x64
26+
27+
- run: flutter build apk --release --split-per-abi
28+
- run: |
29+
flutter build ios --no-codesign
30+
cd build/ios/iphoneos
31+
mkdir Payload
32+
cd Payload
33+
ln -s ../Runner.app
34+
cd ..
35+
zip -r app.ipa Payload
36+
- name: Push to Releases
37+
uses: ncipollo/release-action@v1
38+
with:
39+
artifacts: "build/app/outputs/apk/release/*,build/ios/iphoneos/app.ipa"
40+
tag: v1.0.${{ github.run_number }}
41+
token: ${{ secrets.TOKEN }}
42+
43+
44+
45+
46+
47+
48+
# push to master, main, develop
49+
# pull request on main master

android/app/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
plugins {
22
id "com.android.application"
3+
// START: FlutterFire Configuration
4+
id 'com.google.gms.google-services'
5+
// END: FlutterFire Configuration
36
id "kotlin-android"
47
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
58
id "dev.flutter.flutter-gradle-plugin"

android/app/google-services.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"project_info": {
3+
"project_number": "552425267947",
4+
"project_id": "tondra-vpn",
5+
"storage_bucket": "tondra-vpn.firebasestorage.app"
6+
},
7+
"client": [
8+
{
9+
"client_info": {
10+
"mobilesdk_app_id": "1:552425267947:android:5f9f8dafaf4192f563d4ae",
11+
"android_client_info": {
12+
"package_name": "com.example.vpn"
13+
}
14+
},
15+
"oauth_client": [],
16+
"api_key": [
17+
{
18+
"current_key": "AIzaSyAw654qwt0kmynyW7JmjrNx5UEByLoZsNY"
19+
}
20+
],
21+
"services": {
22+
"appinvite_service": {
23+
"other_platform_oauth_client": []
24+
}
25+
}
26+
}
27+
],
28+
"configuration_version": "1"
29+
}

android/settings.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ pluginManagement {
1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
2121
id "com.android.application" version "7.3.0" apply false
22+
// START: FlutterFire Configuration
23+
id "com.google.gms.google-services" version "4.3.15" apply false
24+
// END: FlutterFire Configuration
2225
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
2326
}
2427

firebase.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"flutter":{"platforms":{"android":{"default":{"projectId":"tondra-vpn","appId":"1:552425267947:android:5f9f8dafaf4192f563d4ae","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"tondra-vpn","configurations":{"android":"1:552425267947:android:5f9f8dafaf4192f563d4ae","ios":"1:552425267947:ios:a4a1c2fffdd29e6863d4ae"}}}}}}

lib/firebase_options.dart

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// File generated by FlutterFire CLI.
2+
// ignore_for_file: type=lint
3+
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
4+
import 'package:flutter/foundation.dart'
5+
show defaultTargetPlatform, kIsWeb, TargetPlatform;
6+
7+
/// Default [FirebaseOptions] for use with your Firebase apps.
8+
///
9+
/// Example:
10+
/// ```dart
11+
/// import 'firebase_options.dart';
12+
/// // ...
13+
/// await Firebase.initializeApp(
14+
/// options: DefaultFirebaseOptions.currentPlatform,
15+
/// );
16+
/// ```
17+
class DefaultFirebaseOptions {
18+
static FirebaseOptions get currentPlatform {
19+
if (kIsWeb) {
20+
throw UnsupportedError(
21+
'DefaultFirebaseOptions have not been configured for web - '
22+
'you can reconfigure this by running the FlutterFire CLI again.',
23+
);
24+
}
25+
switch (defaultTargetPlatform) {
26+
case TargetPlatform.android:
27+
return android;
28+
case TargetPlatform.iOS:
29+
return ios;
30+
case TargetPlatform.macOS:
31+
throw UnsupportedError(
32+
'DefaultFirebaseOptions have not been configured for macos - '
33+
'you can reconfigure this by running the FlutterFire CLI again.',
34+
);
35+
case TargetPlatform.windows:
36+
throw UnsupportedError(
37+
'DefaultFirebaseOptions have not been configured for windows - '
38+
'you can reconfigure this by running the FlutterFire CLI again.',
39+
);
40+
case TargetPlatform.linux:
41+
throw UnsupportedError(
42+
'DefaultFirebaseOptions have not been configured for linux - '
43+
'you can reconfigure this by running the FlutterFire CLI again.',
44+
);
45+
default:
46+
throw UnsupportedError(
47+
'DefaultFirebaseOptions are not supported for this platform.',
48+
);
49+
}
50+
}
51+
52+
static const FirebaseOptions android = FirebaseOptions(
53+
apiKey: 'AIzaSyAw654qwt0kmynyW7JmjrNx5UEByLoZsNY',
54+
appId: '1:552425267947:android:5f9f8dafaf4192f563d4ae',
55+
messagingSenderId: '552425267947',
56+
projectId: 'tondra-vpn',
57+
storageBucket: 'tondra-vpn.firebasestorage.app',
58+
);
59+
60+
static const FirebaseOptions ios = FirebaseOptions(
61+
apiKey: 'AIzaSyCEaZo0LZjg8O3kjg8OFNYdOo7YjgK8PKo',
62+
appId: '1:552425267947:ios:a4a1c2fffdd29e6863d4ae',
63+
messagingSenderId: '552425267947',
64+
projectId: 'tondra-vpn',
65+
storageBucket: 'tondra-vpn.firebasestorage.app',
66+
iosBundleId: 'com.example.vpn',
67+
);
68+
}

lib/main.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import 'dart:async';
22

3+
import 'package:firebase_core/firebase_core.dart';
34
import 'package:flutter/material.dart';
45
import 'package:flutter_dotenv/flutter_dotenv.dart';
56
import 'package:vpn/app/app.dart';
67

78
Future<void> main() async {
9+
WidgetsFlutterBinding.ensureInitialized();
10+
await Firebase.initializeApp();
811
await dotenv.load(fileName: ".env");
912
runApp(const MyApp());
1013
}

0 commit comments

Comments
 (0)