Skip to content

Commit

Permalink
Merge pull request #96 from shogo82148/add-release-script
Browse files Browse the repository at this point in the history
add a script for release
  • Loading branch information
shogo82148 authored Jul 3, 2020
2 parents e224c74 + a2981f9 commit c2312ab
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 10 deletions.
21 changes: 21 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -uex

CURRENT=$(cd "$(dirname "$0")" && pwd)
VERSION=$1
MAJOR=$(echo "$VERSION" | cut -d. -f1)
MINOR=$(echo "$VERSION" | cut -d. -f2)
PATCH=$(echo "$VERSION" | cut -d. -f3)

# update metadata
cat <<EOF > "$CURRENT/xray/version.go"
package xray
// Version records the current X-Ray Go SDK version.
const Version = "$MAJOR.$MINOR.$PATCH"
EOF
git add "$CURRENT/xray/version.go"
git commit -m "bump up v$MAJOR.$MINOR.$PATCH"
git tag "v$MAJOR.$MINOR.$PATCH"
git push --tags
13 changes: 3 additions & 10 deletions xray/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,12 @@ import (
"github.com/shogo82148/aws-xray-yasdk-go/xray/schema"
)

// Version records the current X-Ray Go SDK version.
const Version = "0.0.4"

// Name records which X-Ray SDK customer uses.
const Name = "X-Ray YA-SDK for Go"

// ServiceData is the metadata of the user service.
// It is used by all segments that X-Ray YA-SDK sends.
var ServiceData *schema.Service

func init() {
ServiceData = &schema.Service{
Compiler: runtime.Compiler,
CompilerVersion: runtime.Version(),
}
var ServiceData = &schema.Service{
Compiler: runtime.Compiler,
CompilerVersion: runtime.Version(),
}
4 changes: 4 additions & 0 deletions xray/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package xray

// Version records the current X-Ray Go SDK version.
const Version = "1.0.0"
11 changes: 11 additions & 0 deletions xrayaws-v2/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -uex

VERSION=$1
MAJOR=$(echo "$VERSION" | cut -d. -f1)
MINOR=$(echo "$VERSION" | cut -d. -f2)
PATCH=$(echo "$VERSION" | cut -d. -f3)

git tag "xrayaws-v2/v$MAJOR.$MINOR.$PATCH"
git push --tags
11 changes: 11 additions & 0 deletions xrayaws/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -uex

VERSION=$1
MAJOR=$(echo "$VERSION" | cut -d. -f1)
MINOR=$(echo "$VERSION" | cut -d. -f2)
PATCH=$(echo "$VERSION" | cut -d. -f3)

git tag "xrayaws/v$MAJOR.$MINOR.$PATCH"
git push --tags

0 comments on commit c2312ab

Please sign in to comment.