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 0d9e15c commit 10b790a
Showing 1 changed file with 91 additions and 91 deletions.
182 changes: 91 additions & 91 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,47 @@ env:
FLUTTER_VERSION: '1.21.0-9.1.pre'
FLUTTER_CHANNEL: 'beta'
jobs:
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

android-build-job:
name: Build for android
runs-on: ubuntu-latest
Expand Down Expand Up @@ -56,94 +97,53 @@ 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

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

0 comments on commit 10b790a

Please sign in to comment.