-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.34 KB
/
package-community-extension.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Pack Community Extension
on:
push:
branches:
- main
paths:
- 'Community/**/manifest.json'
workflow_dispatch:
jobs:
package-community-extension:
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
- name: 设置 Node.js 环境
uses: actions/setup-node@v4
with:
node-version: 'latest'
- name: 安装必需的工具
run: |
sudo apt-get update
sudo apt-get install -y zip jq
- name: 获取扩展目录列表
id: get_directories
run: |
# 获取所有扩展的目录
tree Community
EXT_DIRS=$(find Community -type f -name 'manifest.json' -exec dirname {} \; | sort -u)
echo "EXT_DIRS=$EXT_DIRS" >> $GITHUB_ENV
- name: 打包扩展
run: |
# 遍历扩展目录并打包
for dir in $EXT_DIRS; do
echo "Processing $dir"
# 获取扩展的版本号
VERSION=$(jq -r '.version' "$dir/manifest.json")
echo "[Community Extension] $dir Version: $VERSION"
# 创建一个 zip 包
zip -r "$dir.zip" "$dir"
done
- name: 上传打包文件
uses: actions/upload-artifact@v4
with:
name: extensions
path: Community/**.zip