Skip to content

Commit

Permalink
monorepo: Add manual version bump and publish config/scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks committed Feb 25, 2021
1 parent 34869fb commit 5f70232
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@mm-snap:registry="https://npm.pkg.github.com"
7 changes: 6 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"version": "0.0.1",
"npmClient": "yarn",
"command": {
"publish": {
"registry": "https://npm.pkg.github.com"
}
},
"packages": [
"packages/*"
],
"npmClient": "yarn",
"useWorkspaces": true
}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
],
"scripts": {
"link-packages": "./scripts/link-packages.sh",
"version-bump": "./scripts/version-bump.sh",
"push-version-bump": "./scripts/push-version-bump.sh",
"release": "yarn version-bump && yarn push-version-bump",
"publish": "lerna publish from-package",
"prepare": "lerna run prepare"
},
"devDependencies": {}
Expand Down
13 changes: 13 additions & 0 deletions scripts/push-version-bump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -e
set -u
set -o pipefail

MM_SNAP_VERSION=$(node -p 'require("./lerna.json").version')

git checkout -b "${MM_SNAP_VERSION}"
git commit -m "${MM_SNAP_VERSION}" || true
git push -u origin "${MM_SNAP_VERSION}"

unset MM_SNAP_VERSION
13 changes: 13 additions & 0 deletions scripts/version-bump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -e
set -u
set -o pipefail

if [ -z "${1:-}" ]
then
echo "Error: Missing required positional argument: patch|minor|major"
exit 1
fi

lerna version "$1" --no-git-tag-version

0 comments on commit 5f70232

Please sign in to comment.