-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (121 loc) · 4.45 KB
/
build-multi-platform.yml
File metadata and controls
130 lines (121 loc) · 4.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Build Multi-Platform Binaries
on:
pull_request:
branches: [develop, main]
types: [opened, synchronize, reopened]
concurrency:
group: pr-binaries-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
jobs:
build-macos-intel:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.32.0"
channel: stable
cache: true
- run: flutter pub get
- run: dart compile exe bin/main.dart -o api_tool_macos_intel
- name: Verify binary
run: |
git clone --depth 1 --branch develop https://github.com/Tencent/tdesign-flutter.git
dart run .github/scripts/cross_platform_verify.dart tdesign-flutter api_tool_macos_intel
- 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
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.32.0"
channel: stable
cache: true
- run: flutter pub get
- run: dart compile exe bin/main.dart -o api_tool_macos_arm64 --target-os=macos --target-arch=arm64
- name: Verify binary
run: |
git clone --depth 1 --branch develop https://github.com/Tencent/tdesign-flutter.git
dart run .github/scripts/cross_platform_verify.dart tdesign-flutter api_tool_macos_arm64
- 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
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.32.0"
channel: stable
cache: true
- run: flutter pub get
- run: dart compile exe bin/main.dart -o api_tool_linux --target-arch=x64
- name: Verify binary
run: |
git clone --depth 1 --branch develop https://github.com/Tencent/tdesign-flutter.git
dart run .github/scripts/cross_platform_verify.dart tdesign-flutter api_tool_linux
- 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
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.32.0"
channel: stable
cache: true
- run: flutter pub get
- run: dart compile exe bin/main.dart -o api_tool_windows.exe
- name: Verify binary
shell: bash
run: |
git clone --depth 1 --branch develop https://github.com/Tencent/tdesign-flutter.git
dart run .github/scripts/cross_platform_verify.dart tdesign-flutter api_tool_windows.exe
- uses: actions/upload-artifact@v4
with:
name: api_tool_windows
path: api_tool_windows.exe
comment-on-pr:
name: 更新二进制产物 PR 评论
needs: [build-macos-intel, build-macos-arm64, build-linux-x64, build-windows-x64]
runs-on: ubuntu-latest
steps:
- name: 组装产物下载链接
id: binary-comment
env:
GH_REPO: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}
run: |
base="https://github.com/${GH_REPO}/actions/runs/${RUN_ID}"
{
echo 'body<<EOF'
echo "✅ 编译完成,产物如下:"
echo "- [api_tool_macos_intel](${base}/artifacts)(job: build-macos-intel)"
echo "- [api_tool_macos_arm64](${base}/artifacts)(job: build-macos-arm64)"
echo "- [api_tool_linux](${base}/artifacts)(job: build-linux-x64)"
echo "- [api_tool_windows](${base}/artifacts)(job: build-windows-x64)"
echo ""
echo "<!-- AUTO_BINARY_BUILD_HOOK -->"
echo ""
echo "_在 Actions 运行页 Artifacts 区域按平台名称下载。_"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: 更新 PR 评论
uses: TDesignOteam/workflows/actions/maintain-one-comment@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ steps.binary-comment.outputs.body }}
number: ${{ github.event.pull_request.number }}
body-include: "<!-- AUTO_BINARY_BUILD_HOOK -->"