Skip to content

Commit

Permalink
chore: 优化可执行文件构建流程
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeanAmier committed Nov 10, 2024
1 parent 5463854 commit 2c9ca72
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/Manually_build_executable_programs.yml.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Manually build executable programs
name: 手动构建可执行文件

on:
workflow_dispatch:

jobs:
build:
name: Build on ${{ matrix.os }}
name: 构建于 ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, windows-latest, macos-13 ]

steps:
- name: 签出存储库
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 设置 Python
uses: actions/setup-python@v5
Expand All @@ -29,13 +29,13 @@ jobs:
- name: 构建 Win 可执行文件
if: runner.os == 'Windows'
run: |
pyinstaller --icon=./static/XHS-Downloader.ico --add-data "static:static" --add-data "locale:locale" main.py
pyinstaller --icon=./static/XHS-Downloader.ico --add-data "static:static" --add-data "locale:locale" --collect-all emoji main.py
shell: pwsh

- name: 构建 Mac 可执行文件
if: runner.os == 'macOS'
run: |
pyinstaller --icon=./static/XHS-Downloader.icns --add-data "static:static" --add-data "locale:locale" main.py
pyinstaller --icon=./static/XHS-Downloader.icns --add-data "static:static" --add-data "locale:locale" --collect-all emoji main.py
- name: 上传文件
uses: actions/upload-artifact@v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/Release_build_executable_program.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release build executable program
name: 发布构建可执行文件

on:
release:
Expand All @@ -10,15 +10,15 @@ permissions:

jobs:
build:
name: Build on ${{ matrix.os }}
name: 构建于 ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, windows-latest, macos-13 ]

steps:
- name: 签出存储库
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 设置 Python
uses: actions/setup-python@v5
Expand All @@ -34,13 +34,13 @@ jobs:
- name: 构建 Win 可执行文件
if: runner.os == 'Windows'
run: |
pyinstaller --icon=./static/XHS-Downloader.ico --add-data "static:static" --add-data "locale:locale" main.py
pyinstaller --icon=./static/XHS-Downloader.ico --add-data "static:static" --add-data "locale:locale" --collect-all emoji main.py
shell: pwsh

- name: 构建 Mac 可执行文件
if: runner.os == 'macOS'
run: |
pyinstaller --icon=./static/XHS-Downloader.icns --add-data "static:static" --add-data "locale:locale" main.py
pyinstaller --icon=./static/XHS-Downloader.icns --add-data "static:static" --add-data "locale:locale" --collect-all emoji main.py
- name: 创建压缩包
run: |
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Push Docker Image
name: 自动构建并发布 Docker 镜像

on:
release:
Expand All @@ -11,7 +11,7 @@ jobs:

steps:
- name: 拉取源码
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1

Expand All @@ -34,6 +34,3 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/xhs-downloader:${{ github.event.release.tag_name }}

- name: Post build notifications
run: echo "Docker image has been built and pushed successfully"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ httpx>=0.27.0
fastapi>=0.112.1
uvicorn>=0.30.6
aiofiles>=24.1.0
emoji>=2.12.1
emoji>=2.14.0

0 comments on commit 2c9ca72

Please sign in to comment.