Gatsby-theme-novela: [CI/CD] Publish with Lerna not publishing @narative/gatsby-theme-novela

Created on 25 Dec 2019  路  6Comments  路  Source: narative/gatsby-theme-novela

Describe the bug
The Publish with Lerna GitHub action is not publishing correctly when @narative/gatsby-theme-novela package.json is bumped. Instead, it looks for a bump in the version number of the root package.json. This results in a human needing to go back and publish @narative/gatsby-theme-novela.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://www.npmjs.com/package/@narative/gatsby-theme-novela and realize only 0.11.x is published.
  2. Go to https://github.com/narative/gatsby-theme-novela/blob/master/%40narative/gatsby-theme-novela/package.json and realize 0.12.x should be published.
  3. Go to https://github.com/narative/gatsby-theme-novela/commit/eada16c5ce2ce188e349982c8b116efd9dc0cfd7/checks?check_suite_id=372091617, expand the Publish with Lerna accordion, and realize lerna success No changed packages to publish is logged to the terminal.

Expected behavior
A bot should publish @narative/gatsby-theme-novela.

Additional Context
Possibly related to #185.

blocked bug

Most helpful comment

Yes, you're right that it's currently not working as expected. JP who is responsible for the CI/CD wants to fix this issue after the Holidays. He's been kind enough to let me know he's aware of the issue and wants to fix it when he finds some time.

All 6 comments

Yes, you're right that it's currently not working as expected. JP who is responsible for the CI/CD wants to fix this issue after the Holidays. He's been kind enough to let me know he's aware of the issue and wants to fix it when he finds some time.

Yeah it's been a dumpster fire to do it with GH Actions tbh. I think my latest commit might fix it once and for all.

Blocked by #249

Jotting thoughts down: if this still doesn't work once the blocker is lifted and lerna can't publish; I'd be down to try a different route >> https://www.christopherbiscardi.com/post/shipping-multipackage-repos-with-github-actions-changesets-and-lerna/

Having the Github Action create a pull request makes for a very transparent release process, I like it 馃憤

In this repo's case, my approach was:
1/ a workflow for PR to ensure that merging in master would not generate any issue. And so everything should be pushed through a PR first.
2/ a workflow for commits to master to release with lerna in order to sync npm releases with git.

Most of the issues we ran through trying to get this done were due to:
A/ GH actions being in early-stage and having some quirks that no one has run into before.
A2/ And the workflow syntax requires some workarounds that you wouldn't suspect until you run into a workflow fail.
B/ Lerna having also some quirks with GH Actions and Yarn (double combo)
C/ Difficult to test in a staging or local env

Last but not least, IMHO CI/CD should be automated and not rely on a PR (which introduces a manual check every time we'd release). This makes it inefficient as someone could just run lerna publish locally after committing to master and doesn't solve the issue of different versions number between GH and NPM.

Despite all that kerfuffle, I still think it was a good idea to move from Travis and rely only on GH to limit 3rd party dependencies.
However, I'm not sure if the .yaml workflow was the easiest way to achieve that and if in the end, I maybe should have gone with a docker image. But that's another debate :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dennismorello picture dennismorello  路  4Comments

mwood23 picture mwood23  路  4Comments

bravo-kernel picture bravo-kernel  路  4Comments

alfieqashwa picture alfieqashwa  路  4Comments

dgovil picture dgovil  路  3Comments