-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (125 loc) · 5.08 KB
/
CI.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: release CI
on:
# Push激活,去掉#开启
# push:
# 定时激活
# schedule:
# - cron: '30 * * * *'
# 每30分钟:'30 * * * *'
# 每1小时:'* 1 * * *'
# !最少5分钟
# 接受目标仓库的dispatch激活
repository_dispatch:
# types: [do_archive]
jobs:
transport:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# 运行工具
- name: Run ReleaseDelivr
run: |
ls
chmod 777 ReleaseDelivr
./ReleaseDelivr
ls
# 读取最新版本号
- name: Read target version
id: tVer
uses: juliangruber/read-file-action@v1
with:
path: ./version
trim: false
# 读取旧版本号
- name: Read current version
id: cVer
uses: juliangruber/read-file-action@v1
with:
path: ./old_version
trim: false
- run: |
echo "tVer=${{ steps.tVer.outputs.content }}" >> $GITHUB_ENV
echo "cVer=${{ steps.cVer.outputs.content }}" >> $GITHUB_ENV
# - name: push
# if: env.cVer != env.tVer
# uses: github-actions-x/[email protected]
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# push-branch: master
# commit-message: 'Automatically pushed by GitHub Actions'
# rebase: 'true' # pull abd rebase before commit
# force-add: 'true'
# # !请替换
# name: Purple-CSGO
# email: [email protected]
- uses: stefanzweifel/git-auto-commit-action@v4
name: push-new
with:
# Optional. Commit message for the created commit.
# Defaults to "Apply automatic changes"
commit_message: Automated Change
# Optional. Local and remote branch name where commit is going to be pushed
# to. Defaults to the current branch.
# You might need to set `create_branch: true` if the branch does not exist.
branch: master
# Optional. Options used by `git-commit`.
# See https://git-scm.com/docs/git-commit#_options
commit_options: '--no-verify --signoff'
# Optional glob pattern of files which should be added to the commit
# Defaults to all (.)
# See the `pathspec`-documentation for git
# - https://git-scm.com/docs/git-add#Documentation/git-add.txt-ltpathspecgt82308203
# - https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec
# file_pattern: src/*.js tests/*.js *.php
# Optional. Local file path to the repository.
# Defaults to the root of the repository.
repository: .
# Optional commit user and author settings
commit_user_name: My GitHub Actions Bot # defaults to "github-actions[bot]"
commit_user_email: [email protected] # defaults to "github-actions[bot]@users.noreply.github.com"
commit_author: Author <[email protected]> # defaults to author of the commit that triggered the run
# Optional. Tag name being created in the local repository and
# pushed to remtoe repository and defined branch.
# tagging_message: 'v1.0.0'
# Optional. Option used by `git-status` to determine if the repository is
# dirty. See https://git-scm.com/docs/git-status#_options
# status_options: '--untracked-files=no'
# Optional. Options used by `git-add`.
# See https://git-scm.com/docs/git-add#_options
add_options: '-u'
# Optional. Options used by `git-push`.
# See https://git-scm.com/docs/git-push#_options
push_options: '--force'
# Optional. Disable dirty check and always try to create a commit and push
skip_dirty_check: true
# Optional. Skip internal call to `git fetch`
skip_fetch: true
# Optional. Skip internal call to `git checkout`
skip_checkout: true
# Optional. Prevents the shell from expanding filenames.
# Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html
disable_globbing: true
# Optional. Create given branch name in local and remote repository.
create_branch: true
# 等待10s 以防先发布再push
- name: Sleep for 10 seconds
if: env.cVer != env.tVer
uses: jakejarvis/wait-action@master
with:
time: '10s'
# 读取下载地址
- name: Read DownloadLink
if: env.cVer != env.tVer
id: downloadlink
uses: juliangruber/read-file-action@v1
with:
path: ./download_link
# 运行工具
- name: Github Release create, update, and upload assets
if: env.cVer != env.tVer
uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.tVer.outputs.content }}
name: ${{ steps.tVer.outputs.content }}
body: 下载链接:</br>${{ steps.downloadlink.outputs.content }}