[release-v0.42] extension/tools/release: skip version check in release process
Both package creation and package publish will skip the version check.
For golang/vscode-go#3500
Change-Id: I530f600bb983ac1e9e884bc6910bcd8f1b0717e0
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/612815
Commit-Queue: Hongxiang Jiang <hxjiang@golang.org>
kokoro-CI: kokoro <noreply+kokoro@google.com>
Auto-Submit: Hongxiang Jiang <hxjiang@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
(cherry picked from commit 97292e324c7514a632891570213ba3e644f3d6f1)
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/611845
diff --git a/extension/tools/release/release.go b/extension/tools/release/release.go
index 4c12fd3..1d25b2c 100644
--- a/extension/tools/release/release.go
+++ b/extension/tools/release/release.go
@@ -25,7 +25,6 @@
package main
import (
- "bytes"
"flag"
"fmt"
"os"
@@ -46,7 +45,6 @@
cmd := flag.Arg(0)
checkWD()
- requireTools("jq", "npx", "gh", "git")
requireEnvVars("TAG_NAME")
tagName, version, isRC := releaseVersionInfo()
@@ -54,8 +52,10 @@
switch cmd {
case "package":
+ requireTools("npx")
buildPackage(version, tagName, vsix)
case "publish":
+ requireTools("npx", "gh", "git")
requireEnvVars("VSCE_PAT", "GITHUB_TOKEN")
publish(tagName, vsix, isRC)
default:
@@ -129,21 +129,6 @@
}
isPrerelease = true
}
-
- cmd := exec.Command("jq", "-r", ".version", "package.json")
- cmd.Stderr = os.Stderr
- var buf bytes.Buffer
- cmd.Stdout = &buf
- if err := commandRun(cmd); err != nil {
- fatalf("failed to read package.json version")
- }
- versionInPackageJSON := buf.Bytes()
- if *flagN {
- return tagName, mmp + label, isPrerelease
- }
- if got := string(bytes.TrimSpace(versionInPackageJSON)); got != mmp {
- fatalf("package.json version %q does not match TAG_NAME %q", got, tagName)
- }
return tagName, mmp + label, isPrerelease
}
diff --git a/extension/tools/release/testdata/package-v0.0.0-rc.1.golden b/extension/tools/release/testdata/package-v0.0.0-rc.1.golden
index 961e14a..cfe14c7 100644
--- a/extension/tools/release/testdata/package-v0.0.0-rc.1.golden
+++ b/extension/tools/release/testdata/package-v0.0.0-rc.1.golden
@@ -1,3 +1,2 @@
-jq -r .version package.json
cp ../README.md README.md
npx vsce package -o go-0.0.0-rc.1.vsix --baseContentUrl https://github.com/golang/vscode-go/raw/v0.0.0-rc.1 --baseImagesUrl https://github.com/golang/vscode-go/raw/v0.0.0-rc.1 --no-update-package-json --no-git-tag-version 0.0.0-rc.1
diff --git a/extension/tools/release/testdata/package-v0.0.0.golden b/extension/tools/release/testdata/package-v0.0.0.golden
index cf81080..87c6fdf 100644
--- a/extension/tools/release/testdata/package-v0.0.0.golden
+++ b/extension/tools/release/testdata/package-v0.0.0.golden
@@ -1,3 +1,2 @@
-jq -r .version package.json
cp ../README.md README.md
npx vsce package -o go-0.0.0.vsix --baseContentUrl https://github.com/golang/vscode-go/raw/v0.0.0 --baseImagesUrl https://github.com/golang/vscode-go/raw/v0.0.0 --no-update-package-json --no-git-tag-version 0.0.0
diff --git a/extension/tools/release/testdata/publish-v0.0.0-rc.1.golden b/extension/tools/release/testdata/publish-v0.0.0-rc.1.golden
index 874492d..c190fb4 100644
--- a/extension/tools/release/testdata/publish-v0.0.0-rc.1.golden
+++ b/extension/tools/release/testdata/publish-v0.0.0-rc.1.golden
@@ -1,4 +1,3 @@
-jq -r .version package.json
stat go-0.0.0-rc.1.vsix
release create --generate-notes --target 4893cd984d190bdf2cd65e11c425b42819ae6f57 --title Release v0.0.0-rc.1 --draft
gh release create --generate-notes --target 4893cd984d190bdf2cd65e11c425b42819ae6f57 --title Release v0.0.0-rc.1 --draft --prerelease -R github.com/golang/vscode-go v0.0.0-rc.1 go-0.0.0-rc.1.vsix
diff --git a/extension/tools/release/testdata/publish-v0.0.0.golden b/extension/tools/release/testdata/publish-v0.0.0.golden
index 606dc22..81de0dd 100644
--- a/extension/tools/release/testdata/publish-v0.0.0.golden
+++ b/extension/tools/release/testdata/publish-v0.0.0.golden
@@ -1,4 +1,3 @@
-jq -r .version package.json
stat go-0.0.0.vsix
release create --generate-notes --target 4893cd984d190bdf2cd65e11c425b42819ae6f57 --title Release v0.0.0 --draft
gh release create --generate-notes --target 4893cd984d190bdf2cd65e11c425b42819ae6f57 --title Release v0.0.0 --draft -R github.com/golang/vscode-go v0.0.0 go-0.0.0.vsix