Improved yarn ship for Portal

refs https://github.com/TryGhost/Toolbox/issues/426

- with the existing `ship` command, it publishes to npm before pushing
  to GitHub
- I fear we're likely to run into a scenario where the HEAD of `main` is
  behind, so the git push fails, and then rebasing the HEAD will break
  the tags that we created
- in this scenario, I think it's better to hard reset back, git pull and
  then try again
- in that case, we need to publish to npm after GitHub
- this commit should implement that
This commit is contained in:
Daniel Lockyer 2022-10-05 15:43:09 +07:00
parent 700a62e048
commit e60fc167e4
No known key found for this signature in database

View File

@ -42,7 +42,8 @@
"eject": "react-scripts eject",
"lint": "eslint src --ext .js --cache",
"preship": "yarn lint",
"ship": "STATUS=$(git status --porcelain); echo $STATUS; if [ -z \"$STATUS\" ]; then yarn publish && git push ${GHOST_UPSTREAM:-upstream} main --follow-tags; fi",
"ship": "STATUS=$(git status --porcelain); echo $STATUS; if [ -z \"$STATUS\" ]; then yarn version; fi",
"postship": "git push ${GHOST_UPSTREAM:-origin} main --follow-tags && yarn publish . --tag $npm_package_version",
"posttest": "yarn lint",
"analyze": "source-map-explorer 'umd/*.js'",
"prepublishOnly": "yarn build"