Skip to content

Commit 39354bc

Browse files
committed
fix
1 parent 4820dc2 commit 39354bc

File tree

1 file changed

+37
-31
lines changed

1 file changed

+37
-31
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,25 @@ jobs:
2323
with:
2424
node-version: "20.19.6"
2525

26-
- name: Install
27-
run: npm run install
28-
29-
- name: Build frontend
30-
run: npm run build:frontend
31-
26+
# 读取 package.json 里的 version 和 changelog 作为 app/manifest 里的配置
3227
- name: Get version
3328
id: read_version
3429
run: |
3530
VERSION=$(jq -r '.version' package.json)
3631
echo "version=$VERSION" >> $GITHUB_OUTPUT
32+
- name: Update version in manifest file
33+
run: |
34+
sed -i '' "s|version=0.0.1|version=${{ steps.read_version.outputs.version }}|" app/manifest
35+
- name: Get changelog
36+
id: read_log
37+
run: |
38+
CHANGELOG=$(jq -r '.changelog' package.json)
39+
echo "changelog=$CHANGELOG" >> $GITHUB_OUTPUT
40+
- name: Update changelog in manifest file
41+
run: |
42+
sed -i '' "s|changelog=changelog|changelog=${{ steps.read_log.outputs.changelog }}|" app/manifest
3743
44+
# 读取 CHANGELOG.md 里的更新记录
3845
- name: Get changelog body
3946
id: read_changelog
4047
run: |
@@ -47,55 +54,54 @@ jobs:
4754
found { print }
4855
' CHANGELOG.md > RELEASE_NOTES.md
4956
50-
- name: Update version in manifest file
51-
run: |
52-
sed -i '' "s|version=0.0.1|version=${{ steps.read_version.outputs.version }}|" app/manifest
57+
# 查看 RELEASE_NOTES.md
58+
- name: RELEASE_NOTES.md
59+
run: cat RELEASE_NOTES.md
5360

54-
- name: Get changelog
55-
id: read_log
56-
run: |
57-
CHANGELOG=$(jq -r '.changelog' package.json)
58-
echo "changelog=$CHANGELOG" >> $GITHUB_OUTPUT
61+
# 安装所有依赖
62+
- name: Install
63+
run: npm run install
5964

60-
- name: Update changelog in manifest file
61-
run: |
62-
sed -i '' "s|changelog=changelog|changelog=${{ steps.read_log.outputs.changelog }}|" app/manifest
65+
# 打包前端代码
66+
- name: Build frontend
67+
run: npm run build:frontend
6368

69+
# 打包 x86 文件
6470
- name: Build x86 backend
6571
run: npm run build:backend
66-
6772
- name: Update x86 platform in manifest file
6873
run: |
6974
sed -i '' "s|platform=platform|platform=x86|" app/manifest
70-
7175
- name: Build x86 package
7276
run: |
7377
chmod +x ./build/fnpack-1.0.4-darwin-arm64
7478
./build/fnpack-1.0.4-darwin-arm64 build app
75-
7679
- name: Rename x86 package
7780
run: mv code.editor.fpk code.editor.x86.fpk
7881

82+
# 打包 arm 文件
7983
- name: Build arm backend
8084
run: npm run build:backend:arm
81-
8285
- name: Update arm platform in manifest file
8386
run: |
8487
sed -i '' "s|platform=x86|platform=arm|" app/manifest
85-
8688
- name: Build arm package
8789
run: |
8890
chmod +x ./build/fnpack-1.0.4-darwin-arm64
8991
./build/fnpack-1.0.4-darwin-arm64 build app
90-
9192
- name: Rename arm package
9293
run: mv code.editor.fpk code.editor.arm.fpk
9394

94-
- name: Release
95-
uses: ncipollo/release-action@v1.20.0
96-
with:
97-
tag: v${{ steps.read_version.outputs.version}}
98-
name: v${{ steps.read_version.outputs.version}}
99-
body_path: RELEASE_NOTES.md
100-
artifacts: "code.editor.x86.fpk,code.editor.arm.fpk"
101-
token: ${{ secrets.GITHUB_TOKEN }}
95+
# 发布文件
96+
# - name: Release
97+
# uses: ncipollo/release-action@v1.20.0
98+
# with:
99+
# tag: v${{ steps.read_version.outputs.version}}
100+
# name: v${{ steps.read_version.outputs.version}}
101+
# body_path: RELEASE_NOTES.md
102+
# artifacts: "code.editor.x86.fpk,code.editor.arm.fpk"
103+
# token: ${{ secrets.GITHUB_TOKEN }}
104+
105+
# 查看所有文件
106+
- name: Files
107+
run: ls

0 commit comments

Comments
 (0)