-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: rebuild development scripts and release workflow #84
Conversation
建议补充点注释?有点看不懂 |
更新了 README 和 PR body 补充说明:本地运行 Action 收到
好处是,release-it 不在本地发布到 GitHub 后,可以不用在本地设置 |
fix typo
fix typo
done ——
|
Refactoring development scripts
bandicam.2023-12-10.22-04-58-107.-.Compressed.with.FlexClip.mp4
in this pr, the main npm scripts are
start
,build
,stop
,lint
, andrelease
build
: build the pluginbuild/
.addon/**
tobuild/addon/**
.**/*.flt
to**/${addonRef}-*.flt
.addonRef-
.update.json
orupdate-beta.json
.start
: start a development server.src/**
andaddon/**
.src/**
changed, run esbuild and reloadaddon/**
has changed, build the plugin (in development mode)stop
: terminate Zotero process (and server)When the server terminates, zotero is automatically terminated.
When server terminates, zotero is automatically terminated.
Not implemented: when starting server, if there is already a running instance of zotero, server is not automatically terminated when zotero is shut down; (zotero is still automatically terminated when server is terminated)
After refactoring, performance is greatly improved, with builds completed in milliseconds when only
src
is changed, and in 0.3s whenaddon
is modified. Before refactoring, it took 0.6s for a full build anyway.(tested against Linter for Zotero plugin)在此pr中,npm脚本主要有
start
,build
,stop
,lint
,release
build
:构建插件build/
addon/**
复制到build/addon/**
**/*.flt
重命名为**/${addonRef}-*.flt
addonRef-
前缀update.json
或update-beta.json
start
:启动一个开发服务器src/**
和addon/**
src/**
有更改,则运行esbuild并reloadaddon/**
有更改,则构建插件(开发模式下)stop
:终止 Zotero 进程(和 server)当 server 终止时,zotero 会被自动结束
当 zotero 被终止时,server 也会终止
未实现:当 启动server时,如果已经存在了正在运行的zotero实例,则zotero关闭时,server不会自动终止;(server终止时仍会自动结束zotero)
重构后,性能得到极大提高,当仅
src
变化时,可以在毫秒级完成构建,当addon
修改时,可以在0.3s内完成构建。重构前,无论如何都是完整构建,耗时 0.6s。(以 Linter for Zotero 插件为基准进行测试)Release XPI via GitHub Action
说明:
release-it 本地配置
release-it action 配置
本地运行 release 截图:手动选择版本、推送提交和标签到 GitHub,(不上传xpi)
当有标签提交时,GitHub Action 被触发,build xpi,并将 xpi 上传到 GitHub Release: