Browse Source

Add 'flutter/.github/workflows/pc-build.yml'

天问 3 years ago
parent
commit
85e7dd608c
1 changed files with 86 additions and 0 deletions
  1. 86 0
      flutter/.github/workflows/pc-build.yml

+ 86 - 0
flutter/.github/workflows/pc-build.yml

@@ -0,0 +1,86 @@
+name: Build (Linux, Mac OS, Windows)
+
+on:
+  push:
+    branches: [main]
+  pull_request:
+    branches: [main]
+
+jobs:
+  build-linux:
+    name: "Build Linux"
+    runs-on: ubuntu-latest
+    env:
+      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+    steps:
+      - uses: actions/checkout@v2.3.4
+
+      - name: Setup Flutter SDK
+        uses: subosito/flutter-action@v1.4.0
+
+      - name: Install Linux build tools
+        run: sudo apt-get update && sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev
+
+      - name: Enable desktop
+        run: flutter config --enable-linux-desktop
+
+      - name: Get packages
+        run: flutter pub get
+
+      - name: Analyze
+        run: flutter analyze
+
+      - name: Flutter build app
+        run: flutter build linux
+        
+  build-macos:
+    name: "Build MacOS"
+    runs-on: macos-latest
+    env:
+      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+    steps:
+      - uses: actions/checkout@v2.3.4
+
+      - name: Setup Flutter SDK
+        uses: subosito/flutter-action@v1.4.0
+
+      - name: Set Up XCode
+        uses: devbotsxyz/xcode-select@v1.1.0
+
+      - name: Enable desktop
+        run: flutter config --enable-macos-desktop
+
+      - name: Get packages
+        run: flutter pub get
+
+      - name: Analyze
+        run: flutter analyze
+
+      - name: Flutter build app
+        run: flutter build macos
+
+  build-windows:
+    name: "Build Windows"
+    runs-on: windows-latest
+    env:
+      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+    steps:
+      - uses: actions/checkout@v2.3.4
+
+      - name: Setup Flutter SDK
+        uses: subosito/flutter-action@v1.4.0
+
+      - name: Enable desktop
+        run: flutter config --enable-windows-desktop
+
+      - name: Get packages
+        run: flutter pub get
+
+      - name: Analyze
+        run: flutter analyze
+
+      - name: Flutter build app
+        run: flutter build windows