-
-
Notifications
You must be signed in to change notification settings - Fork 1
178 lines (176 loc) · 7.43 KB
/
auto_release.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
on:
push:
paths:
- 'Taromati2/**'
- 'ssp/**'
- 'build_resources/for_ssp/**'
workflow_dispatch:
inputs:
pre-release:
description: '是否是预发布(通常用于测试包构建,不会影响latest链接)'
required: true
default: 'false'
rebuild-all:
description: '是否重新构建所有包'
required: true
default: 'false'
name: auto release
jobs:
check:
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
name: auto check before release
runs-on: windows-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: shiori-check
uses: Taromati2/yaya-CI-check@v2
with:
shiori-path: .\Taromati2\ghost\master\shiori\aya.dll
build:
name: auto release
needs: check
runs-on: ubuntu-latest
steps:
- name: disable auto crlf
uses: steve02081504/disable-autocrlf@v1
with:
fuck-auto-CRLF: true
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 7
- name: changed-ghost-check
uses: marceloprado/has-changed-path@v1
id: changed-ghost
with:
paths: Taromati2
- name: changed-full-data-pack-check
uses: marceloprado/has-changed-path@v1
id: changed-full-data-pack
with:
paths: full_data_pack
- name: changed-ssp-check
uses: marceloprado/has-changed-path@v1
id: changed-ssp
with:
paths: ssp
- name: changed-ison-check
uses: marceloprado/has-changed-path@v1
id: changed-icon
with:
paths: build_resources/nar_icons
- name: only ssp updated
if: steps.changed-ghost.outputs.changed == 'false' && steps.changed-ssp.outputs.changed == 'true'
run: |
echo "release-massages=(只有ssp更新了)" >> $GITHUB_ENV
- name: only ghost updated
if: steps.changed-ssp.outputs.changed == 'false' && steps.changed-ghost.outputs.changed == 'true'
run: |
echo "release-massages=(只有ghost更新了)" >> $GITHUB_ENV
- name: ghost and ssp updated
if: steps.changed-ghost.outputs.changed == 'true' && steps.changed-ssp.outputs.changed == 'true'
run: |
echo "release-massages=(ghost&ssp更新)" >> $GITHUB_ENV
- name: nar icons updated
if: steps.changed-ghost.outputs.changed == 'false' && steps.changed-ssp.outputs.changed == 'false' && steps.changed-icon.outputs.changed == 'true'
run: |
echo "release-massages=(nar图标更新)" >> $GITHUB_ENV
- name: full data pack updated
if: steps.changed-ghost.outputs.changed == 'false' && steps.changed-ssp.outputs.changed == 'false' && steps.changed-full-data-pack.outputs.changed == 'true'
run: |
echo "release-massages=(数据包更新)" >> $GITHUB_ENV
- name: others updated
if: steps.changed-ghost.outputs.changed == 'false' && steps.changed-ssp.outputs.changed == 'false' && steps.changed-icon.outputs.changed == 'false'
run: |
echo "release-massages=(附件更新)" >> $GITHUB_ENV
- name: build StarterPack
run: |
mv build_resources/for_release/* .
/bin/cp -rf build_resources/for_ssp/* ./ssp
/bin/cp -rf Taromati2/ghost/master/shiori/aya.dll ssp/ghost/ssper/ghost/master/ssper.dll
/bin/cp -rf build_resources/nar_icons/Taromati2/.nar_icon ./.nar_icon
7z a -tzip "Taromati2.nar" -mx=0 -mmt -mtc=off "Taromati2" ".nar_icon"
7z a -t7z "StarterPack.7z" -mx=9 -mmt -mtm=off -ms=512m -mhc -mhcf -m0=LZMA2:a=2:d=1536m:mf=bt4:fb=273:lc=4:lp=0:pb=4 "Taromati2.nar" "ssp" "使用方法.txt"
rm -rf Taromati2.nar
- name: build ssp pack
run: |
7z a -t7z "ssp.7z" -mx=9 -mmt -mtm=off -ms=512m -mhc -mhcf -m0=LZMA2:a=2:d=1536m:mf=bt4:fb=273:lc=4:lp=0:pb=4 ./ssp/*
cat build_resources/7z.sfx ssp.7z > ssp.exe
- name: get nar
if: steps.changed-ghost.outputs.changed == 'false' && steps.changed-icon.outputs.changed == 'false' && github.event.inputs.rebuild-all != 'true'
run: |
aria2c https://github.com/Taromati2/package-factory/releases/latest/download/Taromati2.nar
- name: build nar
if: steps.changed-ghost.outputs.changed == 'true' || steps.changed-icon.outputs.changed == 'true' || github.event.inputs.rebuild-all == 'true'
run: |
rm -rf ./.nar_icon
/bin/cp -rf build_resources/nar_icons/Taromati2/.nar_icon ./.nar_icon
7z a -tzip "Taromati2.nar" -mx=9 -mmt -mm=LZMA -md=1536m -mfb=273 -mtc=off "Taromati2" ".nar_icon"
- name: get full data pack
if: steps.changed-full-data-pack.outputs.changed == 'false' && steps.changed-icon.outputs.changed == 'false' && github.event.inputs.rebuild-all != 'true'
run: |
aria2c https://github.com/Taromati2/package-factory/releases/latest/download/full_data_pack.nar
- name: build full data pack
if: steps.changed-full-data-pack.outputs.changed == 'true' || steps.changed-icon.outputs.changed == 'true' || github.event.inputs.rebuild-all == 'true'
run: |
rm -rf ./.nar_icon
/bin/cp -rf build_resources/nar_icons/full_data_pack/.nar_icon ./.nar_icon
7z a -tzip "full_data_pack.nar" -mx=9 -mmt -mm=LZMA -md=1536m -mfb=273 -mtc=off "full_data_pack" ".nar_icon"
- uses: dev-drprasad/delete-older-releases@v0.3.2
with:
keep_latest: 7
keep_min_download_counts: 24
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
- name: create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
with:
tag_name: ${{ github.run_id }}
release_name: auto build
body: |
自动构建的包文件
仅此而已
${{ env.release-massages }}
draft: false
prerelease: ${{ github.event.inputs.prerelease == 'true' }}
- name: upload StarterPack
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./StarterPack.7z
asset_name: StarterPack.7z
asset_content_type: application/zip
- name: upload nar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Taromati2.nar
asset_name: Taromati2.nar
asset_content_type: application/zip
- name: upload full data pack
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./full_data_pack.nar
asset_name: full_data_pack.nar
asset_content_type: application/zip
- name: upload ssp pack
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ssp.exe
asset_name: ssp.exe
asset_content_type: application/vnd.microsoft.portable-executable