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

feat: add gh actions to publish canary versions [gh-0] #629

Merged
merged 19 commits into from
Apr 25, 2023

Conversation

nahuelon
Copy link
Contributor

@nahuelon nahuelon commented Apr 5, 2023

I hereby confirm that I followed the code guidelines found at engineering guidelines

Affected Components

  • CLI
  • Create CLI
  • Test
  • Docs
  • Examples
  • Other

Notes for the Reviewer

  • add new Github Actions workflow to publish canary version to NPM registry only the build label is added to the PR
  • the new package is published as version <packageVersion>.-canary-<prNumber>.<shortSha> and tag
    canary-<prNumber>
  • a PR comment is created after the new version is published.

Note: if you want to re-publish after a new commit you have to remove the build label and add it again. This will generate a new version using the short commit SHA as suffix

You can check the last version published for this PR here

  • TODO: increase version when new commits are added in the PR (publish fails if version already exists). Using the --git-tag-version doesn't work if the package is inside a subdir. (npm bug here)

New Dependency Submission

New oclif packages is added into the NPM dev dependencies. This is required because we the npx oclif manifest fails using --tag ... because npx uses the specified tag to try install the oclif packages. When it is present as a package it works.

@nahuelon nahuelon requested review from tnolet and umutuzgur April 5, 2023 19:53
@nahuelon nahuelon marked this pull request as draft April 6, 2023 13:20
@ndom91
Copy link
Contributor

ndom91 commented Apr 13, 2023

The verison of this I have experience with also appends the commit hash on the end, so yuo end up wtih version's like next-auth@0.0.0-pr.7056.ced446b7. This would handle the TODO issue you have above ^^. See the second link below for the custom GH Action that does this.

Check out:

Also I would definitely recommend including the exact package name in the slack message that's posted / potentially also comment on the PR (See: https://github.com/nextauthjs/next-auth/blob/main/.github/workflows/release.yml#L114)

@nahuelon nahuelon marked this pull request as ready for review April 20, 2023 22:42
@nahuelon nahuelon added bug Something isn't working build Issue regarding building and packaging and removed bug Something isn't working labels Apr 20, 2023
@nahuelon nahuelon added bug Something isn't working build Issue regarding building and packaging and removed build Issue regarding building and packaging bug Something isn't working labels Apr 20, 2023
@nahuelon nahuelon added bug Something isn't working build Issue regarding building and packaging and removed build Issue regarding building and packaging bug Something isn't working labels Apr 20, 2023
@nahuelon nahuelon requested review from tnolet, clample and ndom91 April 20, 2023 23:44
@nahuelon nahuelon changed the title feat: add gh actions to publish next version [gh-0] feat: add gh actions to publish canary versions [gh-0] Apr 23, 2023
Copy link
Contributor

@ndom91 ndom91 left a comment

Choose a reason for hiding this comment

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

Some formatting and version number comments, but looks really good so far!

@ndom91
Copy link
Contributor

ndom91 commented Apr 23, 2023

Also, just somethign to think about - Instead of running it on a pull_request: labeled event, at next-auth we use Github's environment's and branch protection rules to be able to run that Publish PR job any time, but require maintainer approval to do so. So you just have to click into the Action and hit "Review deployments" -> "Approve" to kick it off.

See: https://github.com/nextauthjs/next-auth/blob/main/.github/workflows/release.yml#L90

image

Source: https://github.com/nextauthjs/next-auth/actions/runs/4743012111

@nahuelon nahuelon added build Issue regarding building and packaging and removed build Issue regarding building and packaging labels Apr 25, 2023
@nahuelon nahuelon added build Issue regarding building and packaging and removed build Issue regarding building and packaging labels Apr 25, 2023
@nahuelon nahuelon added build Issue regarding building and packaging and removed build Issue regarding building and packaging labels Apr 25, 2023
@nahuelon nahuelon added build Issue regarding building and packaging and removed build Issue regarding building and packaging labels Apr 25, 2023
@github-actions
Copy link

🎉 Experimental release successfully published on npm

npm install @checkly/cli@0.0.0-pr.629.8b49369

@nahuelon nahuelon requested a review from ndom91 April 25, 2023 14:16
Copy link
Contributor

@ndom91 ndom91 left a comment

Choose a reason for hiding this comment

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

LGTM 👍 🥳

I can't see the package-lock.json changes in the Github UI, too big 😅. However, its a bit fishy to me that it's that many changes.. You only added oclif as a dev dependency, right? Hmm..

Is the package-lock.json format maybe updated from v1 to v2 here by accident?

@nahuelon nahuelon merged commit 59505a0 into main Apr 25, 2023
@nahuelon nahuelon deleted the nahuelon/gh-0/publish-npm-next-version branch April 25, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issue regarding building and packaging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants