File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build plugin
2+
3+ on :
4+ push :
5+ branches : [main, master]
6+ tags : ['**']
7+ pull_request :
8+ branches : [main, master]
9+ workflow_dispatch :
10+
11+ jobs :
12+ build :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : checkout repo
16+ uses : actions/checkout@v4
17+ - name : Install pnpm
18+ uses : pnpm/action-setup@v4
19+ with :
20+ version : 10.10.0
21+ - name : env use node.js
22+ uses : actions/setup-node@v4
23+ with :
24+ node-version : ' 22'
25+ cache : pnpm
26+ - name : build
27+ run : |
28+ pnpm install --frozen-lockfile
29+ pnpm build
30+ - name : upload build artifact
31+ if : always()
32+ uses : actions/upload-artifact@v4
33+ with :
34+ name : obsidian-any-block
35+ path : |
36+ dist/main.js
37+
38+ create-release :
39+ name : Create Release
40+ if : github.event_name == 'push' # no pr
41+ needs : [build]
42+ runs-on : ubuntu-latest
43+ steps :
44+ - name : Download all artifacts
45+ uses : actions/download-artifact@v4
46+ with :
47+ path : ./dist
48+
49+ - name : List downloaded artifacts
50+ run : |
51+ echo "Listing contents of ./dist:"
52+ ls -R ./dist
53+
54+ - name : Create Release
55+ if : startsWith(github.ref, 'refs/tags/')
56+ uses : ncipollo/release-action@v1
57+ with :
58+ token : ${{ secrets.AnyBlockPro_Repo }}
59+ name : ' Release ${{ github.ref_name }}'
60+ body : ' Release for tag ${{ github.ref_name }}'
61+ artifacts : |
62+ ./dist/main.js
63+ generateReleaseNotes : false # 自动根据 commits 生成 release notes。此外,这里应该导向一个更新日志页
64+ prerelease : true # 是否预发布 (可以在release上修改该项,我就不判断tag是否beta结尾了)
65+ makeLatest : false # 是否最后一个版本 (可以在release上修改该项,我就不判断tag是否beta结尾了)
66+ allowUpdates : true # 如果 tag 已存在,允许更新
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export default defineConfig({
55 lib : { // Library 模式:输出单个 ES 模块文件
66 entry : 'src/index.ts' ,
77 formats : [ 'es' ] ,
8- fileName : ( ) => 'hello-world .js' , // 输出文件名
8+ fileName : ( ) => 'main .js' , // 输出文件名
99 } ,
1010 rollupOptions : {
1111 external : [ ] ,
You can’t perform that action at this time.
0 commit comments