v3.0.4 #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to VSCode Store | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
jobs: | |
package-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- run: npm i -g @vscode/vsce pnpm | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
id: cache | |
with: | |
path: | | |
**/node_modules | |
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm- | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: pnpm i --frozen-lockfile --ignore-scripts | |
- run: vsce package --no-dependencies | |
- run: vsce publish --no-dependencies -p $TOKEN | |
env: | |
TOKEN: ${{ secrets.VSCODE_PUBLISH_TOKEN }} | |
# - name: Upload assets | |
# uses: softprops/action-gh-release@v1 | |
# if: startsWith(github.ref, 'refs/tags/') | |
# with: | |
# files: '*.vsix' | |
- run: | | |
# 使用sed命令提取最新的版本记录 | |
cat CHANGELOG.md | awk '/^## \[/ {if (flag) exit; flag=1} flag {print}' > body.md | |
- name: Publish release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: '*.vsix' | |
bodyFile: 'body.md' |