Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update release scripts #553

Merged
merged 3 commits into from
Mar 1, 2018
Merged

Update release scripts #553

merged 3 commits into from
Mar 1, 2018

Conversation

kr8n3r
Copy link

@kr8n3r kr8n3r commented Feb 25, 2018

This PR address the current long-winded release process, by merging a couple of steps.
Changes are:

  • addition of two scripts: npm run prerelease and npm run release
  • addition of pre-release.sh shell script that runs:
    • npm run build:packages
    • npm run build:dist
    • lerna publish --skip-git --skip-npm
      and if all successful it
    • adds, commits and pushes all files to remote
  • addition of release.sh shell script that runs:
    • npm-publish.sh shell script ffor each package
    • checks to see if you're logged into NPm as the correct user
    • creates and pushes the tag version to remote
    • create a zip of dist folder ready for attaching to release tab in Github
  • addition of npm-publish.sh shell scripts that:
    • checks for each package that current version is not the same as the published version
    • if not runs npm publish for each package
  • updates publish documentation
  • adds change to CHANGELOG

Perhaps we could merge this into #545 and test with that as the documentation describes that package folder structure

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 25, 2018 22:48 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 08:53 Inactive
Copy link
Contributor

@NickColley NickColley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the publishing documentation need to change based on this?

package.json Outdated
@@ -17,9 +17,11 @@
"preinstall": "node bin/check-nvmrc.js",
"prestart": "node bin/check-nvmrc.js",
"start": "gulp dev --destination 'public'",
"pre:release": "node bin/check-nvmrc.js && ./bin/pre-release.sh",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: prerelease (consistent with npm above)

bin/release.sh Outdated
# ! npm team ls developers | grep -q $NPM_USER

NPM_USER=$(npm whoami)
if ! [[ "govuk-patterns-and-tools" = $NPM_USER ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

bin/release.sh Outdated
git push --tags
echo "🗒 Tag $TAG created and push to remote."

echo "🗒 Creating a relase artifact..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: relase -> release

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 09:15 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 09:17 Inactive
@kr8n3r
Copy link
Author

kr8n3r commented Feb 26, 2018

yes it will, but didn't want to update docs just yet, if we change things

Copy link
Contributor

@alex-ju alex-ju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 looks great to me! great work @igloosi.
Left two minor comments, but nothing important.
Later edit: oh.. seems like I haven't saved the comments. will add again.

Shall we do a publish with it, or what's the best way to test it so we can then merge it?

TAG="v$ALL_PACKAGE_VERSION"

npm run build:packages && npm run build:dist && lerna publish --skip-git --skip-npm && git add . && git commit -m "Release $TAG"
echo "🗒 All done. Ready to create a pull request. Once approved, run npm run release"
Copy link
Contributor

@alex-ju alex-ju Feb 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message show up even when we have an error (see example below) or we cancel Lerna. I'll give it a thought, maybe we'll be able to wrap it somehow.
screen shot 2018-02-26 at 12 55 11

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let's have chat how to best deal with it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alex-ju have pushed an update to prerelease script. how about now?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you cancel lerna publish, exit code is 0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, looks good now.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 13:58 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 14:48 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 14:50 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 14:52 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 14:56 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 15:35 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 16:14 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 16:37 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 16:41 Inactive
Copy link
Contributor

@alex-ju alex-ju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed in person and again after update.
Publish only from master is a great addition.

@kr8n3r
Copy link
Author

kr8n3r commented Feb 27, 2018

this also needs update release documentation and changelog

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 27, 2018 09:51 Inactive
@kr8n3r kr8n3r changed the title [WIP, DNM] Update release scripts Update release scripts Feb 27, 2018
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 09:19 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 09:42 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 09:56 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 11:40 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 11:41 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 11:52 Inactive
@kr8n3r kr8n3r mentioned this pull request Mar 1, 2018
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 13:28 Inactive
- npm run prerelease
- npm run release
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 14:15 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 14:19 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 14:20 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 14:23 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants