elastic / apm-agent-rum-js

https://www.elastic.co/guide/en/apm/agent/rum-js/current/index.html
MIT License
278 stars 133 forks source link

ci(post-release): tag the lerna packages #1479

Closed v1v closed 8 months ago

v1v commented 8 months ago

Run post-release step at the very end of the release. Tag all the Lerna modules using the sha commit for the tag release @elastic/apm-rum-core

Tasks


$ GITHUB_TOKEN=$(gh auth token) DRY_RUN=false npm run ci:post-release

It produced the below output:

> elastic-apm-rum@0.0.0-monorepo ci:post-release
> node ./scripts/ci-post-release.mjs

Git User: username=Victor Martinez, email=VictorMartinezRubio@gmail.com
Running in prod mode
 > List lerna versions
lerna notice cli v4.0.0
lerna info versioning independent
lerna success found 5 packages
 >> Get sha commit for @elastic/apm-rum-core@5.21.0
 >> @elastic/apm-rum-core@5.21.0 = 242cb41a092b88a3e832fdaf9bb970b7b8d272cf
Note: switching to '242cb41a092b88a3e832fdaf9bb970b7b8d272cf'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 242cb41 chore(release): publish (#1465)
@elastic/apm-rum-angular@3.0.3 already exists. There is no need to tag it
@elastic/apm-rum-react@2.0.2 already exists. There is no need to tag it
@elastic/apm-rum-vue@2.1.6 already exists. There is no need to tag it
@elastic/apm-rum@5.16.0 already exists. There is no need to tag it
1bc016e3745890c04c1c8cc568ab3dd2875d32d4
a759b00b3ff0dd3c19ad7b6bd64427716c1f1da4
ccb8cb7084dec80c6261609cc74aec5d70160c56
242cb41a092b88a3e832fdaf9bb970b7b8d272cf
To https://github.com/v1v/apm-agent-rum-js.git
 * [new tag]         @elastic/apm-rum@5.16.0 -> @elastic/apm-rum@5.16.0
Everything up-to-date
devcorpio commented 8 months ago

it looks great @v1v, thank you for doing this 🚀

I have a question related to "Tag all the Lerna modules using the sha commit for the tag release @elastic/apm-rum-core"

What do you mean exactly by this? if I'm not wrong, we could also tag the latest commit of main (which should correspond to the release PR that has been merged), let me know if I'm confusing things

v1v commented 8 months ago

What do you mean exactly by this?

Rather than using the latest commit, I'm retrieving the sha commit for @elastic/apm-rum-core:

we could also tag the latest commit of main (which should correspond to the release PR that has been merged), let me know if I'm confusing things

That's more straightforward; the outcome should be the same unless a PR merge happens when the Release workflow runs or something wrong happens with the sha commit.

I expect the current workspace to point to the correct sha commit, a.k .a. the tag release for @elastic/apm-rum-core.

However, with my approach, it's possible to run the script to tag the latest releases and modules if they were not tagged locally; that's likely the main difference with using the latest commit of the main or the workspace.