diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 596c834..430191f 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -30,6 +30,12 @@ jobs: - name: Package the extension run: npm run package + - name: Upload VSIX artifact + uses: actions/upload-artifact@v4 + with: + name: vscode-extension + path: "*.vsix" + deploy: runs-on: ubuntu-latest needs: build @@ -38,16 +44,27 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - - name: Upload VSIX file - uses: actions/upload-artifact@v4 + + - name: Download VSIX artifact + uses: actions/download-artifact@v4 with: name: vscode-extension - path: '**/*.vsix' + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' - name: Deploy to Marketplace run: | echo "Deploying to the marketplace..." - # Add your deployment script or command here - # For example, using vsce to publish the extension - npx vsce publish --pat ${{ secrets.VSCE_PAT }} \ No newline at end of file + # Publish pre-built VSIX using the maintained @vscode/vsce package + FILE=$(ls -1 *.vsix | head -n 1) + echo "Publishing $FILE" + if [ -z "${VSCE_PAT}" ]; then + echo "VSCE_PAT secret is not set" >&2 + exit 1 + fi + npx @vscode/vsce publish --pat "${VSCE_PAT}" --packagePath "$FILE" + env: + VSCE_PAT: ${{ secrets.VSCE_PAT }} \ No newline at end of file