Skip to content

Commit

Permalink
🤔
Browse files Browse the repository at this point in the history
  • Loading branch information
Shua-github committed Jan 22, 2025
1 parent d09e01f commit 16bc546
Showing 1 changed file with 25 additions and 29 deletions.
54 changes: 25 additions & 29 deletions .github/workflows/build.yml
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

0 comments on commit 16bc546

Please sign in to comment.