diff --git a/.github/workflows/deploy-vscode.yml b/.github/workflows/deploy-vscode.yml new file mode 100644 index 00000000..fd2f3e23 --- /dev/null +++ b/.github/workflows/deploy-vscode.yml @@ -0,0 +1,44 @@ +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout commit + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Cache NPM + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/vscode/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install Dependencies + run: | + cd vscode + npm ci + + - name: Publish Release + if: startsWith(github.ref, 'refs/tags/') && github.event.release.prerelease == false + run: | + cd vscode + npx vsce publish + env: + VSCE_PAT: ${{ secrets.VSCE_PAT }} + + - name: Publish Pre-Release + if: startsWith(github.ref, 'refs/tags/') && github.event.release.prerelease == true + run: | + cd vscode + npx vsce publish --pre-release + env: + VSCE_PAT: ${{ secrets.VSCE_PAT }} \ No newline at end of file