Skip to content

Commit 731ffb4

Browse files
committed
fix: 修改打包流程,上传release
1 parent 28dc3a0 commit 731ffb4

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

.github/workflows/release.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,44 @@ jobs:
7070

7171
- name: Push changes and tags
7272
run: |
73-
git push --follow-tags # 推送修改的 version 和 Git 标签到远程仓库
73+
git push --follow-tags
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
77+
- name: Get metadata from package.json
78+
id: metadata
79+
run: |
80+
NAME=$(node -p "require('./package.json').name")
81+
VERSION=$(node -p "require('./package.json').version")
82+
echo "NAME=$NAME" >> $GITHUB_ENV
83+
echo "VERSION=$VERSION" >> $GITHUB_ENV
7484
7585
- name: Package Extension
76-
run: vsce package # 生成 .vsix 文件
86+
run: vsce package # 使用默认文件名 CodeReDesign-<version>.vsix
87+
88+
- name: Create GitHub Release
89+
id: create_release
90+
uses: actions/create-release@v1
91+
env:
92+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
with:
94+
tag_name: v${{ env.VERSION }}
95+
release_name: Release v${{ env.VERSION }}
96+
draft: false
97+
prerelease: false
98+
body: |
99+
Auto-generated release for version ${{ env.VERSION }}.
100+
Download the VSIX file below to install the extension.
101+
102+
- name: Upload VSIX to Release
103+
uses: actions/upload-release-asset@v1
104+
env:
105+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106+
with:
107+
upload_url: ${{ steps.create_release.outputs.upload_url }}
108+
asset_path: ${{ env.NAME }}-${{ env.VERSION }}.vsix
109+
asset_name: ${{ env.NAME }}-${{ env.VERSION }}.vsix
110+
asset_content_type: application/zip
77111

78112
- name: Publish to Marketplace
79113
uses: HaaLeo/[email protected] # 第三方 Action 简化发布

0 commit comments

Comments
 (0)