Release - Parallel Publishing #4
Workflow file for this run
This file contains hidden or 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: Release | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # 允许上传文件到 Release | |
| actions: read # 允许读取 Actions 信息 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build extension | |
| run: npm run vscode:prepublish | |
| - name: Package extension | |
| id: package | |
| run: | | |
| PACKAGE_NAME=$(npx vsce package --out xkcoding-api-navigator.vsix | grep "Packaged:" | awk '{print $2}' || echo "xkcoding-api-navigator.vsix") | |
| echo "package_name=xkcoding-api-navigator.vsix" >> $GITHUB_OUTPUT | |
| - name: Publish to VSCode Marketplace | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
| run: npx vsce publish --packagePath xkcoding-api-navigator.vsix | |
| - name: Upload VSIX to release | |
| run: | | |
| gh release upload ${{ github.event.release.tag_name }} "xkcoding-api-navigator.vsix" --clobber | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |