Skip to content

Commit

Permalink
build: add postversion standalone script
Browse files Browse the repository at this point in the history
  • Loading branch information
Harvtronix committed Feb 19, 2022
1 parent 2dfcac7 commit 18fd8c2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "npx pm2-runtime start pm2-apps.json",
"format": "prettier --write \"packages/**/*.{js,jsx,ts,tsx}\"",
"lint": "eslint packages --max-warnings=0 && prettier --check \"packages/**/*.{js,jsx,ts,tsx}\"",
"postversion": "cd MakePDF && npm version -- $npm_package_version && cd ../VoiceNotify && npm version -- $npm_package_version && cd ../ && git add -A && git commit -m \"Release v$npm_package_version\" && git push && git tag -a v$npm_package_version HEAD -m \"$(git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:'%h %s')\" && git push origin v$npm_package_version"
"postversion": "sh scripts/postversion.sh"
},
"repository": {
"type": "git",
Expand Down
21 changes: 21 additions & 0 deletions scripts/postversion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

# Exit on any non-zero return codes
set -e

# Get top-level package version (without quotes)
npm_package_version=$(npm pkg get version | sed s/\"//g)

# Re-version all workspace packages
npm --workspaces version $npm_package_version

# Update the global lock file
npm i

# Commit all updates to version control
git add -A
git commit -m "Release v$npm_package_version"
git push

git tag -a "v$npm_package_version" HEAD -m \"$(git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:'%h %s')\"
git push origin v$npm_package_version

0 comments on commit 18fd8c2

Please sign in to comment.