Skip to content

* 使用脚本自动打包发布源 #55

* 使用脚本自动打包发布源

* 使用脚本自动打包发布源 #55

Workflow file for this run

name: JS爬虫发布
on:
push:
tags:
- jsV[0-9]+.*
jobs:
build:
name: TVSpider
runs-on: ubuntu-latest # 如果是镜像中启动无法获取git信息
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ] #, "macos-latest", "windows-latest"
steps:
- name: 下载代码
uses: actions/checkout@v3
with:
repository: jadehh/TVSpider
fetch-depth: 0 # 显示所有提交的日志
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
- name: 下载需要打包更新的代码
uses: actions/checkout@v3
with:
repository: jadehh/TVSpider
ref: js
path: code
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: TV Config文件生成
run: |
pip install https://github.com/jadehh/pythonTools/releases/download/JadeV2.1.7/jade-2.1.7-py3-none-any.whl
python build.py --aliToken "${{ secrets.Ali_TOKEN }}"
- name: 上传Config
run: |
git config --global user.email "[email protected]"
git config --global user.name "jade"
git add 18_open_config.json
git add 18_tv_config.json
git add open_config.json
git add tv_config.json
commit_msg="* 更新TVConfig"
git commit -a -m "$commit_msg"
- name: Config上传Github分支
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_PAT }}
repository: jadehh/TVSpider
directory: .
branch: js
force: true
tags: true
env:
GITHUB_ACTOR: jadehh
- name: Config上传Gitee分支
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GT_TOKEN }}
repository: jadehh_743/TVSpider
directory: .
branch: js
force: true
tags: true
github_url: https://gitee.com
env:
GITHUB_ACTOR: jadehh
- name: 发布版本
run: |
cd code/nodejs
npm install qs --save
npm install
npm run build
- name: 新建分支
run: |
git config --global user.email "[email protected]"
git config --global user.name "jade"
checkname=$(git rev-list --max-parents=0 HEAD)
git checkout $checkname -b dist ##分支不存在用这个
# git checkout dist ## 分支已存在用这个
cp -r code/nodejs/dist/* ./
cp -r code/nodejs/readme.md ./README.md
git add index.config.js
git add index.config.js.md5
git add index.js
git add index.js.md5
git add README.md
commit_msg="* 发布 CatVodOpen新源"
git commit -a -m "$commit_msg"
- name: 查看分支
run: |
ls -l
- name: 上传Github分支
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_PAT }}
repository: jadehh/TVSpider
directory: .
branch: dist
force: true
tags: true
env:
GITHUB_ACTOR: jadehh
- name: 上传Gitee分支
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GT_TOKEN }}
repository: jadehh_743/TVSpider
directory: .
branch: dist
force: true
tags: true
github_url: https://gitee.com
env:
GITHUB_ACTOR: jadehh