-
Notifications
You must be signed in to change notification settings - Fork 268
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 workflow to publish npm packages #3850
Conversation
Skipping CI for Draft Pull Request. |
5030f2c
to
3f02348
Compare
This comment was marked as resolved.
This comment was marked as resolved.
7a62def
to
ac0e9f6
Compare
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.
/lgtm
ac0e9f6
to
f6ceb64
Compare
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.
/lgtm
Tide is treating a skipped job as failed. This was fixed in a later prow release so we would need to update. As we're currently moving significant amounts of work off prow we'll hold off on the update for now. See I'll revisit this workflow in a week or two when I have time to change how we handle the conditional execution to avoid leaving skipped jobs, or decide that we'll live with it since it'll only run when package.json and package-lock.json files are updated in the PR. /hold |
f6ceb64
to
4da3101
Compare
4da3101
to
86c7e33
Compare
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.
/lgtm
/hold cancel |
/retest |
Let's merge this and if it becomes annoying having to override the publish step on dependabot or other PRs modifying the package.json / package-lock.json files we can disable the job temporarily until we have a cleaner approach. /override publish |
Doesn't look like |
/hold |
629d9fc
to
85f3f0e
Compare
Add workflow to handle automatically publishing packages to the npm registry when the commit message matches the expected format: `Publish <version> of the @tektoncd/dashboard-* packages` For PRs it validates the PR is up-to-date with the base branch and that the PR title and commit message match. For both PRs and pushes it validates that the version in the commit message matches the version in the package.json files. Once all validation passes, it will publish the package (dry-run for PR). This simplifies the process of releasing new package versions as now it only requires running the `npm version --workspaces <version>` command and committing the result. The rest of the process, i.e. ensuring inter-workspace dependencies are updated to use the correct versions before publishing, is handled by the workflow. Also generate provenance statements for the packages. Skip all steps if commit message or PR title don't match expected format so the job passes and doesn't block unrelated PRs for dependency updates etc.
85f3f0e
to
1d3a56d
Compare
/hold cancel |
Moved the PR title / commit message check to the first step so the job will run (previously skipped which was causing the issues above), but then skip the remaining steps if it's not a publish commit. Because the job runs in this case but all steps are skipped, it is marked as successful and doesn't block unrelated PRs changing the package.json / package-lock.json files (e.g. dependabot or other dependency / config updates). |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: briangleeson The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
Add workflow to handle automatically publishing packages to the npm registry when the commit message matches the expected format:
Publish <version> of the @tektoncd/dashboard-* packages
For PRs it validates the PR is up-to-date with the base branch and that the PR title and commit message match.
For both PRs and pushes it validates that the version in the commit message matches the version in the package.json files.
Once all validation passes, it will publish the package (dry-run for PR).
This simplifies the process of releasing new package versions as now it only requires running the
npm version --workspaces <version>
command and committing the result. The rest of the process, i.e. ensuring inter-workspace dependencies are updated to use the correct versions before publishing, is handled by the workflow.Also generate provenance statements for the packages.
Skip all steps if commit message or PR title don't match expected format so the job passes and doesn't block unrelated PRs for dependency updates etc.
/kind misc
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes