From 63e33b21047257622acb6d851081741b0b008bcc Mon Sep 17 00:00:00 2001 From: Samyak Jain <56000318+samyakkkk@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:21:02 +0530 Subject: [PATCH] (feat): Release Github Action --- .github/workflows/deploy-vscode.yml | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/deploy-vscode.yml 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