-
Notifications
You must be signed in to change notification settings - Fork 146
99 lines (89 loc) · 2.63 KB
/
task.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: task
on:
workflow_dispatch:
inputs:
PICA_DL_CONTENT:
description: '想下点什么?搜索/收藏夹/排行榜'
required: true
type: choice
default: search
options:
- search
- favorites
- leaderboard
PICA_DL_FAV_PAGE:
description: '指定下载收藏夹的第几页'
type: 'string'
default: '全部'
PICA_DL_SEARCH_KEYWORDS:
description: '搜索关键字或者漫画ID (多个用 # 隔开)'
type: string
PICA_DL_CHAPTER:
description: '指定下载章节 (示例:1,3,5-20)'
type: string
default: '全部'
OUTPUT_ZIP:
description: '每个章节打成独立压缩包'
type: boolean
default: true
UPLOAD_FILEIO:
description: '上传到 file.io'
type: boolean
default: true
# PICA_DL_CONCURRENCY:
# description: '下载并发数'
# required: true
# type: number
# default: 5
PICA_PRINT_FAVS:
description: '打印收藏夹的全部内容'
type: boolean
default: false
DEBUG:
description: '调试模式'
type: boolean
default: false
env:
DEBUG: ${{ inputs.DEBUG && 'pica' }}
PICA_PRINT_FAVS: ${{ inputs.PICA_PRINT_FAVS && 'true' || '' }}
PICA_IN_GITHUB: true # 用于区分运行环境,不要修改
PICA_ACCOUNT: ${{ secrets.PICA_ACCOUNT }}
PICA_PASSWORD: ${{ secrets.PICA_PASSWORD }}
# PICA_DL_CONCURRENCY: ${{ inputs.PICA_DL_CONCURRENCY }}
PICA_DL_CONTENT: ${{ inputs.PICA_DL_CONTENT }}
PICA_DL_SEARCH_KEYWORDS: ${{ inputs.PICA_DL_SEARCH_KEYWORDS }}
PICA_DL_CHAPTER: ${{ inputs.PICA_DL_CHAPTER }}
PICA_DL_FAV_PAGE: ${{ inputs.PICA_DL_FAV_PAGE }}
jobs:
download:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Install node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install deps and build
run: |
pnpm install
pnpm run build
- name: Download
run: pnpm start
- name: Compress
if: inputs.OUTPUT_ZIP
run: pnpm start:zip
- name: Upload to github
uses: actions/upload-artifact@v4
with:
name: pica-comics
path: ${{ inputs.OUTPUT_ZIP && 'comics-zip/' || 'comics/' }}
retention-days: 7
- name: Upload to file.io
if: inputs.UPLOAD_FILEIO
run: node scripts/upload.js