Skip to content

Conversation

pawelgrimm
Copy link
Contributor

@pawelgrimm pawelgrimm commented Oct 11, 2022

Overview

In this PR, we are updating the publish action to create a package in the (private) GitHub package registry in addition to the (public) npm package registry. This will allow us to consume the package in projects that use private @doist-scoped packages.

The impetus for this change is that I couldn't upgrade the @doist/todoist-api-typescript package to > 2.0.0 in https://github.com/Doist/todoist-addtask-integrations/, since that project is set up to pull @Doist packages from the GitHub package registry. We cross-publish other public packages, like reactist, in both registries, so I think we should do the same here.

@scottlovegrove @henningmu @engfragui Do you know of any reasons why we shouldn't make this change?

@pawelgrimm pawelgrimm requested review from a team, engfragui, henningmu, lefcha and scottlovegrove and removed request for a team October 11, 2022 17:29
@pawelgrimm pawelgrimm self-assigned this Oct 11, 2022
Copy link
Contributor

@engfragui engfragui left a comment

Choose a reason for hiding this comment

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

Approving as publishing todoist-api-typescript in our private npm registry solves my issue with Todoist-Outlook not being able to find the package.

However, I don't have any context as to why the original change was made.

Copy link
Contributor

@henningmu henningmu left a comment

Choose a reason for hiding this comment

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

Do you know of any reasons why we shouldn't make this change?

Nope, fine by me 👍

@pawelgrimm pawelgrimm merged commit 5013d05 into main Oct 12, 2022
@pawelgrimm pawelgrimm deleted the pawelg/publish-to-github-package-registry branch October 12, 2022 14:38
@pawelgrimm
Copy link
Contributor Author

@engfragui I know you were waiting for this before pushing v2.0.7 — let me know how it goes 🤞

@engfragui
Copy link
Contributor

engfragui commented Oct 12, 2022

@pawelgrimm I tried to publish a new todoist-api-typescript version (v2.0.7) (see https://github.com/Doist/todoist-api-typescript/releases) but seems like I'm getting a permission error if I look at the build that got triggered:

npm notice Publishing to https://npm.pkg.github.com/
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://npm.pkg.github.com/@doist%2ftodoist-api-typescript - Permission permission_denied: write_package
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2022-10-12T15_51_09_176Z-debug-0.log
Error: Process completed with exit code 1.

(source: https://github.com/Doist/todoist-api-typescript/actions/runs/3236069424/jobs/5301360782)

I also confirm that I cannot find this new version of the package if I try to npm install the new todoist-api-typescript version in Todoist-Outlook:

 ~/Projects/Todoist-Outlook/frontend > npm install  
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @doist/todoist-api-typescript@2.0.7.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

(as expected, since the package wasn't actually published to the internal repo, based on the error above)

However, I do see that it has been successfully published (as it has happened even before your change) here https://www.npmjs.com/package/@doist/todoist-api-typescript

@pawelgrimm
Copy link
Contributor Author

@engfragui It looks like only publishing to the GitHub registry failed, probably because I messed up the setup 😅 Fixed it here: #161

I'll manually publish v2.0.7 for now and I guess when we're ready for v2.0.8, we'll see if my fixed worked 🤞

@engfragui
Copy link
Contributor

engfragui commented Oct 12, 2022

@pawelgrimm I have a feeling a v2.0.8 will be coming soon anyway. 😅 Thank you for spending time on this, much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants