Update README.md #32
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: Build and Publish VS Code Extension | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
env: | |
NODE_VERSION: '20.x' | |
jobs: | |
build-and-publish: | |
environment: prod | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install dependencies | |
run: yarn install | |
- name: Install vsce | |
run: yarn global add @vscode/vsce | |
- name: Package extension | |
run: vsce package | |
- name: Check vsce installation | |
run: | | |
which vsce | |
vsce --version | |
- name: Debug - Check PAT | |
run: | | |
if [ -n "$VSCE_PAT" ]; then | |
echo "VSCE_PAT is set and not empty" | |
else | |
echo "VSCE_PAT is empty or not set" | |
fi | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
- name: Publish to Visual Studio Marketplace | |
run: | | |
if [ -z "$VSCE_PAT" ]; then | |
echo "Error: VSCE_PAT is empty" | |
exit 1 | |
else | |
vsce publish | |
fi | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} |