-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d09e01f
commit 16bc546
Showing
1 changed file
with
25 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,33 @@ | ||
name: Build Application | ||
name: Build Nuitka Project | ||
|
||
on: | ||
on: | ||
push: | ||
branches: | ||
- main # 监听 main 分支的 push 事件 | ||
- main # 监听 main 分支上的 push 事件 | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
runs-on: ubuntu-latest # 选择使用 Ubuntu 操作系统 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 # 拉取仓库代码 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 # 设置 Python 环境 | ||
with: | ||
python-version: '3.12' # 使用 Python 3.12 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Install Nuitka | ||
run: pip install nuitka # 安装 Nuitka 编译工具 | ||
|
||
- name: Compile with Nuitka | ||
run: | | ||
echo "Yes" | set NO_INTERACTION=1 && nuitka --standalone --onefile --output-dir=./build app.py | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: compiled-app # 上传的 artifact 名称 | ||
path: ./build/ # 构建目录 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 # Checkout 当前仓库的代码 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' # 配置 Python 版本 | ||
architecture: 'x64' | ||
|
||
- name: Install Requirements | ||
run: | | ||
pip install -r requirements.txt | ||
|
||
- name: Run Nuitka build with app.py | ||
uses: Nuitka/Nuitka-Action@main | ||
with: | ||
script-name: app.py | ||
mode: onefile | ||
nuitka-version: main | ||
|