-
Notifications
You must be signed in to change notification settings - Fork 2
122 lines (110 loc) · 3.5 KB
/
build.yml
File metadata and controls
122 lines (110 loc) · 3.5 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
name: Build
on:
workflow_dispatch:
inputs:
build-windows-installer:
description: Build Windows Installer
type: boolean
default: true
build-windows-portable:
description: Build Windows Portable
type: boolean
default: true
build-python3-zipapp:
description: Build Python 3 Zip Application
type: boolean
default: true
build-python3-wheel:
description: Build Python 3 Wheel
type: boolean
default: true
workflow_call:
inputs:
build-windows-installer:
description: Build Windows Installer
type: boolean
default: false
build-windows-portable:
description: Build Windows Portable
type: boolean
default: false
build-python3-zipapp:
description: Build Python 3 Zip Application
type: boolean
default: false
build-python3-wheel:
description: Build Python 3 Wheel
type: boolean
default: false
permissions:
contents: read
jobs:
# 合并相似的构建以加快速度、节约成本。
build-windows-installer-and-portable:
if: ${{ inputs.build-windows-installer || inputs.build-windows-portable }}
name: Build Windows Installer and Portable
runs-on: windows-latest
env:
UV_NO_DEFAULT_GROUPS: true
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.0.0
- uses: actions/setup-python@v6
with:
python-version-file: ".python-version"
- name: Build Installer
if: ${{ inputs.build-windows-installer }}
run: uv run --group build --group basic poe build-installer
- name: Build Portable Package
if: ${{ inputs.build-windows-portable }}
run: uv run --group build --group basic poe build-portable
- name: Upload Installer
id: upload-installer
if: ${{ inputs.build-windows-installer }}
uses: actions/upload-artifact@v7
with:
name: windows-installer
path: dist/*-setup.exe
if-no-files-found: error
- name: Upload Portable Package
id: upload-portable
if: ${{ inputs.build-windows-portable }}
uses: actions/upload-artifact@v7
with:
name: windows-portable
path: dist/*-portable.zip
if-no-files-found: error
build-python3-zipapp-and-wheel:
if: ${{ inputs.build-python3-zipapp || inputs.build-python3-wheel }}
name: Build Python 3 ZIP Application and Wheel
runs-on: ubuntu-latest
env:
UV_NO_DEFAULT_GROUPS: true
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.0.0
- uses: actions/setup-python@v6
with:
python-version-file: ".python-version"
- name: Build Zipapp
if: ${{ inputs.build-python3-zipapp }}
run: uv run --group build --group basic poe build-zipapp
- name: Build Wheel
if: ${{ inputs.build-python3-wheel }}
run: uv run --group build --group basic poe build-wheel
- name: Upload Zipapp
id: upload-zipapp
if: ${{ inputs.build-python3-zipapp }}
uses: actions/upload-artifact@v7
with:
name: python3-zipapp
path: dist/*.pyzw
if-no-files-found: error
- name: Upload Wheel
id: upload-wheel
if: ${{ inputs.build-python3-wheel }}
uses: actions/upload-artifact@v7
with:
name: python3-wheel
path: dist/*.whl
if-no-files-found: error