Browse Source

Update 'flutter/.github/workflows/main.yml'

天问 3 years ago
parent
commit
a519dec504
1 changed files with 33 additions and 19 deletions
  1. 33 19
      flutter/.github/workflows/main.yml

+ 33 - 19
flutter/.github/workflows/main.yml

@@ -8,7 +8,7 @@ jobs:
   build:
     strategy:
       matrix:
-        os: [ubuntu-latest, macos-latest]
+        os: [ubuntu-latest, windows-latest, macos-latest]
     runs-on: ${{matrix.os}}
     steps:
       - uses: actions/checkout@v2
@@ -53,13 +53,6 @@ jobs:
         if: ${{ runner.os == 'Linux' }}
         run: flutter build apk --debug --split-per-abi
 
-      # - name: Build Web
-      #   if: ${{runner.os == 'Linux'}}
-      #   run: |
-      #     flutter build web
-      #     cd build/web
-      #     zip -r web-app.zip .
-
       - name: Build ios
         if: ${{ runner.os == 'macOS' }}
         run: |
@@ -71,16 +64,36 @@ jobs:
           ln -s ../Runner.app
           cd ..
           zip -r app.ipa Payload
-      
-      # - name: Build exe
-      #   if: ${{ runner.os == 'Windows'}}
-      #   run: |
-      #     flutter build windows
 
-      # - name: Build mac
-      #   if: ${{ runner.os == 'macOS'}}
-      #   run: |
-      #     flutter build macos
+      - name: Build Web
+        if: ${{runner.os == 'Linux'}}
+        run: |
+          flutter build web
+          cd build/web
+          zip -r web-app.zip .
+
+      - name: Build exe
+        if: ${{ runner.os == 'Windows'}}
+        run: |
+          flutter config --enable-windows-desktop
+          flutter build windows
+
+      - name: Set Up XCode
+        if: ${{ runner.os == 'macOS'}}
+        uses: devbotsxyz/xcode-select@v1.1.0
+
+      - name: Build mac
+        if: ${{ runner.os == 'macOS'}}
+        run: |
+          flutter config --enable-macos-desktop
+          flutter build macos
+      
+      - name: Build linux
+        if: ${{ runner.os == 'Linux' }}
+        run: |
+          sudo apt-get update && sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev
+          flutter config --enable-linux-desktop
+          flutter build linux
 
       # output some file:
       - name: artifact
@@ -92,8 +105,9 @@ jobs:
             build/app/outputs/flutter-apk/app.apk
             build/ios/**/*.ipa
             build/web/web-app.zip
-
-        
+            build/windows/runner/Release/
+            build/
+            
       # - name: Deploy iOS Beta to TestFlight via Fastlane
       #     uses: maierj/fastlane-action@v2.0.1
       #     with: