From 24dc8a1a539fab41e7cc43dde417a9eb4657fd1b Mon Sep 17 00:00:00 2001 From: JoeanAmier Date: Wed, 7 Aug 2024 21:06:01 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BD=BF=E7=94=A8=20Actions=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=8F=AF=E6=89=A7=E8=A1=8C=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/executable_build.yml | 38 ++++++++++++++++++++++++++ Dockerfile | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/executable_build.yml diff --git a/.github/workflows/executable_build.yml b/.github/workflows/executable_build.yml new file mode 100644 index 0000000..ba97d2e --- /dev/null +++ b/.github/workflows/executable_build.yml @@ -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/ diff --git a/Dockerfile b/Dockerfile index 64cc032..56ec246 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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