Skip to content

Commit

Permalink
add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
liudonghua123 committed Mar 20, 2020
1 parent 29294dd commit ccb1e99
Show file tree
Hide file tree
Showing 4 changed files with 204 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Linux-CI

on:
push:
branches:
- isomorphic
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Branch name
id: branch_name
run: |
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- uses: actions/setup-java@v1
with:
java-version: "8.x"
- uses: subosito/flutter-action@v1
with:
channel: "dev"

- name: Change flutter channel to master, enable linux support
run: |
flutter channel master
flutter upgrade
flutter config --enable-linux-desktop
flutter pub get
- name: Build linux
run: |
flutter build linux
- name: Debug
run: |
sudo npm install tree-node-cli -g
treee build
- name: Prepare release files
run: |
cp -r build/linux/release flutter_ui_challenges-linux-${{ steps.branch_name.outputs.SOURCE_NAME }}
zip flutter_ui_challenges-linux-${{ steps.branch_name.outputs.SOURCE_NAME }}.zip -r flutter_ui_challenges-linux-${{ steps.branch_name.outputs.SOURCE_NAME }}
- uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: flutter_ui_challenges-linux-${{ steps.branch_name.outputs.SOURCE_NAME }}.zip
tags: true
draft: false
61 changes: 61 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: MacOS-CI

on:
push:
branches:
- isomorphic
tags:
- "*"

jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Branch name
id: branch_name
run: |
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- uses: actions/setup-java@v1
with:
java-version: "8.x"
- uses: subosito/flutter-action@v1
with:
channel: "dev"

- name: Change flutter channel to master, enable macos support
run: |
flutter channel master
flutter upgrade
flutter config --enable-macos-desktop
flutter pub get
- name: Build macos, apk, ios(simulator)
run: |
flutter build macos
flutter build apk
flutter build ios --debug --no-codesign --simulator
- name: Debug
run: |
sudo npm install tree-node-cli -g
treee build
- name: Prepare release files
run: |
cp -r build/macos/Build/Products/Release/flutter_ui_challenges.app flutter_ui_challenges-macos-${{ steps.branch_name.outputs.SOURCE_NAME }}.app
cp -r build/ios/Debug-iphonesimulator/Runner.app flutter_ui_challenges-ios-${{ steps.branch_name.outputs.SOURCE_NAME }}.app
zip flutter_ui_challenges-macos-${{ steps.branch_name.outputs.SOURCE_NAME }}.zip -r flutter_ui_challenges-macos-${{ steps.branch_name.outputs.SOURCE_NAME }}.app
zip flutter_ui_challenges-ios-${{ steps.branch_name.outputs.SOURCE_NAME }}.zip -r flutter_ui_challenges-ios-${{ steps.branch_name.outputs.SOURCE_NAME }}.app
cp build/app/outputs/apk/release/app-release.apk flutter_ui_challenges-android-${{ steps.branch_name.outputs.SOURCE_NAME }}.apk
- uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: flutter_ui_challenges-macos-${{ steps.branch_name.outputs.SOURCE_NAME }}.zip;flutter_ui_challenges-ios-${{ steps.branch_name.outputs.SOURCE_NAME }}.zip;flutter_ui_challenges-android-${{ steps.branch_name.outputs.SOURCE_NAME }}.apk
tags: true
draft: false
35 changes: 35 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: WEB-CI

on:
push:
branches:
- isomorphic

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v1
with:
java-version: "8.x"
- uses: subosito/flutter-action@v1
with:
channel: "beta"

- name: Enable web support
run: |
flutter upgrade
flutter config --enable-web
flutter pub get
- name: Build web
run: |
flutter build web
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web/
52 changes: 52 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Windows-CI

on:
push:
branches:
- isomorphic
tags:
- '*'

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- name: Branch name
id: branch_name
run: |
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
shell: bash

- uses: actions/setup-java@v1
with:
java-version: "8.x"
- uses: subosito/flutter-action@v1
with:
channel: "dev"

- name: Change flutter channel to master, enable windows support
run: |
flutter channel master
flutter upgrade
flutter config --enable-windows-desktop
flutter pub get
- name: Build windows
run: |
flutter build windows
- name: Prepare release files
run: |
7z a -tzip flutter_ui_challenges-windows-x64-${{ steps.branch_name.outputs.SOURCE_NAME }}.zip -r .\build\windows\x64\Release\Runner\*
- uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: flutter_ui_challenges-windows-x64-${{ steps.branch_name.outputs.SOURCE_NAME }}.zip
tags: true
draft: false

0 comments on commit ccb1e99

Please sign in to comment.