Code Formatter v1.0.3 #9
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: Publish VS Code Extension | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build & Package VSIX | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Compile TypeScript | |
| run: npm run compile | |
| - name: Install vsce CLI | |
| run: npm install -g @vscode/vsce | |
| - name: Create VSIX package | |
| run: vsce package --no-yarn | |
| - name: Upload VSIX artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: extension | |
| path: "*.vsix" | |
| attach-release: | |
| name: Attach VSIX to GitHub Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| if: github.event_name == 'release' | |
| steps: | |
| - name: Download VSIX artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: extension | |
| - name: Upload VSIX to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: "*.vsix" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish: | |
| name: Publish to VS Code Marketplace | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install vsce CLI | |
| run: npm install -g @vscode/vsce | |
| - name: Download VSIX artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: extension | |
| - name: Publish to VS Code Marketplace | |
| run: vsce publish --packagePath *.vsix | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} |