Skip to content

Commit

Permalink
add ci support
Browse files Browse the repository at this point in the history
add ci support

add ci support

add ci support

add ci support

add ci support

add ci support

add ci support

add ci support

add ci support

add ci support

add ci support

add ci support

add ci support

update readme

update readme

update ci
  • Loading branch information
CarGuo committed Nov 28, 2021
1 parent 54b236f commit 327f660
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

custom: http://img.cdn.guoshuyu.cn/thanks.jpg
84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI

on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '**/*.png'
- '**/*.jpg'

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.5.3'
- run: flutter pub get
- run: flutter build apk

apk:
name: Generate APK
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.5.3'
- run: flutter pub get
- run: flutter build apk --target-platform android-arm64
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: apk
path: build/app/outputs/apk/release/app-release.apk
release:
name: Release APK
needs: apk
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Download APK from build
uses: actions/download-artifact@v2
with:
name: apk
- name: Display structure of downloaded files
run: ls -R

- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
- name: Upload Release APK
id: upload_release_asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./app-release.apk
asset_name: app-release.apk
asset_content_type: application/zip
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# GSY Flutter Demo


### 不同于 [GSYGithubAppFlutter](https://github.com/CarGuo/GSYGithubAppFlutter) 项目,本项目将逐步完善各种 Flutter 独立例子,方便新手学习上手。

[![Github Actions](https://github.com/CarGuo/gsy_flutter_demo/workflows/CI/badge.svg)](https://github.com/CarGuo/gsy_flutter_demo/actions)


### [Web 版在线测试](https://guoshuyu.cn/home/web/#/)

Expand Down
10 changes: 9 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ android {

lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}

defaultConfig {
Expand All @@ -43,16 +47,20 @@ android {
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

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
minifyEnabled false
shrinkResources false
}
}
kotlinOptions {
jvmTarget = "1.8"
}
}

flutter {
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.2.71'
ext.kotlin_version = '1.3.61'
repositories {
google()
jcenter()
Expand Down

0 comments on commit 327f660

Please sign in to comment.