jsr icon indicating copy to clipboard operation
jsr copied to clipboard

How to create a token for publishing a new package?

Open timharek opened this issue 1 year ago • 5 comments

I want to try to publish a package from a different CI-system than GH Actions and according to the docs this should be possible?

https://jsr.io/docs/api#authentication-tokens

And according to these docs I should be able to generate a token in my account setting? I don't see anything in my settings for this. image

Can I generate a token with a different method?

timharek avatar Apr 16 '24 15:04 timharek

Right now, you can not. I have opened a tracking issue and am updating the docs here: https://github.com/jsr-io/jsr/pull/394.

What CI system would you like to publish from?

lucacasonato avatar Apr 17 '24 09:04 lucacasonato

Ah, OK – thanks for the quick reply!

I want to publish from Sourcehut's builds. And I guess that would be possible to do with deno publish --token<access-token-from-jsr>?

timharek avatar Apr 17 '24 09:04 timharek

Yes - that will need #393 first.

lucacasonato avatar Apr 17 '24 14:04 lucacasonato

as a workaround you can use the jsrw_* tokens for now. those are issued for the frontend and stored as a cookie, and they seem to be working fine with --token param. they only live for 7 days, though :c

kunokareal avatar Apr 19 '24 20:04 kunokareal

I am going to close this in favor of #393. I have additionally opened an issue to add documentation on how to publish from alternative CI providers, such as GitLab CI or Sourcehut: #435

lucacasonato avatar Apr 23 '24 13:04 lucacasonato