From 0fdc320bd1da98ef827a1d884cb4076a75051dab Mon Sep 17 00:00:00 2001
From: Seok NamKoong <seok9311@naver.com>
Date: Tue, 17 Jan 2023 17:15:45 +0900
Subject: [PATCH] [CI] Set different versions for each vsix package

Currently, all the vsix packages have same versions and this may confuse users.
This commit will set different versions for each vsix package.

ONE-vscode-DCO-1.0-Signed-off-by: Seok NamKoong <seok9311@naver.com>
---
 .github/workflows/publish-extension.yml | 2 +-
 package.json                            | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/publish-extension.yml b/.github/workflows/publish-extension.yml
index 892b3095..35a3241c 100644
--- a/.github/workflows/publish-extension.yml
+++ b/.github/workflows/publish-extension.yml
@@ -23,7 +23,7 @@ jobs:
           npm install -g vsce
       - name: Build vsix package
         run: |
-          vsce package
+          npm run createpkg-nightly
       # TODO Enable publish job
       - name: Publish vsix package
         if: ${{ false }}
diff --git a/package.json b/package.json
index 06c51698..f7d475d1 100644
--- a/package.json
+++ b/package.json
@@ -457,7 +457,9 @@
     "test": "npm run unittest",
     "test-no-screen": "DISPLAY=:44 xvfb-run --server-num 44 npm run test",
     "coverage": "npm run test coverage",
-    "clean": "rm -rf out"
+    "clean": "rm -rf out",
+    "createpkg-local": "vsce package -o one-vscode-local-$(git rev-parse --short HEAD)-$(date '+%Y%m%d%H%M%S').vsix",
+    "createpkg-nightly": "VER=$(npm version --no-git-tag-version --no-commit-hooks minor | cut -c2-) && vsce package  --no-git-tag-version ${VER}-$(git rev-parse --short HEAD)"
   },
   "devDependencies": {
     "@istanbuljs/nyc-config-typescript": "^1.0.2",