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

Add support for publishing legacy versions in release script #230

Merged
merged 5 commits into from Jun 12, 2023

Conversation

jpwilliams
Copy link
Member

Summary

Releasing earlier versions to npm is a pain. This PR ensures we:

  1. Find the actual latest version of the package
  2. Publish the legacy version using the latest tag, ensuring semver updates work as expected
  3. Re-tag latest as the version found in step 1

Following this, we should be ready to support backporting and legacy releases purely with labels and PRs. 🥳

Related

@jpwilliams jpwilliams added the backport v1.x Backport this PR to v1.x when merged. label Jun 9, 2023
@jpwilliams jpwilliams self-assigned this Jun 9, 2023
@changeset-bot
Copy link

changeset-bot bot commented Jun 9, 2023

⚠️ No Changeset found

Latest commit: 66f80dc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jpwilliams jpwilliams merged commit 55c3b1c into main Jun 12, 2023
18 checks passed
@jpwilliams jpwilliams deleted the chore/latest-retagging-on-backport-release branch June 12, 2023 12:41
inngest-release-bot pushed a commit that referenced this pull request Jun 12, 2023
## Summary

Releasing earlier versions to npm is a pain. This PR ensures we:

1. Find the actual latest version of the package
2. Publish the legacy version using the `latest` tag, ensuring semver
updates work as expected
3. Re-tag `latest` as the version found in step 1

Following this, we should be ready to support backporting and legacy
releases purely with labels and PRs. 🥳

## Related

- mermaid-js/mermaid#4200
- bower/bower#2041
- npm/npm#6778

(cherry picked from commit 55c3b1c)
jpwilliams added a commit that referenced this pull request Jun 12, 2023
… script (#233)

Backport 55c3b1c from #230.

Co-authored-by: Jack Williams <jack@inngest.com>
jpwilliams added a commit that referenced this pull request Jun 12, 2023
…gs (#236)

## Summary

The release script in #224 and #230 almost worked.

We see in run to release a `v1.x` backport that the following command
failed:

https://github.com/inngest/inngest-js/actions/runs/5244055017/jobs/9469531269
```
$ npm dist-tag add inngest@2.0.1 latest

npm ERR! code E401
npm ERR! 401 Unauthorized - PUT https://registry.yarnpkg.com/-/package/inngest/dist-tags/latest
```

Looks like it's defaulting to using Yarn's registry URL instsead of
npm's. We get around this during publishing as we specify
`publishConfig.registry` in our `package.json`, but it seems that `npm
dist-tag` doesn't obey this same property.

Let's manually set the registry for this particular command to ensure it
tries to affect the right place.

## Related

- #224 
- #230
inngest-release-bot pushed a commit that referenced this pull request Jun 12, 2023
…gs (#236)

## Summary

The release script in #224 and #230 almost worked.

We see in run to release a `v1.x` backport that the following command
failed:

https://github.com/inngest/inngest-js/actions/runs/5244055017/jobs/9469531269
```
$ npm dist-tag add inngest@2.0.1 latest

npm ERR! code E401
npm ERR! 401 Unauthorized - PUT https://registry.yarnpkg.com/-/package/inngest/dist-tags/latest
```

Looks like it's defaulting to using Yarn's registry URL instsead of
npm's. We get around this during publishing as we specify
`publishConfig.registry` in our `package.json`, but it seems that `npm
dist-tag` doesn't obey this same property.

Let's manually set the registry for this particular command to ensure it
tries to affect the right place.

## Related

- #224
- #230

(cherry picked from commit f33464f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport v1.x Backport this PR to v1.x when merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants