You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2020/03/03 12:54:43 UTC

[skywalking-cli] branch master updated: Add release guide doc (#23)

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git


The following commit(s) were added to refs/heads/master by this push:
     new 0d27af4  Add release guide doc (#23)
0d27af4 is described below

commit 0d27af4774d1f6d7d4708f83d03fa8eaed42c33f
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Tue Mar 3 20:54:38 2020 +0800

    Add release guide doc (#23)
---
 CONTRIBUTING.md        |  20 ++++-
 Makefile               |   6 +-
 docs/How-to-release.md | 204 +++++++++++++++++++++++++++++++++++++++++++++++++
 swctl/main.go          |   3 +-
 4 files changed, 230 insertions(+), 3 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index bf0f7a0..9688f0d 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -81,4 +81,22 @@ and run the tests locally, make sure all tests passed.
 
 ```shell
 make test
-```
\ No newline at end of file
+```
+
+## How to release
+This section guides committers and PMC members to release SkyWalking CLI in Apache Way.
+
+### Prerequisites
+- [x] [GNU Make](https://www.gnu.org/software/make/manual/make.html) is installed
+- [x] [GPG tool](https://gpgtools.org) is installed
+- [x] [Add your GPG key](docs/How-to-release.md#add-your-gpg-public-key)
+
+### Release steps
+- Export the version that is to be released, `export VERSION=1.0.1 `
+- Tag the latest commit that is to be released with `git tag v${VERSION}` and push the tag with `git push https://github.com/apache/skywalking-cli v${VERSION}`
+- Verify licenses, build and sign distribution packages, simply run `make release`, distribution packages and checksums are generated
+- [Upload the packages to SVN repository](docs/How-to-release.md#upload-to-apache-svn) 
+- [Send internal announcement](docs/How-to-release.md#make-the-internal-announcements)
+- [Wait at least 48 hours for test responses](docs/How-to-release.md#wait-at-least-48-hours-for-test-responses)
+- [Call for vote](docs/How-to-release.md#call-a-vote-in-dev)
+- [Publish release](docs/How-to-release.md#publish-release)
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 155548f..29e4332 100644
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,7 @@ GO_TEST = $(GO) test
 GO_LINT = $(GO_PATH)/bin/golangci-lint
 GO_LICENSER = $(GO_PATH)/bin/go-licenser
 GO_BUILD_FLAGS = -v
+GO_BUILD_LDFLAGS = -X main.version=$(VERSION)
 
 PLATFORMS := windows linux darwin
 os = $(word 1, $@)
@@ -48,7 +49,7 @@ deps:
 .PHONY: $(PLATFORMS)
 $(PLATFORMS):
 	mkdir -p $(OUT_DIR)
-	GOOS=$(os) GOARCH=$(ARCH) $(GO_BUILD) $(GO_BUILD_FLAGS) -o $(OUT_DIR)/$(BINARY)-$(VERSION)-$(os)-$(ARCH) swctl/main.go
+	GOOS=$(os) GOARCH=$(ARCH) $(GO_BUILD) $(GO_BUILD_FLAGS) -ldflags "$(GO_BUILD_LDFLAGS)" -o $(OUT_DIR)/$(BINARY)-$(VERSION)-$(os)-$(ARCH) swctl/main.go
 
 .PHONY: lint
 lint:
@@ -102,6 +103,9 @@ release-src: clean
 release-bin: build
 	-mkdir $(RELEASE_BIN)
 	-cp -R bin $(RELEASE_BIN)
+	-cp -R dist/* $(RELEASE_BIN)
+	-cp -R CHANGES.md $(RELEASE_BIN)
+	-cp -R README.md $(RELEASE_BIN)
 	-tar -zcvf $(RELEASE_BIN).tgz $(RELEASE_BIN)
 	-rm -rf $(RELEASE_BIN)
 
diff --git a/docs/How-to-release.md b/docs/How-to-release.md
new file mode 100644
index 0000000..16511a4
--- /dev/null
+++ b/docs/How-to-release.md
@@ -0,0 +1,204 @@
+# Apache SkyWalking release guide
+
+This documentation guides the release manager to release the SkyWalking CLI in the Apache Way, and also helps people to
+check the release for vote.
+
+## Add your GPG public key
+
+1. Add your GPG public key into [SkyWalking GPG KEYS](https://dist.apache.org/repos/dist/release/skywalking/KEYS) file,
+you can do this only if you are a committer, use your Apache id and password to log into the svn, and update the file.
+**DO NOT override the existed `KEYS` file.**
+
+1. Upload your GPG public key to public GPG site, such as [MIT's site](http://pgp.mit.edu:11371/). This site should be in 
+Apache maven staging repository check list.
+
+## Build and sign the source code package
+
+```shell
+export VERSION=<the version to release>
+git tag v${VERSION}
+make release
+```
+
+The `skywalking-cli-${VERSION}-bin.tgz`, `skywalking-cli-${VERSION}-src.tgz`, and their corresponding `asc`, `sha512`
+should be generated in the directory automatically. 
+
+## Upload to Apache svn
+
+1. Check out the [dist dev repo](https://dist.apache.org/repos/dist/dev/skywalking), e.g. `svn checkout https://dist.apache.org/repos/dist/dev/skywalking`
+1. Create a folder named with the release version and round, prefixed by `cli/`, e.g. `cd skywalking && mkdir -p cli/$VERSION`
+1. Copy all the packages to the folder, as well as their `.asc` and `.sha512`
+1. Commit the changes to svn
+
+## Make the internal announcement
+
+Send an announcement email to dev@ mailing list.
+
+```text
+Subject: [ANNOUNCEMENT] SkyWalking CLi $VERSION test build available
+
+Content:
+
+The test build of SkyWalking CLI $VERSION is now available.
+
+This is our Apache release.
+We welcome any comments you may have, and will take all feedback into
+account if a quality vote is called for this build.
+
+Release notes:
+
+ * https://github.com/apache/skywalking-cli/blob/v$VERSION/CHANGES.md
+
+Release Candidate:
+
+ * https://dist.apache.org/repos/dist/dev/skywalking/cli/$VERSION
+ * sha512 checksums
+   - sha512xxxxyyyzzz apache-skywalking-cli-bin-x.x.x.tgz
+   - sha512xxxxyyyzzz apache-skywalking-cli-src-x.x.x.tgz
+
+Release Tag :
+
+ * (Git Tag) v$VERSION
+
+Release Commit Hash :
+
+ * https://github.com/apache/skywalking-cli/tree/<Git Commit Hash>
+
+Keys to verify the Release Candidate :
+
+ * http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8BD99F552D9F33D7 corresponding to kezhenxu94@apache.org
+
+Guide to build the release from source :
+
+ * https://github.com/apache/skywalking-cli/blob/v$VERSION/docs/How-to-release.md
+
+A vote regarding the quality of this test build will be initiated
+within the next couple of days.
+```
+
+## Wait at least 48 hours for test responses
+
+Any PMC, committer or contributor can test features for releasing, and feedback.
+Based on that, PMC will decide whether to start a vote or not.
+
+## Call for vote in dev@ mailing list
+
+Call for vote in `dev@skywalking.apache.org`
+
+```text
+Subject: [VOTE] Release Apache SkyWalking CLI version $VERSION
+
+Content:
+
+Hi All,
+This is a call for vote to release Apache SkyWalking CLI version $VERSION.
+
+Release notes:
+
+ * https://github.com/apache/skywalking-cli/blob/v$VERSION/CHANGES.md
+
+Release Candidate:
+
+ * https://dist.apache.org/repos/dist/dev/skywalking/cli/$VERSION
+ * sha512 checksums
+   - sha512xxxxyyyzzz apache-skywalking-cli-src-x.x.x.tgz
+   - sha512xxxxyyyzzz apache-skywalking-cli-bin-x.x.x.tgz
+
+Release Tag :
+
+ * (Git Tag) v$VERSION
+
+Release Commit Hash :
+
+ * https://github.com/apache/skywalking-cli/tree/<Git Commit Hash>
+
+Keys to verify the Release Candidate :
+
+ * https://dist.apache.org/repos/dist/release/skywalking/KEYS
+
+Guide to build the release from source :
+
+ * https://github.com/apache/skywalking-cli/blob/v$VERSION/docs/How-to-release.md
+
+Voting will start now (xxxx date) and will remain open for at least 72 hours, all PMC members are required to give their votes.
+[ ] +1 Release this package.
+[ ] +0 No opinion.
+[ ] -1 Do not release this package because....
+```
+
+## Vote Check
+
+All PMC members and committers should check these before voting +1.
+
+1. Features test.
+1. All artifacts in staging repository are published with `.asc`, `.md5`, and `sha` files
+1. Source codes and distribution packages (`apache-skywalking-cli-{src,bin}-$VERSION.tgz`)
+are in `https://dist.apache.org/repos/dist/dev/skywalking/cli/$VERSION` with `.asc`, `.sha512`.
+1. `LICENSE` and `NOTICE` are in source codes and distribution package.
+1. Check `shasum -c apache-skywalking-cli-{src,bin}-$VERSION.tgz.sha512`
+1. Build distribution from source code package by following this [the build guide](#build-and-sign-the-source-code-package).
+1. Licenses check, `make license`;
+
+Vote result should follow these.
+
+1. PMC vote is +1 binding, all others is +1 no binding.
+1. Within 72 hours, you get at least 3 (+1 binding), and have more +1 than -1. Vote pass. 
+
+
+## Publish release
+
+1. Move source codes tar balls and distributions to `https://dist.apache.org/repos/dist/release/skywalking/`.
+
+```shell
+export SVN_EDITOR=vim
+svn mv https://dist.apache.org/repos/dist/dev/skywalking/cli/$VERSION https://dist.apache.org/repos/dist/release/skywalking/cli
+# ....
+# enter your apache password
+# ....
+
+```
+
+1. Public download links of source and distribution tar/zip locate in `http://www.apache.org/dyn/closer.cgi/skywalking/cli/$VERSION/`.
+We only publish Apache mirror path as release info.
+
+1. Public asc and sha512 locate in `https://www.apache.org/dist/skywalking/cli/$VERSION/xxx`
+
+1. Public KEYS pointing to  `https://www.apache.org/dist/skywalking/KEYS`
+
+1. Send ANNOUNCEMENT email to `dev@skywalking.apache.org`.
+
+```text
+Subject: [ANNOUNCEMENT] Release Apache SkyWalking CLI version $VERSION
+
+Content:
+
+Hi all,
+
+The Apache SkyWalking Team is glad to announce the release of Apache SkyWalking CLI $VERSION.
+
+SkyWalking CLI: Apache SkyWalking CLI https://skywalking.apache.org/
+
+SkyWalking: APM (application performance monitor) tool for distributed systems, 
+especially designed for microservices, cloud native and container-based (Docker, Kubernetes, Mesos) architectures. 
+
+Vote Thread: 
+
+Download Links : http://skywalking.apache.org/downloads/
+
+Release Notes : https://github.com/apache/skywalking-cli/blob/v$VERSION/CHANGES.md
+
+Website: http://skywalking.apache.org/
+
+SkyWalking Resources:
+- Issue: https://github.com/apache/skywalking/issues
+- Mailing list: dev@skywalkiing.apache.org
+- Documents: https://github.com/apache/skywalking/blob/v$VERSION/docs/README.md
+
+
+- Apache SkyWalking Team
+```
+
+1. Update website download page. http://skywalking.apache.org/downloads/ , including the new download source, distribution, sha512, asc and document
+links. Links could be found by following above rules.
+
+1. Add a release event on website homepage and even page. Announce the public release with changelog or key features.
diff --git a/swctl/main.go b/swctl/main.go
index 0cf3177..2efdee7 100644
--- a/swctl/main.go
+++ b/swctl/main.go
@@ -38,6 +38,7 @@ import (
 )
 
 var log *logrus.Logger
+var version string // Will be initialized when building
 
 func init() {
 	log = logger.Log
@@ -46,7 +47,7 @@ func init() {
 func main() {
 	app := cli.NewApp()
 	app.Usage = "The CLI (Command Line Interface) for Apache SkyWalking."
-	app.Version = "0.1.0"
+	app.Version = version
 
 	flags := []cli.Flag{
 		altsrc.NewStringFlag(cli.StringFlag{