Skip to content

Commit cd01f88

Browse files
YDX-2147483647fky2015
authored andcommitted
ci: 标注中文显示名
name 用于 URL,不能有汉字,但 display label 可以。 #493 (comment) https://github.com/adobe-fonts/source-han-serif/releases/tag/2.002R 就采用了这种方式。 - 大部分上传改用 [GitHub CLI](https://cli.github.com/manual/gh_release_upload),因为原来的 actions 似乎不支持指定 label,而且`gh release upload`更简单。 - 中文显示名参考了[网站][wiki]。 - 除`bithesis.pdf`外都标注了。 Relates-to: #389 [wiki]: https://github.com/BITNP/BIThesis-wiki/blob/ee2c335682486359e31a25cbb11fc77d909a0a42/wiki/guide/preface.md#qbithesis-%E9%83%BD%E5%8C%85%E5%90%AB%E5%93%AA%E4%BA%9B%E6%A8%A1%E6%9D%BF
1 parent 3ed9359 commit cd01f88

File tree

1 file changed

+41
-26
lines changed

1 file changed

+41
-26
lines changed

.github/workflows/release.yml

+41-26
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,21 @@ jobs:
5454
undergraduate-thesis-en,
5555
reading-report,
5656
]
57+
include:
58+
- template: graduate-thesis
59+
label: 硕博·学位论文
60+
- template: undergraduate-thesis
61+
label: 本科·毕业设计·论文
62+
- template: lab-report
63+
label: 实验报告
64+
- template: paper-translation
65+
label: 本科·毕业设计·外文翻译
66+
- template: presentation-slide
67+
label: 演示文档
68+
- template: undergraduate-thesis-en
69+
label: 本科·毕业设计·论文(全英文专业)
70+
- template: reading-report
71+
label: 本科·读书报告
5772

5873
steps:
5974
- uses: actions/checkout@v4
@@ -75,12 +90,11 @@ jobs:
7590
run: zip -qq -r ./${{ matrix.template }}.zip ./${{ matrix.template }}
7691
working-directory: ./templates
7792
- name: Upload ${{ matrix.template }}.zip to release
78-
uses: svenstaro/upload-release-action@v2
79-
with:
80-
repo_token: ${{ secrets.GITHUB_TOKEN }}
81-
file: ./templates/${{ matrix.template }}.zip
82-
asset_name: ${{ matrix.template }}.zip
83-
tag: ${{ github.ref }}
93+
run: |
94+
gh release upload ${{ github.ref }} \
95+
"./templates/${{ matrix.template }}.zip#模板包·${{ matrix.label }} — ${{ matrix.template }}.zip"
96+
env:
97+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8498

8599
publish_cls:
86100
name: Publish ${{ matrix.cls }}
@@ -89,21 +103,26 @@ jobs:
89103

90104
strategy:
91105
matrix:
92-
cls: [bithesis, bitreport, bitbeamer]
106+
cls:
107+
- name: bithesis
108+
label: 论文
109+
- name: bitreport
110+
label: 实验报告
111+
- name: bitbeamer
112+
label: 幻灯片
93113

94114
steps:
95115
- uses: actions/checkout@v4
96116
- name: Download *.cls
97117
uses: actions/download-artifact@v4
98118
with:
99119
name: cls
100-
- name: Upload ${{ matrix.cls }}.cls to release
101-
uses: svenstaro/upload-release-action@v2
102-
with:
103-
repo_token: ${{ secrets.GITHUB_TOKEN }}
104-
file: ${{ matrix.cls }}.cls
105-
asset_name: ${{ matrix.cls }}.cls
106-
tag: ${{ github.ref }}
120+
- name: Upload ${{ matrix.cls.name }}.cls to release
121+
run: |
122+
gh release upload ${{ github.ref }} \
123+
"${{ matrix.cls.name }}.cls#文档类·${{ matrix.cls.label }} — ${{ matrix.cls.name }}.cls(用于升级替换)"
124+
env:
125+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107126

108127
release_notes:
109128
name: Populate release notes with latest changelog and PDFs
@@ -156,18 +175,14 @@ jobs:
156175
with:
157176
name: handbooks
158177
path: handbook
159-
- name: Upload undergraduate-handbook
160-
uses: svenstaro/upload-release-action@v2
161-
with:
162-
repo_token: ${{ secrets.GITHUB_TOKEN }}
163-
file: handbook/undergraduate-handbook.pdf
164-
tag: ${{ github.ref }}
165-
- name: Upload graduate-handbook
166-
uses: svenstaro/upload-release-action@v2
167-
with:
168-
repo_token: ${{ secrets.GITHUB_TOKEN }}
169-
file: handbook/graduate-handbook.pdf
170-
tag: ${{ github.ref }}
178+
- name: Upload handbooks
179+
run: |
180+
gh release upload ${{ github.ref }} \
181+
"handbook/undergraduate-handbook.pdf#快速使用指南·本科"
182+
gh release upload ${{ github.ref }} \
183+
"handbook/graduate-handbook.pdf#快速使用指南·硕博"
184+
env:
185+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
171186

172187
upload_to_ctan:
173188
name: Upload to CTAN

0 commit comments

Comments
 (0)