mirror of
https://github.com/JoeanAmier/XHS-Downloader.git
synced 2025-12-26 04:48:05 +08:00
chore: 使用 Actions 构建可执行文件
This commit is contained in:
parent
4d531e85d9
commit
24dc8a1a53
38
.github/workflows/executable_build.yml
vendored
Normal file
38
.github/workflows/executable_build.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
name: Build Executables
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
python-version: [3.12]
|
||||
|
||||
steps:
|
||||
- name: 签出存储库
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: 设置 Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: 安装依赖项
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
pip install pyinstaller
|
||||
|
||||
- name: 构建可执行文件
|
||||
run: |
|
||||
pyinstaller --icon=/static/images/TikTokDownloader.ico --add-data "static;static" --add-data "templates;templates" main.py
|
||||
|
||||
- name: 上传文件
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: executable-${{ matrix.os }}
|
||||
path: dist/
|
||||
@ -9,7 +9,7 @@ COPY LICENSE /LICENSE
|
||||
COPY main.py /main.py
|
||||
COPY requirements.txt /requirements.txt
|
||||
|
||||
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user