ci: 添加版本变更自动发布 CI #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Multi-Platform Binaries | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| build-macos-intel: | |
| uses: ./.github/workflows/build-reusable.yml | |
| with: | |
| runner: macos-latest | |
| artifact-name: api_tool_macos_intel | |
| binary-name: api_tool_macos_intel | |
| build-macos-arm64: | |
| uses: ./.github/workflows/build-reusable.yml | |
| with: | |
| runner: macos-latest | |
| artifact-name: api_tool_macos_arm64 | |
| binary-name: api_tool_macos_arm64 | |
| compile-args: '--target-os=macos --target-arch=arm64' | |
| build-linux-x64: | |
| uses: ./.github/workflows/build-reusable.yml | |
| with: | |
| runner: ubuntu-latest | |
| artifact-name: api_tool_linux | |
| binary-name: api_tool_linux | |
| compile-args: '--target-arch=x64' | |
| build-windows-x64: | |
| uses: ./.github/workflows/build-reusable.yml | |
| with: | |
| runner: windows-latest | |
| artifact-name: api_tool_windows | |
| binary-name: api_tool_windows.exe | |
| comment-on-pr: | |
| needs: [build-macos-intel, build-macos-arm64, build-linux-x64, build-windows-x64] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - 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 }}) | |
| - [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 |