-
Notifications
You must be signed in to change notification settings - Fork 803
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
feat: add release PR workflow #4849
feat: add release PR workflow #4849
Conversation
@@ -43,7 +43,7 @@ | |||
"prepare_release:sdk:patch": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:version_patch && npm run _restore:package-json && npm run _changelog:prepare_experimental && npm run _changelog:prepare_stable", | |||
"prepare_release:sdk:minor": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:version_minor && npm run _restore:package-json && npm run _changelog:prepare_experimental && npm run _changelog:prepare_stable", | |||
"prepare_release:all:minor": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:version_minor && cd api/ && npm version minor && cd .. && lerna run align-api-deps && npm run _restore:package-json && npm run _changelog:prepare_all", | |||
"release:publish": "lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access", | |||
"release:publish": "lerna publish --concurrency 1 from-package --no-push --no-private --no-git-tag-version --no-verify-access", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewer note: I've had trouble publishing without limiting concurrency in the past. Sometimes, it tries to publish a package while a dependency is not available yet and exits with an error. Having --concurrency 1
will take slightly longer but will avoid running into a state where only a portion of the packages are published.
RELEASE_SCOPE: ${{ github.event.inputs.release_scope }} | ||
RELEASE_KIND: ${{ github.event.inputs.release_scope }}:${{ github.event.inputs.release_type }} | ||
RELEASE_PR_REMOTE: origin | ||
RELEASE_PR_OWNER: opentelemetrybot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewer note: If we don't have a fork on @opentelemetrybot yet and we need to release, the way to create a PR would be to set all these env vars and locally and running the npm run github:create_or_update_release_pr
script above (gh
CLI needs to be logged in).
For me this would be:
RELEASE_SCOPE: [any one of these values]
RELEASE_KIND: $RELEASE_SCOPE: [any one of these values]
RELEASE_PR_REMOTE: origin
(the name of the remote that I usually push to)
RELEASE_PR_OWNER: dynatrace-oss-contrib
(the organization that owns my fork of the repo)
You can adjust these values and run the script locally to get the same result as you'd get from running the workflow. The only dfference: instead of @opentelemetrybot it will then be your user that's opening the PR (but that still beats doing everything manually). 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on automatic and documenting this!
Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: Trent Mick <trentm@gmail.com>
I just figured out we can actually use |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fork | ||
run: gh repo fork open-telemetry/opentelemetry-js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we only need to do this fork once, and then change this workflow? I would have thought the forking would be a one-time thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just run the forking step every time we run the workflow, as it's just a single API call. Since the gh
binary is already available, it does only add about a second to the workflow run. If the fork already exists, then this command will exit with a success code, logging that the fork already exists, effectively becoming a no-op. 🙂
Here's an example where I tested that: https://github.com/pichlermarc-sample-organization/test-release-pr/actions/runs/10147085271/job/28056647373 🙂
Co-authored-by: Trent Mick <trentm@gmail.com>
Part of the series of PRs to automate the release process.
This PR:
sdk
= all SDK packages, experimental and stable,experimental
= all packages in experimental,all
= all release packages, including API) and type (patch
= bump patch version for the selected scope,minor
= bump minor version for the selected scope).major
is not included right now as it's not a regular enough occurrence to spend time on it.Still missing:
The https://github.com/open-telemetry/opentelemetry-js repo still needs to be forked @opentelemetrybot. This is tracked at REQUEST: Repository maintenance on open-telemetry/opentelemetry-js community#2188this can actually be handled by the workflow too viagh repo fork
NODE_AUTH_TOKEN=<your-token-here> npm run release:publish
)npm run _github:draft_release:stable
,_github:draft_release:experimental
,_github:draft_release:api
) and then publishing the created draft release