From 0d9e15c20cac75bc69f8f60df6d21fb54b6303e7 Mon Sep 17 00:00:00 2001 From: yf L Date: Sun, 21 Feb 2021 21:09:11 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E4=B8=89=E7=AB=AFgitaction=E6=89=93?= =?UTF-8?q?=E5=8C=85=E9=AA=8C=E8=AF=81=E9=80=9A=E8=BF=87=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dart.yml | 182 +++++++++--------- android/build.gradle | 15 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 105 insertions(+), 94 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 3994dab..92b6309 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -56,94 +56,94 @@ jobs: artifacts: ones-ai-mobile*.apk token: ${{ secrets.RELEASE_GITHUB_TOKEN }} allowUpdates: true - - web-build-job: - name: Build for web - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - submodules: false - fetch-depth: 0 - - name: Extract branch or tag name - shell: bash - run: | - echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/} - echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} - echo ::set-output name=BUILD_REVISION::`git rev-list HEAD --count` - id: CURRENT_TAG_OR_TAG - - name: Setup Flutter - uses: subosito/flutter-action@v1 - with: - flutter-version: ${{ env.FLUTTER_VERSION }} - channel: ${{ env.FLUTTER_CHANNEL }} - - name: Build web with shell - env: - CURRENT_TAG: ${{ steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_TAG }} - CURRENT_BRANCH: ${{ steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_BRANCH }} - BUILD_REVISION: ${{ steps.CURRENT_TAG_OR_TAG.outputs.BUILD_REVISION }} - run: bash ./web/build.sh - - name: Upload artifact to Actions - if: ${{ startsWith(steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_BRANCH, 'F') }} - uses: actions/upload-artifact@v2 - with: - name: ones-mobile-web-${{ steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_BRANCH }}.tar.gz - path: "ones-ai-mobile-web*.tar.gz" - - name: Upload artifact to Github Release - if: ${{ startsWith(steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_TAG, 'v') }} - uses: ncipollo/release-action@v1 - with: - artifacts: "ones-ai-mobile-web*.tar.gz" - token: ${{ secrets.RELEASE_GITHUB_TOKEN }} - allowUpdates: true - - ios-build-job: - name: Build for iOS - runs-on: macOS-latest - steps: - - name: checkout code - uses: actions/checkout@v2 - with: - submodules: false - fetch-depth: 0 - - name: Extract branch or tag name - shell: bash - run: | - echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/} - echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} - echo ::set-output name=BUILD_REVISION::`git rev-list HEAD --count` - id: CURRENT_TAG_OR_TAG - - name: Setup Flutter - uses: subosito/flutter-action@v1 - with: - flutter-version: ${{ env.FLUTTER_VERSION }} - channel: ${{ env.FLUTTER_CHANNEL }} - - name: build iOS with fastlane - env: - CURRENT_TAG: ${{ steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_TAG }} - CURRENT_BRANCH: ${{ steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_BRANCH }} - APPCENTER_API_TOKEN_IOS: ${{ secrets.APPCENTER_API_TOKEN_IOS }} - APPCENTER_APP_NAME_IOS: ${{ secrets.APPCENTER_APP_NAME_IOS }} - APPCENTER_OWNER_NAME: ${{ secrets.APPCENTER_OWNER_NAME }} - FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} - FASTLANE_USER: ${{ secrets.FASTLANE_USER }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - PGY_API_KEY: ${{ secrets.PGY_API_KEY }} - PGY_USER_KEY: ${{ secrets.PGY_USER_KEY }} - MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} - BUILD_REVISION: ${{ steps.CURRENT_TAG_OR_TAG.outputs.BUILD_REVISION }} - run: sh ./ios/build.sh - - name: Upload artifact to Actions - if: ${{ startsWith(steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_BRANCH, 'F') }} - uses: actions/upload-artifact@v2 - with: - name: ones-ai-mobile-${{ steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_BRANCH }}.ipa - path: "ones-ai-mobile*.ipa" - - name: Upload artifact to Github Release - if: ${{ startsWith(steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_TAG, 'v') }} - uses: ncipollo/release-action@v1 - with: - artifacts: "ones-ai-mobile*.ipa" - token: ${{ secrets.RELEASE_GITHUB_TOKEN }} - allowUpdates: true \ No newline at end of file +# +# web-build-job: +# name: Build for web +# runs-on: ubuntu-latest +# steps: +# - name: Checkout code +# uses: actions/checkout@v2 +# with: +# submodules: false +# fetch-depth: 0 +# - name: Extract branch or tag name +# shell: bash +# run: | +# echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/} +# echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} +# echo ::set-output name=BUILD_REVISION::`git rev-list HEAD --count` +# id: CURRENT_TAG_OR_TAG +# - name: Setup Flutter +# uses: subosito/flutter-action@v1 +# with: +# flutter-version: ${{ env.FLUTTER_VERSION }} +# channel: ${{ env.FLUTTER_CHANNEL }} +# - name: Build web with shell +# env: +# CURRENT_TAG: ${{ steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_TAG }} +# CURRENT_BRANCH: ${{ steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_BRANCH }} +# BUILD_REVISION: ${{ steps.CURRENT_TAG_OR_TAG.outputs.BUILD_REVISION }} +# run: bash ./web/build.sh +# - name: Upload artifact to Actions +# if: ${{ startsWith(steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_BRANCH, 'F') }} +# uses: actions/upload-artifact@v2 +# with: +# name: ones-mobile-web-${{ steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_BRANCH }}.tar.gz +# path: "ones-ai-mobile-web*.tar.gz" +# - name: Upload artifact to Github Release +# if: ${{ startsWith(steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_TAG, 'v') }} +# uses: ncipollo/release-action@v1 +# with: +# artifacts: "ones-ai-mobile-web*.tar.gz" +# token: ${{ secrets.RELEASE_GITHUB_TOKEN }} +# allowUpdates: true +# +# ios-build-job: +# name: Build for iOS +# runs-on: macOS-latest +# steps: +# - name: checkout code +# uses: actions/checkout@v2 +# with: +# submodules: false +# fetch-depth: 0 +# - name: Extract branch or tag name +# shell: bash +# run: | +# echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/} +# echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} +# echo ::set-output name=BUILD_REVISION::`git rev-list HEAD --count` +# id: CURRENT_TAG_OR_TAG +# - name: Setup Flutter +# uses: subosito/flutter-action@v1 +# with: +# flutter-version: ${{ env.FLUTTER_VERSION }} +# channel: ${{ env.FLUTTER_CHANNEL }} +# - name: build iOS with fastlane +# env: +# CURRENT_TAG: ${{ steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_TAG }} +# CURRENT_BRANCH: ${{ steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_BRANCH }} +# APPCENTER_API_TOKEN_IOS: ${{ secrets.APPCENTER_API_TOKEN_IOS }} +# APPCENTER_APP_NAME_IOS: ${{ secrets.APPCENTER_APP_NAME_IOS }} +# APPCENTER_OWNER_NAME: ${{ secrets.APPCENTER_OWNER_NAME }} +# FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} +# FASTLANE_USER: ${{ secrets.FASTLANE_USER }} +# MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} +# PGY_API_KEY: ${{ secrets.PGY_API_KEY }} +# PGY_USER_KEY: ${{ secrets.PGY_USER_KEY }} +# MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} +# BUILD_REVISION: ${{ steps.CURRENT_TAG_OR_TAG.outputs.BUILD_REVISION }} +# run: sh ./ios/build.sh +# - name: Upload artifact to Actions +# if: ${{ startsWith(steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_BRANCH, 'F') }} +# uses: actions/upload-artifact@v2 +# with: +# name: ones-ai-mobile-${{ steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_BRANCH }}.ipa +# path: "ones-ai-mobile*.ipa" +# - name: Upload artifact to Github Release +# if: ${{ startsWith(steps.CURRENT_TAG_OR_TAG.outputs.SOURCE_TAG, 'v') }} +# uses: ncipollo/release-action@v1 +# with: +# artifacts: "ones-ai-mobile*.ipa" +# token: ${{ secrets.RELEASE_GITHUB_TOKEN }} +# allowUpdates: true \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 9faada4..38b3ea9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,8 @@ +ext { + compileSdkVersion = 29 +} buildscript { - ext.kotlin_version = '1.2.71' + ext.kotlin_version = '1.3.31' repositories { google() jcenter() @@ -9,8 +12,9 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:3.5.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'io.fabric.tools:gradle:1.27.0' } } @@ -27,6 +31,13 @@ subprojects { } subprojects { project.evaluationDependsOn(':app') + afterEvaluate{ + if((project.plugins.hasPlugin('android') || project.plugins.hasPlugin('android-library'))) { + android { + compileSdkVersion rootProject.ext.compileSdkVersion + } + } + } } task clean(type: Delete) { diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index bc24dcf..296b146 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip