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

Add release automation setup. #711

Merged
merged 1 commit into from
Mar 4, 2021
Merged

Add release automation setup. #711

merged 1 commit into from
Mar 4, 2021

Conversation

rwjblue
Copy link
Collaborator

@rwjblue rwjblue commented Mar 4, 2021

This leverages a few external packages to make publishing nice and simple:

  • release-it - Responsible for handling the main release process.
  • release-it-lerna-changelog Responsible for building up a nice changelog (based on PRs merged, their labels and PR titles), then launching $EDITOR to allow hand tweaking of that changelog.
  • release-it-yarn-workspaces Responsible for looping through packages, updating the versions (and dependency versions), and calling npm publish on each.

The RELEASE.md file here should describe the process in detail, but the highlevel process is:

  • As you review and merge PRs, label them and update their titles to be something that is "changelog ready"
  • When you are ready to release, run npx release-it
  • Follow prompts
  • Review changelog, and tweak as needed

Once the release-it process completes, the following will have been done:

  • All version fields will be updated to the new version
  • All related dependencies/devDependencies/peerDependencies will have
    their versions updated (to match the newly selected version)
  • A CHANGELOG.md entry will have been created
  • All packages/* will be published to npm
  • A new GitHub Release will be published
  • The branch and tag will be pushed

🎉

Fixes #585

This leverages a few external packages to make publishing nice and
simple:

* [release-it](https://github.com/release-it/release-it) - Responsible
  for handling the main release process.
* [release-it-lerna-changelog](https://github.com/rwjblue/release-it-lerna-changelog)
  Responsible for building up a nice changelog (based on PRs merged,
  their labels and PR titles), then launching $EDITOR to allow hand
  tweaking of that changelog.
* [release-it-yarn-workspaces](https://github.com/rwjblue/release-it-yarn-workspaces)
  Responsible for looping through packages, updating the versions (and
  dependency versions), and calling `npm publish` on each.

The `RELEASE.md` file here should describe the process in detail, but
the highlevel process is:

* As you review and merge PRs, label them and update their titles to be
  something that is "changelog ready"
* When you are ready to release, run `npx release-it`
* Follow prompts
* Review changelog, and tweak as needed

Once the `release-it` process completes, the following will have been
done:

* All `version` fields will be updated to the new version
* All related dependencies/devDependencies/peerDependencies will have
  their versions updated (to match the newly selected version)
* A CHANGELOG.md entry will have been created
* All packages/* will be published to npm
* A new GitHub Release will be published
* The branch and tag will be pushed
Comment on lines +62 to +72
"release-it-yarn-workspaces": {
"workspaces": [
"packages/*"
],
"additionalManifests": {
"dependencyUpdates": [
"test-packages/*/package.json"
]
}
}
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This configuration is the only real difference from npx create-rwjblue-release-it-setup. It is specifically needed because we don't "just" want to use the workspaces array directly (since we don't want to publish test-packages/*).

@rwjblue
Copy link
Collaborator Author

rwjblue commented Mar 4, 2021

For context, right now the generated CHAGNELOG.md entry for the changes queued up on master is:


Unreleased (2021-03-04)

🚀 Enhancement

  • core
    • #705 Avoid patching the template compiler on Ember 3.26. (@rwjblue)
    • #700 TemplateCompiler fixes / improvements (avoid monkey patch for Ember 3.27+) (@rwjblue)
  • macros
    • #694 Run importSync transform later, so ember-auto-import can support importSync (@simonihmig)

🐛 Bug Fix

  • compat
    • #674 adjust paths seen by css preprocessors (@ef4)
    • #702 Handle case where node_modules are symlinked (@thoov)
    • #690 Exclude 'babel-plugin-compact-reexports' during Stage 1 build (@charlespierce)
    • #687 Strip main field from v1 addons' package.json once they are rewritten as V2 (@ef4)
  • compat, core
  • core
    • #686 Prevent accidental duplication of babel plugin during rebuilds (@ef4)

🏠 Internal

  • core, macros
  • Other
    • #704 Avoid running CI jobs on both push and pull_request events. (@rwjblue)
    • #697 Refactor suite-setup-util to avoid knock on errors. (@rwjblue)
  • router, util
    • #703 Add 3.20 and 3.24 to list of matrix tests. (@rwjblue)

Committers: 5

@thoov thoov self-requested a review March 4, 2021 22:33
@rwjblue rwjblue requested a review from ef4 March 4, 2021 22:52
Copy link
Contributor

@ef4 ef4 left a comment

Choose a reason for hiding this comment

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

Thanks, looks great.

@ef4
Copy link
Contributor

ef4 commented Mar 31, 2021

I tried running this for the first time, and it died at the point where it started trying to publish the npm packages.

? Preparing to publish:
    @embroider/babel-loader-7
    @embroider/compat
    @embroider/core
    @embroider/hbs-loader
    @embroider/macros
    @embroider/router
    @embroider/shared-internals
    @embroider/test-setup
    @embroider/util
    @embroider/webpack
  Publish to npm: Yes
ERROR npm ERR! code 128
npm ERR! command failed
npm ERR! command git ls-remote ssh://git@github.com/packages/babel-loader-7.git
npm ERR! ERROR: Repository not found.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/edward/.npm/_logs/2021-03-31T00_06_31_201Z-debug.log

Is there something weird about my environment?

(I finished the release by publishing the packages manually, everything else looks like it happened successfully.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Thoughts on release automation?
3 participants