Skip to content

Commit

Permalink
add: 三端gitaction打包验证通过!
Browse files Browse the repository at this point in the history
  • Loading branch information
lyf571321556 committed Feb 21, 2021
1 parent 0b181bc commit 0d9e15c
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 94 deletions.
182 changes: 91 additions & 91 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
# 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
15 changes: 13 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
ext {
compileSdkVersion = 29
}
buildscript {
ext.kotlin_version = '1.2.71'
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()
Expand All @@ -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'
}
}

Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0d9e15c

Please sign in to comment.