JMComic-Crawler-Python/.github/workflows/download.yml
2023-06-01 14:53:40 +08:00

60 lines
1.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: 下载JM本子
on:
push:
branches-ignore:
- 'master' # master专门用于发布pip和repo介绍
paths:
- '.github/workflows/download.yml' # 工作流定义
- 'usage/workflow_download.py' # 下载脚本
- 'assets/config/option_workflow_download.yml' # 配置文件
jobs:
crawler:
runs-on: ubuntu-latest
env:
JM_USERNAME: ${{ secrets.JM_USERNAME }}
JM_PASSWORD: ${{ secrets.JM_PASSWORD }}
JM_DOWNLOAD_DIR: /home/runner/work/jmcomic/download/
ZIP_NAME: '本子.tar.gz'
UPLOAD_NAME: '下载完成的本子'
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: 安装依赖项pip
if: ${{ github.ref == 'refs/heads/workflow' }}
run: |
python -m pip install --upgrade pip
pip install jmcomic -i https://pypi.org/project --upgrade
- name: 安装依赖项local
if: ${{ github.ref != 'refs/heads/workflow' }}
run: |
python -m pip install --upgrade pip
pip install commonX -i https://pypi.org/project --upgrade
pip install -e ./
- name: 运行下载脚本
run: |
cd ./usage/
python workflow_download.py
- name: 压缩文件
run: |
cd $JM_DOWNLOAD_DIR
tar -zcvf ../$ZIP_NAME ./
mv ../$ZIP_NAME .
- name: 上传结果
uses: actions/upload-artifact@v3
with:
name: ${{ env.UPLOAD_NAME }}
path: ${{ env.JM_DOWNLOAD_DIR }}/${{ env.ZIP_NAME }}
if-no-files-found: warn
retention-days: 90