Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
PDFMathTranslate-next/.github/workflows/exe-build.yml at main · dl-scripts/PDFMathTranslate-next · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
dl-scripts
PDFMathTranslate-next
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
PDFMathTranslate-next
/
.github
/
workflows
/
exe-build.yml
Copy path
View runs
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
172 lines (148 loc) · 6.61 KB
main
Breadcrumbs
PDFMathTranslate-next
/
.github
/
workflows
/
exe-build.yml
Copy path
Top
File metadata and controls
Code
Blame
172 lines (148 loc) · 6.61 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name
:
windows exe Release Workflow
on
:
workflow_dispatch
:
inputs
:
release_version
:
description
:
'
Release Version (e.g., v1.0.0)
'
required
:
true
type
:
string
#
push:
#
debug purpose
env
:
WIN_EXE_PYTHON_VERSION
:
3.13.3
jobs
:
build-win64-exe
:
runs-on
:
windows-latest
steps
:
-
name
:
checkout babeldoc metadata
uses
:
actions/checkout@v6
with
:
repository
:
funstory-ai/BabelDOC
path
:
babeldoctemp1234567
token
:
${{ secrets.GITHUB_TOKEN }}
sparse-checkout
:
babeldoc/assets/embedding_assets_metadata.py
-
name
:
Cached Assets
id
:
cache-assets
uses
:
actions/cache@v4.2.2
with
:
path
:
~/.cache/babeldoc
key
:
test-1-babeldoc-assets-${{ hashFiles('babeldoctemp1234567/babeldoc/assets/embedding_assets_metadata.py') }}
-
name
:
检出代码
uses
:
actions/checkout@v6
-
name
:
Setup uv with Python ${{ env.WIN_EXE_PYTHON_VERSION }}
uses
:
astral-sh/setup-uv@ed21f2f24f8dd64503750218de024bcf64c7250a
#
v7.1.5
with
:
python-version
:
${{ env.WIN_EXE_PYTHON_VERSION }}
enable-cache
:
true
cache-dependency-glob
:
"
pyproject.toml
"
activate-environment
:
true
-
name
:
执行所有任务(创建目录、下载、解压、复制文件、安装依赖)
shell
:
pwsh
run
:
|
Write-Host "==== 删除 babeldoctemp1234567 文件夹 ===="
if (Test-Path "./babeldoctemp1234567") {
Remove-Item -Path "./babeldoctemp1234567" -Recurse -Force
Write-Host "babeldoctemp1234567 文件夹已成功删除"
} else {
Write-Host "babeldoctemp1234567 文件夹不存在,无需删除"
}
Write-Host "==== 创建必要的目录 ===="
New-Item -Path "./build" -ItemType Directory -Force
New-Item -Path "./build/runtime" -ItemType Directory -Force
New-Item -Path "./dep_build" -ItemType Directory -Force
Write-Host "==== 复制代码到 dep_build ===="
Get-ChildItem -Path "./" -Exclude "dep_build", "build" | Copy-Item -Destination "./dep_build" -Recurse -Force
Write-Host "==== 下载并解压 Python ${{ env.WIN_EXE_PYTHON_VERSION }} ===="
Write-Host "pythonUrl: https://www.python.org/ftp/python/${{ env.WIN_EXE_PYTHON_VERSION }}/python-${{ env.WIN_EXE_PYTHON_VERSION }}-embed-amd64.zip"
$pythonUrl = "https://www.python.org/ftp/python/${{ env.WIN_EXE_PYTHON_VERSION }}/python-${{ env.WIN_EXE_PYTHON_VERSION }}-embed-amd64.zip"
$pythonZip = "./dep_build/python.zip"
Invoke-WebRequest -Uri $pythonUrl -OutFile $pythonZip
Expand-Archive -Path $pythonZip -DestinationPath "./build/runtime" -Force
Write-Host "==== 下载并解压 PyStand ===="
$pystandUrl = "https://github.com/skywind3000/PyStand/releases/download/1.1.4/PyStand-v1.1.4-exe.zip"
$pystandZip = "./dep_build/PyStand.zip"
Invoke-WebRequest -Uri $pystandUrl -OutFile $pystandZip
Expand-Archive -Path $pystandZip -DestinationPath "./dep_build/PyStand" -Force
Write-Host "==== 复制 PyStand.exe 到 build 并重命名 ===="
$pystandExe = "./dep_build/PyStand/PyStand-x64-CLI/PyStand.exe"
$destExe = "./build/pdf2zh.exe"
if (Test-Path $pystandExe) {
Copy-Item -Path $pystandExe -Destination $destExe -Force
} else {
Write-Host "错误: PyStand.exe 未找到!"
exit 1
}
Write-Host "==== 创建 Python venv 在 dep_build ===="
uv venv ./dep_build/venv
./dep_build/venv/Scripts/activate
Write-Host "==== 在 venv 环境中安装项目依赖 ===="
uv pip install .
Write-Host "==== 复制 venv/Lib/site-packages 到 build/ ===="
Copy-Item -Path "./dep_build/venv/Lib/site-packages" -Destination "./build/site-packages" -Recurse -Force
Write-Host "==== 复制 script/_pystand_static.int 到 build/ ===="
$staticFile = "./script/_pystand_static.int"
$destStatic = "./build/_pystand_static.int"
if (Test-Path $staticFile) {
Copy-Item -Path $staticFile -Destination $destStatic -Force
} else {
Write-Host "错误: script/_pystand_static.int 未找到!"
exit 1
}
uv run --active babeldoc --generate-offline-assets ./build
-
name
:
Upload build artifact
uses
:
actions/upload-artifact@v5
with
:
name
:
win64-exe
path
:
./build
if-no-files-found
:
error
compression-level
:
9
include-hidden-files
:
true
test-win64-exe
:
needs
:
-
build-win64-exe
runs-on
:
windows-latest
steps
:
-
name
:
检出代码
uses
:
actions/checkout@v6
-
name
:
Download build artifact
uses
:
actions/download-artifact@v6
with
:
name
:
win64-exe
path
:
./build
-
name
:
Test show version
run
:
|
./build/pdf2zh.exe --version
-
name
:
Test - Translate a PDF file with plain text only
run
:
|
./build/pdf2zh.exe ./test/file/translate.cli.plain.text.pdf -o ./test/file
-
name
:
Test - Translate a PDF file figure
run
:
|
./build/pdf2zh.exe ./test/file/translate.cli.text.with.figure.pdf -o ./test/file
-
name
:
Delete offline assets and cache
shell
:
pwsh
run
:
|
Write-Host "==== 查找并删除离线资源包 ===="
$offlineAssetsPath = Get-ChildItem -Path "./build" -Filter "offline_assets_*.zip" -Recurse | Select-Object -First 1 -ExpandProperty FullName
if ($offlineAssetsPath) {
Write-Host "找到离线资源包: $offlineAssetsPath"
Remove-Item -Path $offlineAssetsPath -Force
Write-Host "已删除离线资源包"
} else {
Write-Host "未找到离线资源包"
}
Write-Host "==== 删除缓存目录 ===="
$cachePath = "$env:USERPROFILE/.cache/babeldoc"
if (Test-Path $cachePath) {
Remove-Item -Path $cachePath -Recurse -Force
Write-Host "已删除缓存目录: $cachePath"
} else {
Write-Host "缓存目录不存在: $cachePath"
}
-
name
:
Test - Translate without offline assets
run
:
|
./build/pdf2zh.exe ./test/file/translate.cli.plain.text.pdf -o ./test/file
-
name
:
Upload test results
uses
:
actions/upload-artifact@v5
with
:
name
:
test-results
path
:
./test/file/
You can’t perform that action at this time.