Skip to content

Commit 5a370e3

Browse files
authored
Github Actions下载工作流优化 (#4)
1 parent e852db3 commit 5a370e3

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

.github/workflows/action_workflow.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches: [ "workflow" ]
66
paths:
7+
- '.github/workflows/*.yml' # 工作流定义
78
- 'usage/**/*.py' # 工作流脚本
89
- 'assets/config/*.yml' # 工作流配置
910
pull_request:
@@ -17,10 +18,10 @@ jobs:
1718
runs-on: ubuntu-latest
1819
steps:
1920
- uses: actions/checkout@v3
20-
- name: Set up Python 3.10
21+
- name: Set up Python 3.11
2122
uses: actions/setup-python@v3
2223
with:
23-
python-version: "3.10"
24+
python-version: "3.11"
2425

2526
- name: 安装依赖项
2627
run: |
@@ -34,13 +35,14 @@ jobs:
3435
3536
- name: 压缩下载的漫画
3637
run: |
37-
zip -r /home/runner/work/jmcomic/download/下载完成的本子.zip /home/runner/work/jmcomic/download/*
38+
cd /home/runner/work/jmcomic/download/
39+
zip -r ./下载完成的本子.zip ./*
3840
3941
- name: 上传结果
4042
uses: actions/upload-artifact@v3
4143
with:
4244
# Artifact name
43-
name: 下载完成的本子.zip
45+
name: 下载完成的本子
4446
# A file, directory or wildcard pattern that describes what to upload
4547
path: /home/runner/work/jmcomic/download/下载完成的本子.zip
4648
# The desired behavior if no files are found using the provided path.

.github/workflows/action_workflow_local.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ on:
88
push:
99
branches: [ "workflow_local" ]
1010
paths:
11-
- 'src/**/*.py' # 源码
11+
- '.github/workflows/*.yml' # 工作流定义
1212
- 'usage/**/*.py' # 工作流脚本
1313
- 'assets/config/*.yml' # 工作流配置
14+
- 'src/**/*.py' # 源码
15+
1416
pull_request:
1517
branches: [ "workflow_local" ]
1618

@@ -22,10 +24,10 @@ jobs:
2224
runs-on: ubuntu-latest
2325
steps:
2426
- uses: actions/checkout@v3
25-
- name: Set up Python 3.10
27+
- name: Set up Python 3.11
2628
uses: actions/setup-python@v3
2729
with:
28-
python-version: "3.10"
30+
python-version: "3.11"
2931

3032
- name: 安装依赖项
3133
run: |
@@ -40,13 +42,14 @@ jobs:
4042
4143
- name: 压缩下载的漫画
4244
run: |
43-
zip -r /home/runner/work/jmcomic/download/下载完成的本子.zip /home/runner/work/jmcomic/download/*
45+
cd /home/runner/work/jmcomic/download/
46+
zip -r ./下载完成的本子.zip ./*
4447
4548
- name: 上传结果
4649
uses: actions/upload-artifact@v3
4750
with:
4851
# Artifact name
49-
name: 下载完成的本子.zip
52+
name: 下载完成的本子
5053
# A file, directory or wildcard pattern that describes what to upload
5154
path: /home/runner/work/jmcomic/download/下载完成的本子.zip
5255
# The desired behavior if no files are found using the provided path.

assets/config/workflow_option.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ dir_tree: !!python/object:jmcomic.jm_option.DownloadDirTree
66
disable_jm_module_debug: false
77
download_convert_image_suffix: null
88
download_image_then_decode: true
9-
download_multi_thread_photo_batch_count: 10 # 一次多线程批量下载的数量,太多了禁漫服务器可能顶不住
10-
download_multi_thread_photo_len_limit: 30
9+
download_multi_thread_photo_batch_count: 15 # 一次多线程批量下载的数量,太多了禁漫服务器可能顶不住
10+
download_multi_thread_photo_len_limit: 35
1111
download_use_disk_cache: true
1212

1313
client_config:

usage/jmcomic_workflows.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def get_option():
1111
422866
1212
1313
14+
1415
''')
1516

1617
# 调用jmcomic的download_album方法,下载漫画

0 commit comments

Comments
 (0)