Skip to content

Commit 54fd87f

Browse files
yusanckyCopilot
andauthored
Improve robustness of specifying Typst executable file name (#52)
resolve #51 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b136642 commit 54fd87f

File tree

4 files changed

+80
-46
lines changed

4 files changed

+80
-46
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
name: Test
22
on:
33
push:
4-
branches: [ main ]
4+
branches: [main]
55
paths-ignore:
66
- .gitattributes
77
- .gitignore
88
- LICENSE
9-
- '**.md'
10-
- LICENSE
9+
- "**.md"
1110
- .github/**
12-
- '!.github/workflows/test.yml'
11+
- "!.github/workflows/test.yml"
1312
pull_request:
1413
paths-ignore:
1514
- .gitattributes
1615
- .gitignore
1716
- LICENSE
18-
- '**.md'
17+
- "**.md"
1918
- .github/**
20-
- '!.github/workflows/test.yml'
19+
- "!.github/workflows/test.yml"
2120
workflow_dispatch:
2221
concurrency:
2322
group: ${{ github.workflow }}-${{ github.ref }}
@@ -29,7 +28,7 @@ jobs:
2928
- uses: actions/checkout@v4
3029
- uses: actions/setup-node@v4
3130
with:
32-
node-version: '20'
31+
node-version: "20"
3332
cache: npm
3433
- run: npm ci
3534
- run: npm run build

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Setup Typst
66

77
This action provides the following functionality for GitHub Actions users:
8+
89
- **Installing** a version of [Typst] and adding it to the PATH
910
- **Caching** [packages] dependencies
1011
- **Downloading** ZIP archives as packages
@@ -62,6 +63,13 @@ jobs:
6263
- run: typst-latest compile paper.typ paper.pdf
6364
```
6465

66+
> [!TIP]
67+
>
68+
> - `executable-name` defaults to `typst`.
69+
> - A Typst executable named `typst-${version}` is always kept.
70+
> - For Windows, there is no need to include the executable file extension `.exe` in the parameters.
71+
> - Multiple distinct `executable-name` values can be set for the same Typst version. Setting the same `executable-name` (including the default `typst`) for different Typst versions is **not recommended**, as it may lead to version management confusion.
72+
6573
#### Managing Packages with Cache
6674

6775
**`cache-dependency-path`:** Used to specify the path to a Typst file containing lines of `import` keyword.
@@ -70,7 +78,7 @@ jobs:
7078
# Example workflow YAML file
7179
- uses: typst-community/setup-typst@v4
7280
with:
73-
cache-dependency-path: requirements.typ
81+
cache-dependency-path: requirements.typ
7482
```
7583

7684
```typst
@@ -104,6 +112,7 @@ jobs:
104112
```
105113

106114
> [!TIP]
115+
>
107116
> - For links to download GitHub repositories, please refer to [_Downloading source code archives_].
108117
> - The supported namespaces are only `local` and `preview`.
109118
> - The SemVer versions of packages are read from its `typst.toml`.
@@ -166,6 +175,7 @@ You can also use `npm run lint` to run type checking and format code with `npm r
166175
The repository uses GitHub Actions for continuous integration testing. The workflow automatically runs on pull requests and pushes to the main branch.
167176

168177
The CI workflow consists of two kinds of jobs:
178+
169179
- Build: Compiles the action and uploads artifacts
170180
- Test: Tests the action across all platforms
171181
- Basic Test: Tests basic functionality

README_zh-Hans-CN.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Setup Typst
66

77
Setup Typst 操作为 GitHub Actions 用户提供以下功能:
8+
89
- **安装**指定版本的 [Typst]
910
- **缓存**依赖的 []
1011
- **下载** ZIP 压缩文件作为包
@@ -62,6 +63,13 @@ jobs:
6263
- run: typst-latest compile paper.typ paper.pdf
6364
```
6465

66+
> [!TIP]
67+
>
68+
> - `executable-name` 默认为 `typst`。
69+
> - 一份名为 `typst-${version}` 的 Typst 可执行文件总是被保存。
70+
> - 对于 Windows,不需要在参数中设置可执行文件后缀名 `.exe`。
71+
> - 可以为同一版本 Typst 设置多个不同的 `executable-name`。**不推荐** 对不同版本 Typst 设置相同的 `executable-name`(包括默认的 `typst`),因为这可能导致版本管理混乱。
72+
6573
#### 包管理与缓存
6674

6775
**`cache-dependency-path`:** 指向一个含有 `import` 关键字的 Typst 文件。
@@ -104,6 +112,7 @@ jobs:
104112
```
105113

106114
> [!TIP]
115+
>
107116
> - 对于下载 GitHub 存储库需要的链接,请参阅[《下载源代码存档》]。
108117
> - 仅支持将 ZIP 包下载到命名空间 `local` 或 `preview`。
109118
> - SemVer 版本号从 `typst.toml` 读取。
@@ -166,6 +175,7 @@ Setup Typst 操作使用 TypeScript 开发,所以你需要 Nodejs.20 和 npm
166175
此存储库使用 GitHub Actions 进行持续集成测试。工作流将对拉取请求和对主分支的推送自动运行。
167176

168177
CI 工作流包括两种工作:
178+
169179
- 构建:编译操作并上传到构件
170180
- 测试:跨系统测试操作
171181
- 基础测试:测试基础功能

0 commit comments

Comments
 (0)