Install the CNS11643 full font when the GitHub action is executed, so that the correct Chinese fonts are available in the environment.
The most basic setting method:
steps :
- uses : hms5232/install-CNS11643-fonts-action@v1 # 依照需求設定版本號或是 SHA
Show action name:
steps :
- name : Install CNS11643 fonts
uses : hms5232/install-CNS11643-fonts-action@v1 # 依照需求設定版本號或是 SHA
If not specified, Block Regular and Song fonts will be installed. If you want to specify which fonts to install:
steps :
- uses : hms5232/install-CNS11643-fonts-action@v1 # 依照需求設定版本號或是 SHA
with :
kai : ' true ' # 正楷體
sung : ' true ' # 正宋體
※Due to issues with GitHub action, entering Boolean values is not currently supported, so please use strings! See: actions/runner#1483 for details
The tool for downloading fonts is wget. If you have debugging or other needs, you can use the download-flag
parameter to instruct wget output or behavior.
Default situation:
steps :
- uses : hms5232/install-CNS11643-fonts-action@v1 # 依照需求設定版本號或是 SHA
with :
download-flag : ' -nv ' # 本 action 預設值,代表 no verbose
Normal output (normal use of wget without special specification):
steps :
- uses : hms5232/install-CNS11643-fonts-action@v1 # 依照需求設定版本號或是 SHA
with :
download-flag : ' -v ' # wget 預設值,代表 verbose
debug output:
steps :
- uses : hms5232/install-CNS11643-fonts-action@v1 # 依照需求設定版本號或是 SHA
with :
download-flag : ' -d ' # 代表 debug
See the wget file for other parameters.
Since this parameter is directly injected into the input command, please use it with caution!
For details, please see the instructions at the end of each setting:
steps :
- uses : hms5232/install-CNS11643-fonts-action@v1 # 依照需求設定版本號或是 SHA
with :
kai : ' true ' # 正楷體
sung : ' true ' # 正宋體
timeout-minutes : 10 # 因為是即時下載,為避免因為伺服器問題卡住流程或耗盡額度,建議設定一個執行時限。此範例為十分鐘
# 下一個步驟
- name : your next step
if : always() # 避免字型安裝失敗導致中斷流程
This project updates the version number according to the semantic version number (SemVer).
The major version number will be cut out of branch management, for example: v1
; the minor version and patch version numbers use the tag function, for example: v1.0.6
.
When I executed some tests on GitHub action previously, I accidentally discovered that the results were different from those executed locally. After checking, I found that there was no relationship between Chinese fonts in the runner environment, so all Chinese character parts were turned into boxes. I searched online for a long time and couldn't find a faster solution, so I used the quick installation shell script I wrote before and installed it before starting the test.
Although for this requirement, as long as you don't use Chinese in the runner, just change it to English. But after all, there is a solution out there, so I just want to make a reusable composite action for everyone to use! If there are people who have the same needs as me, you can save time to study how to install Chinese fonts (in addition, many people ignore it, many fonts are not free or can be used legally in this situation) The result is the repo in front of you, I hope it can be helpful on this issue.
Copyright © 2022 hms5232
This project uses the Apache 2.0 open source license; and the relevant usage specifications of CNS11643 please follow the relevant provisions of the "Government Information Open License Terms".