[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 97292e324c
)
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/611845
This commit is contained in:
Родитель
ed829bedfd
Коммит
c9395310bd
|
@ -25,7 +25,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
@ -46,7 +45,6 @@ func main() {
|
||||||
cmd := flag.Arg(0)
|
cmd := flag.Arg(0)
|
||||||
|
|
||||||
checkWD()
|
checkWD()
|
||||||
requireTools("jq", "npx", "gh", "git")
|
|
||||||
requireEnvVars("TAG_NAME")
|
requireEnvVars("TAG_NAME")
|
||||||
|
|
||||||
tagName, version, isRC := releaseVersionInfo()
|
tagName, version, isRC := releaseVersionInfo()
|
||||||
|
@ -54,8 +52,10 @@ func main() {
|
||||||
|
|
||||||
switch cmd {
|
switch cmd {
|
||||||
case "package":
|
case "package":
|
||||||
|
requireTools("npx")
|
||||||
buildPackage(version, tagName, vsix)
|
buildPackage(version, tagName, vsix)
|
||||||
case "publish":
|
case "publish":
|
||||||
|
requireTools("npx", "gh", "git")
|
||||||
requireEnvVars("VSCE_PAT", "GITHUB_TOKEN")
|
requireEnvVars("VSCE_PAT", "GITHUB_TOKEN")
|
||||||
publish(tagName, vsix, isRC)
|
publish(tagName, vsix, isRC)
|
||||||
default:
|
default:
|
||||||
|
@ -129,21 +129,6 @@ func releaseVersionInfo() (tagName, version string, isPrerelease bool) {
|
||||||
}
|
}
|
||||||
isPrerelease = true
|
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
|
return tagName, mmp + label, isPrerelease
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
jq -r .version package.json
|
|
||||||
cp ../README.md README.md
|
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
|
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
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
jq -r .version package.json
|
|
||||||
cp ../README.md README.md
|
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
|
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
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
jq -r .version package.json
|
|
||||||
stat go-0.0.0-rc.1.vsix
|
stat go-0.0.0-rc.1.vsix
|
||||||
release create --generate-notes --target 4893cd984d190bdf2cd65e11c425b42819ae6f57 --title Release v0.0.0-rc.1 --draft
|
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
|
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
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
jq -r .version package.json
|
|
||||||
stat go-0.0.0.vsix
|
stat go-0.0.0.vsix
|
||||||
release create --generate-notes --target 4893cd984d190bdf2cd65e11c425b42819ae6f57 --title Release v0.0.0 --draft
|
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
|
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
|
||||||
|
|
Загрузка…
Ссылка в новой задаче