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
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from d893c6f to 076224f Compare February 26, 2018 08:52
@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

@kr8n3r kr8n3r force-pushed the update-release-scripts branch from 076224f to bccabfd Compare February 26, 2018 09:15
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 09:15 Inactive
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from bccabfd to e7c1fbc Compare February 26, 2018 09:17
@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
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from 8e1ebf8 to 2643b17 Compare February 26, 2018 14:50
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 14:50 Inactive
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from 2643b17 to 4773de0 Compare February 26, 2018 14:51
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 14:52 Inactive
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from 4773de0 to 7815105 Compare February 26, 2018 14:55
@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
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from 4b8692e to 978f828 Compare February 26, 2018 16:14
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 16:14 Inactive
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from 978f828 to a3117a3 Compare February 26, 2018 16:37
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 February 26, 2018 16:37 Inactive
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from a3117a3 to f5854d3 Compare February 26, 2018 16:41
@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

@kr8n3r kr8n3r force-pushed the update-release-scripts branch from f5854d3 to 8b28462 Compare February 27, 2018 09:51
@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
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from 57939b8 to 691d9c1 Compare March 1, 2018 09:19
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 09:19 Inactive
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from 691d9c1 to 27b6fe5 Compare March 1, 2018 09:42
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 09:42 Inactive
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from 27b6fe5 to 713c865 Compare March 1, 2018 09:56
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 09:56 Inactive
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from 713c865 to 0de18e9 Compare March 1, 2018 11:40
@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
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from 6c644ae to f160842 Compare March 1, 2018 11:52
@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
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from f160842 to a847f72 Compare March 1, 2018 13:28
@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
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from a847f72 to 942c1c7 Compare March 1, 2018 14:15
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 14:15 Inactive
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from 942c1c7 to 89c2af6 Compare March 1, 2018 14:18
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 14:19 Inactive
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from 89c2af6 to e65d3f1 Compare March 1, 2018 14:20
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-553 March 1, 2018 14:20 Inactive
@kr8n3r kr8n3r force-pushed the update-release-scripts branch from e65d3f1 to 0cc7119 Compare March 1, 2018 14:22
@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