From 9c3b8715c2c7ab46c9eac8bc2c39aa03541ba4cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E8=8F=9C=20Cai?= Date: Wed, 27 Aug 2025 02:31:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=E5=A4=9A?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=9E=84=E5=BB=BA=20ci=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=20macOS=E3=80=81Linux=20=E5=92=8C=20Windows=20?= =?UTF-8?q?=E7=9A=84=E4=BA=8C=E8=BF=9B=E5=88=B6=E6=96=87=E4=BB=B6=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-multi-platform.yml | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 .github/workflows/build-multi-platform.yml diff --git a/.github/workflows/build-multi-platform.yml b/.github/workflows/build-multi-platform.yml new file mode 100644 index 0000000..7810fc3 --- /dev/null +++ b/.github/workflows/build-multi-platform.yml @@ -0,0 +1,105 @@ +name: Build Multi-Platform Binaries + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build-macos-intel: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: '3.32.0' + - name: Install dependencies + run: flutter pub get + - name: Setup Dart + uses: dart-lang/setup-dart@v1 + - name: Build macOS Intel + run: dart compile exe bin/main.dart -o api_tool_macos_intel + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: api_tool_macos_intel + path: api_tool_macos_intel + + build-macos-arm64: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: '3.32.0' + - name: Install dependencies + run: flutter pub get + - name: Setup Dart + uses: dart-lang/setup-dart@v1 + - name: Build macOS ARM64 + run: dart compile exe bin/main.dart -o api_tool_macos_arm64 --target-os=macos --target-arch=arm64 + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: api_tool_macos_arm64 + path: api_tool_macos_arm64 + + build-linux-x64: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: '3.32.0' + - name: Install dependencies + run: flutter pub get + - name: Setup Dart + uses: dart-lang/setup-dart@v1 + - name: Build Linux x64 + run: dart compile exe bin/main.dart -o api_tool_linux + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: api_tool_linux + path: api_tool_linux + + build-windows-x64: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: '3.32.0' + - name: Install dependencies + run: flutter pub get + - name: Setup Dart + uses: dart-lang/setup-dart@v1 + - name: Build Windows x64 + run: dart compile exe bin/main.dart -o api_tool_windows + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: api_tool_windows + path: api_tool_windows + + comment-on-pr: + needs: [build-macos-intel, build-macos-arm64, build-linux-x64, build-windows-x64] + runs-on: ubuntu-latest + steps: + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + path: ./artifacts + - name: Create PR Comment + uses: peter-evans/create-or-update-comment@v4 + with: + issue-number: ${{ github.event.pull_request.number }} + body: | + ✅ 编译完成,产物如下: + - [api_tool_macos_intel](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) + - [api_tool_macos_arm64](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) + - [api_tool_linux](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) + - [api_tool_windows](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) From 9497aa64a6218732417ce6385522025033a36c1e Mon Sep 17 00:00:00 2001 From: RSS1102 Date: Tue, 16 Sep 2025 17:36:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E5=A4=9A?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=9E=84=E5=BB=BA=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E8=BE=93=E5=87=BA=E5=B7=A5=E4=BB=B6?= =?UTF-8?q?=20ID=20=E5=92=8C=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-multi-platform.yml | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-multi-platform.yml b/.github/workflows/build-multi-platform.yml index 7810fc3..4afdb64 100644 --- a/.github/workflows/build-multi-platform.yml +++ b/.github/workflows/build-multi-platform.yml @@ -7,6 +7,9 @@ on: jobs: build-macos-intel: runs-on: macos-latest + outputs: + artifact_id: ${{ steps.upload.outputs.artifact-id }} + artifact_url: ${{ steps.upload.outputs.artifact-url }} steps: - uses: actions/checkout@v4 - name: Setup Flutter @@ -20,6 +23,7 @@ jobs: - name: Build macOS Intel run: dart compile exe bin/main.dart -o api_tool_macos_intel - name: Upload Artifact + id: upload uses: actions/upload-artifact@v4 with: name: api_tool_macos_intel @@ -27,6 +31,9 @@ jobs: build-macos-arm64: runs-on: macos-latest + outputs: + artifact_id: ${{ steps.upload.outputs.artifact-id }} + artifact_url: ${{ steps.upload.outputs.artifact-url }} steps: - uses: actions/checkout@v4 - name: Setup Flutter @@ -40,6 +47,7 @@ jobs: - name: Build macOS ARM64 run: dart compile exe bin/main.dart -o api_tool_macos_arm64 --target-os=macos --target-arch=arm64 - name: Upload Artifact + id: upload uses: actions/upload-artifact@v4 with: name: api_tool_macos_arm64 @@ -47,6 +55,9 @@ jobs: build-linux-x64: runs-on: ubuntu-latest + outputs: + artifact_id: ${{ steps.upload.outputs.artifact-id }} + artifact_url: ${{ steps.upload.outputs.artifact-url }} steps: - uses: actions/checkout@v4 - name: Setup Flutter @@ -60,6 +71,7 @@ jobs: - name: Build Linux x64 run: dart compile exe bin/main.dart -o api_tool_linux - name: Upload Artifact + id: upload uses: actions/upload-artifact@v4 with: name: api_tool_linux @@ -67,6 +79,9 @@ jobs: build-windows-x64: runs-on: windows-latest + outputs: + artifact_id: ${{ steps.upload.outputs.artifact-id }} + artifact_url: ${{ steps.upload.outputs.artifact-url }} steps: - uses: actions/checkout@v4 - name: Setup Flutter @@ -80,6 +95,7 @@ jobs: - name: Build Windows x64 run: dart compile exe bin/main.dart -o api_tool_windows - name: Upload Artifact + id: upload uses: actions/upload-artifact@v4 with: name: api_tool_windows @@ -89,17 +105,13 @@ jobs: needs: [build-macos-intel, build-macos-arm64, build-linux-x64, build-windows-x64] runs-on: ubuntu-latest steps: - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: ./artifacts - name: Create PR Comment uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{ github.event.pull_request.number }} body: | ✅ 编译完成,产物如下: - - [api_tool_macos_intel](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - - [api_tool_macos_arm64](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - - [api_tool_linux](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - - [api_tool_windows](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) + - [api_tool_macos_intel](${{ needs.build-macos-intel.outputs.artifact_url }}) (ID: ${{ needs.build-macos-intel.outputs.artifact_id }}) + - [api_tool_macos_arm64](${{ needs.build-macos-arm64.outputs.artifact_url }}) (ID: ${{ needs.build-macos-arm64.outputs.artifact_id }}) + - [api_tool_linux](${{ needs.build-linux-x64.outputs.artifact_url }}) (ID: ${{ needs.build-linux-x64.outputs.artifact_id }}) + - [api_tool_windows](${{ needs.build-windows-x64.outputs.artifact_url }}) (ID: ${{ needs.build-windows-x64.outputs.artifact_id }}) From 82aab5e0f87ac48d2eee06535ef8e06ec558d49f Mon Sep 17 00:00:00 2001 From: RSS1102 Date: Tue, 16 Sep 2025 18:18:49 +0800 Subject: [PATCH 3/3] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=20PR=20?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E6=AD=A5=E9=AA=A4=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9F=A5=E6=89=BE=E8=AF=84=E8=AE=BA=E5=8A=9F=E8=83=BD=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BE=93=E5=87=BA=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-multi-platform.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-multi-platform.yml b/.github/workflows/build-multi-platform.yml index 4afdb64..5988fd1 100644 --- a/.github/workflows/build-multi-platform.yml +++ b/.github/workflows/build-multi-platform.yml @@ -105,13 +105,23 @@ jobs: needs: [build-macos-intel, build-macos-arm64, build-linux-x64, build-windows-x64] runs-on: ubuntu-latest steps: - - name: Create PR Comment + - name: Find Comment + id: find-comment + uses: peter-evans/find-comment@v3 + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: 编译完成,产物如下 + + - name: Create or Update PR Comment uses: peter-evans/create-or-update-comment@v4 with: + comment-id: ${{ steps.find-comment.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} body: | ✅ 编译完成,产物如下: - - [api_tool_macos_intel](${{ needs.build-macos-intel.outputs.artifact_url }}) (ID: ${{ needs.build-macos-intel.outputs.artifact_id }}) - - [api_tool_macos_arm64](${{ needs.build-macos-arm64.outputs.artifact_url }}) (ID: ${{ needs.build-macos-arm64.outputs.artifact_id }}) - - [api_tool_linux](${{ needs.build-linux-x64.outputs.artifact_url }}) (ID: ${{ needs.build-linux-x64.outputs.artifact_id }}) - - [api_tool_windows](${{ needs.build-windows-x64.outputs.artifact_url }}) (ID: ${{ needs.build-windows-x64.outputs.artifact_id }}) + - [api_tool_macos_intel](${{ needs.build-macos-intel.outputs.artifact_url }}) + - [api_tool_macos_arm64](${{ needs.build-macos-arm64.outputs.artifact_url }}) + - [api_tool_linux](${{ needs.build-linux-x64.outputs.artifact_url }}) + - [api_tool_windows](${{ needs.build-windows-x64.outputs.artifact_url }}) + edit-mode: replace