-
Notifications
You must be signed in to change notification settings - Fork 302
64 lines (62 loc) · 1.84 KB
/
release.yaml
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
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: 发布版本
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/* ./
git add index.config.js
git add index.config.js.md5
git add index.js
git add index.js.md5
commit_msg="* 发布源"
git commit -a -m "$commit_msg"
- name: 查看分支
run: |
ls -l
- name: 上传分支
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