Commit 8d52874
committed
refactor: Simplify Python script in publish workflow
This commit refactors the Python script used in the `publish-crate.yml`
GitHub Actions workflow. Previously, a multi-line Python script embedded
as a heredoc was used to parse the `cargo metadata` output and extract
the crate's version. This has been replaced with a more concise single-
line Python command executed using `python3 -c`. The change improves
readability and reduces verbosity within the workflow definition file
without altering the core functionality of version extraction and tag
validation.
Influence:
1. Verify the `publish-crate.yml` workflow still correctly extracts the
crate version.
2. Ensure the tag validation step (`Tag ${tag} does not match crate
version v${version}`) continues to function as expected.
3. Observe successful execution of the `check-tag` job in the CI
pipeline for a new tag creation.
refactor: 简化发布工作流中的 Python 脚本
此提交重构了 `publish-crate.yml` GitHub Actions 工作流中使用的 Python
脚本。之前,使用多行 Python 脚本(通过 heredoc 嵌入)来解析 `cargo
metadata` 输出并提取 crate 的版本。现在已将其替换为使用 `python3 -c` 执
行的更简洁的单行 Python 命令。此更改提高了工作流定义文件的可读性并减少了
冗余,同时不改变版本提取和标签验证的核心功能。
Influence:
1. 验证 `publish-crate.yml` 工作流仍能正确提取 crate 版本。
2. 确保标签验证步骤(`Tag ${tag} does not match crate version
v${version}`)继续按预期工作。
3. 观察 CI 管道中为新标签创建时 `check-tag` 作业的成功执行。1 parent e5ede4d commit 8d52874
1 file changed
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 30 | + | |
36 | 31 | | |
37 | 32 | | |
38 | 33 | | |
| |||
0 commit comments