Browse Source

add 签名

lyq.me@qq.com 2 years ago
parent
commit
35d8d15b90
4 changed files with 90 additions and 9 deletions
  1. 77 0
      .github/workflows/build.yml
  2. 11 7
      android/app/build.gradle
  3. BIN
      android/app/sign/flutter_2048.jks
  4. 2 2
      pubspec.yaml

+ 77 - 0
.github/workflows/build.yml

@@ -0,0 +1,77 @@
+name: CI
+on:
+  push:
+    branches: [ master , main]
+  pull_request:
+    branches: [ master , main]
+jobs:
+  build:
+    strategy:
+      matrix:
+        os: [ubuntu-latest, macos-latest]
+    runs-on: ${{matrix.os}}
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Setup Java JDK
+        uses: actions/setup-java@v2
+        with:
+          distribution: 'adopt'
+          java-version: "8.x"
+
+      - name: Setup gradle
+        uses: eskatos/gradle-command-action@v1
+        with:
+          gradle-version: 6.5
+
+      - name: Flutter action
+        uses: subosito/flutter-action@v1.5.3
+        with:
+          channel: "stable"
+          flutter-version: "2.0.5"
+      
+      - name: Cache Dependencies
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.gradle/caches
+            ~/.gradle/wrapper
+            Pods
+          key: |
+            ${{runner.OS}}-gradle-caches-${{ hashFiles('pubspec.lock') }}
+            ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-pods-
+            ${{ runner.os }}-gradle-
+
+      - name: Install Dependencies
+        if: steps.cache.outputs.cache-hit != 'true'
+        run: flutter pub get
+
+      - name: Build apk
+        if: ${{ runner.os == 'Linux' }}
+        run: flutter build apk --debug --split-per-abi
+
+      - name: Build ios
+        if: ${{ runner.os == 'macOS' }}
+        run: |
+          sudo xcode-select -s /Applications/Xcode_12.3.app
+          flutter build ios --release --no-codesign
+          cd build/ios/iphoneos
+          mkdir Payload
+          cd Payload
+          ln -s ../Runner.app
+          cd ..
+          zip -r app.ipa Payload
+      
+      - name: artifact
+        uses: actions/upload-artifact@v2
+        with:
+          name: ${{runner.OS}}-artifact
+          path: |
+            # build/app/outputs/flutter-apk/**/*.apk
+            build/app/outputs/flutter-apk/app.apk
+            build/ios/**/*.ipa
+            build/web/web-app.zip
+

+ 11 - 7
android/app/build.gradle

@@ -25,26 +25,30 @@ apply plugin: 'com.android.application'
 apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
 
 android {
-    compileSdkVersion 29
-
+    compileSdkVersion 30
+    signingConfigs {
+        release {
+            storeFile file("sign/flutter_2048.jks")
+            keyAlias "key0"
+            keyPassword "bKAwkX_YkTO7"
+            storePassword "bKAwkX_YkTO7"
+        }
+    }
     lintOptions {
         disable 'InvalidPackage'
     }
 
     defaultConfig {
-        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
         applicationId "yoqi.me.flutter_2048"
         minSdkVersion 16
-        targetSdkVersion 29
+        targetSdkVersion 30
         versionCode flutterVersionCode.toInteger()
         versionName flutterVersionName
     }
 
     buildTypes {
         release {
-            // TODO: Add your own signing config for the release build.
-            // Signing with the debug keys for now, so `flutter run --release` works.
-            signingConfig signingConfigs.debug
+            signingConfig signingConfigs.release
         }
     }
 }

BIN
android/app/sign/flutter_2048.jks


+ 2 - 2
pubspec.yaml

@@ -12,12 +12,12 @@ dependencies:
   flutter_localizations: # 国际化
     sdk: flutter
   intl: ^0.17.0
-  cupertino_icons: ^1.0.2 # ios风格图标
+  cupertino_icons: ^1.0.3 # ios风格图标
   flutter_screenutil: ^4.0.3+2 # 屏幕工具
   device_info: ^2.0.2
   flutter_redux: ^0.8.2 # 状态管理
   redux_thunk: ^0.4.0
-  shared_preferences: ^2.0.6
+  shared_preferences: ^2.0.7
 
 dev_dependencies:
   flutter_test: