Skip to content

Commit

Permalink
build: Bump version when releasing with Craft (#19)
Browse files Browse the repository at this point in the history
* build: Bump version when releasing with Craft

* fix: Minor release
  • Loading branch information
tonyo authored and kamilogorek committed Jun 24, 2019
1 parent 5373d6f commit 69c26e4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .craft.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github:
owner: getsentry
repo: sentry-go
preReleaseCommand: ""
preReleaseCommand: bash scripts/craft-pre-release.sh
changelogPolicy: simple
targets:
- name: github
Expand Down
24 changes: 24 additions & 0 deletions scripts/craft-pre-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -eux

SCRIPT_DIR="$( dirname "$0" )"
cd $SCRIPT_DIR/..

function replace() {
! grep "$2" $3
perl -i -pe "s/$1/$2/g" $3
grep "$2" $3 # verify that replacement was successful
}

if [ "$#" -eq 1 ]; then
OLD_VERSION=""
NEW_VERSION="${1}"
elif [ "$#" -eq 2 ]; then
OLD_VERSION="${1}"
NEW_VERSION="${2}"
else
echo "Illegal number of parameters"
exit 1
fi

replace "const Version = \"[\w.-]+\"" "const Version = \"$NEW_VERSION\"" ./sentry.go
2 changes: 1 addition & 1 deletion sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// Version Sentry-Go SDK Version
const Version = "0.0.1-beta.3"
const Version = "0.1.0"

// Init initializes whole SDK by creating new `Client` and binding it to the current `Hub`
func Init(options ClientOptions) error {
Expand Down

0 comments on commit 69c26e4

Please sign in to comment.