Skip to content

Commit

Permalink
Fix: release script should use correct remote branch (#20)
Browse files Browse the repository at this point in the history
* Fix: release script to use correct remote branch
* Chore: Adding separate step for publishing package to npm
  • Loading branch information
pramodsum committed Nov 10, 2017
1 parent 0493fcd commit 8bd12a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions build/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ reset_to_master() {
git tag -l | xargs git tag -d || return 1

# Add the origin remote if it is not present
if ! git remote get-url github-origin; then
git remote add github-origin git@github.com:box/box-annotations.git || return 1
if ! git remote get-url release; then
git remote add release git@github.com:box/box-annotations.git || return 1
fi

# Fetch latest code with tags
git fetch --tags github-origin || return 1;
git fetch --tags release || return 1;

# Reset to latest code and clear unstashed changes
git reset --hard github-origin/master || return 1
git reset --hard release/master || return 1

# Remove old local tags in case a build failed
git fetch --prune github-upstream '+refs/tags/*:refs/tags/*' || exit 1
git fetch --prune release '+refs/tags/*:refs/tags/*' || exit 1
git clean -fdX || return 1
}

Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@
"github-release": "./node_modules/.bin/conventional-github-releaser",
"changelog": "./node_modules/.bin/conventional-changelog -i CHANGELOG.md --same-file",
"release": "yarn run clean && yarn run lint && yarn run test && yarn run prod",
"minor": "./build/release.sh -n && ./build/publish.sh",
"major": "./build/release.sh -m && ./build/publish.sh",
"patch": "./build/release.sh -p && ./build/publish.sh"
"publish": "./build/publish.sh",
"minor": "./build/release.sh -n && yarn run publish",
"major": "./build/release.sh -m && yarn run publish",
"patch": "./build/release.sh -p && yarn run publish"
},
"lint-staged": {
"src/**/*.js": [
Expand Down

0 comments on commit 8bd12a5

Please sign in to comment.