liuyuqi-dellpc 2 years ago
commit
c41a965e8f
6 changed files with 94 additions and 0 deletions
  1. 24 0
      .dockerignore
  2. 11 0
      Dockerfile
  3. 36 0
      README.md
  4. 12 0
      docker-compose.debug.yml
  5. 6 0
      docker-compose.yml
  6. 5 0
      entrypoint.sh

+ 24 - 0
.dockerignore

@@ -0,0 +1,24 @@
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/azds.yaml
+**/bin
+**/charts
+**/docker-compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+README.md

+ 11 - 0
Dockerfile

@@ -0,0 +1,11 @@
+
+FROM jianboy/flutter
+
+VOLUME /tmp
+ARG JAVA_OPTS
+ENV JAVA_OPTS=$JAVA_OPTS
+ADD flutter-action.jar flutter-action.jar
+EXPOSE 3000
+ENTRYPOINT exec java $JAVA_OPTS -jar flutter-action.jar
+
+

+ 36 - 0
README.md

@@ -0,0 +1,36 @@
+## flutter-action
+
+build flutter project with github action and relealse app .
+
+
+
+### Usage
+
+
+```
+name: flutter-action
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+    - name: set up JDK 1.8
+      uses: actions/setup-java@v1
+      with:
+        java-version: 1.8
+    - name: Build Debug APK
+      run: ./gradlew assembleDebug
+    - name: Releasing using Hub
+      uses: ShaunLWM/action-release-debugapk@master
+      env:
+        GITHUB_TOKEN: ${{secrets.TOKEN}}
+        APP_FOLDER: app
+        RELEASE_TITLE: New Build
+```

+ 12 - 0
docker-compose.debug.yml

@@ -0,0 +1,12 @@
+version: '3.4'
+
+services:
+  flutter-action:
+    image: flutter-action
+    build:
+      context: .
+      dockerfile: Dockerfile
+    environment:
+      JAVA_OPTS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,quiet=y
+    ports:
+      - 5005:5005

+ 6 - 0
docker-compose.yml

@@ -0,0 +1,6 @@
+version: '3.4'
+
+services:
+  flutter-action:
+    image: flutter-action
+    build: .

+ 5 - 0
entrypoint.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+hub checkout master
+VERSION_NAME=`grep -oP 'versionName "\K(.*?)(?=")' ./${APP_FOLDER}/build.gradle`
+hub release create -a ./${APP_FOLDER}/build/outputs/apk/debug/*-debug.apk -m "${RELEASE_TITLE} - v${VERSION_NAME}" $(date +%Y%m%d%H%M%S)