Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"docs:prepare": "cd docs/_book && git init && git checkout -b gh-pages && git add . && git commit -m 'Update documentation'",
"docs:publish": "cd docs/_book && git push git@github.com:uphold/uphold-sdk-javascript gh-pages --force && cd .. && rm -rf _book",
"lint": "eslint --cache src test",
"release": "npm version $1 -m 'Release %s'",
"release": "tasks/release.sh",
"tdd": "yarn test --watch",
"test": "jest --config jest.json",
"version": "yarn build && yarn changelog && git add -f dist CHANGELOG.md"
Expand Down
32 changes: 32 additions & 0 deletions tasks/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env sh

release() {
# Clean node_modules
rm -rf node_modules && rm -f yarn.lock

# Install dependencies.
yarn

# Bump version.
yarn version --no-git-tag-version --new-version ${1:-patch}

# Get the new version number.
local version=`grep -m1 version package.json | cut -d '"' -f4`

# Create deploy branch.
git checkout -b deploy/${version}

# Generate changelog.
github-changelog-generator --owner=uphold --repo=uphold-sdk-javascript --future-release=${version} > CHANGELOG.md

# Build release
yarn build

# Add modified files.
git add -f dist yarn.lock package.json CHANGELOG.md

# Commit release with new version.
git commit -m "Release ${version}"
}

release $1